Re: [RFC 3/7] xhci: Fix check for LS/FS device attached to roothub.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 31, 2010 at 12:21:55PM -0500, Alan Stern wrote:
> On Thu, 30 Dec 2010, Sarah Sharp wrote:
> 
> > Once the xHCI host controller has a USB 2.0 roothub and a USB 3.0 roothub,
> > the TT field of the USB 2.0 roothub usb device will no longer be null.
> 
> Do you mean the tt field of the root hub usb_hub structure?  It doesn't 
> need to be set unless xHCI root hubs really do contain a Transaction 
> Translator, and from what you write below I suspect they don't.

Yes, the xHCI host controller doesn't contain a TT.

> >  To
> > check whether a LS/FS device is plugged into the HS roothub, see if the
> > parent's parent is NULL.  We don't need the TT information if the LS/FS
> > device is plugged into a roothub port.
> 
> Then udev->tt shouldn't be set if udev is plugged into an xHCI root 
> hub.  Maybe you should change that instead of changing this.

Ok. Are you suggesting I change this code in hub_port_init():

        /* Set up TT records, if needed  */
        if (hdev->tt) {
                udev->tt = hdev->tt;
                udev->ttport = hdev->ttport;
        } else if (udev->speed != USB_SPEED_HIGH
                        && hdev->speed == USB_SPEED_HIGH) {
                udev->tt = &hub->tt;
                udev->ttport = port1;
        }

to
        /* Set up TT records, if needed.
	 * The xHCI USB 2.0 roothub doesn't have a TT.
	 */
        if (hdev->tt) {
                udev->tt = hdev->tt;
                udev->ttport = hdev->ttport;
        } else if (udev->speed != USB_SPEED_HIGH
                        && hdev->speed == USB_SPEED_HIGH
			&& (hdev->parent ||
				hcd->driver->flags & HCD_USB3) {
                udev->tt = &hub->tt;
                udev->ttport = port1;
        }

?

> 
> > This bug would only show up after the split roothub code is added.
> > 
> > Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
> > ---
> >  drivers/usb/host/xhci-mem.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> > index 1d0f45f..76a9f1c 100644
> > --- a/drivers/usb/host/xhci-mem.c
> > +++ b/drivers/usb/host/xhci-mem.c
> > @@ -870,9 +870,9 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
> >  	dev->port = top_dev->portnum;
> >  	xhci_dbg(xhci, "Set root hub portnum to %d\n", top_dev->portnum);
> >  
> > -	/* Is this a LS/FS device under a HS hub? */
> > +	/* Is this a LS/FS device under an external HS hub? */
> >  	if ((udev->speed == USB_SPEED_LOW || udev->speed == USB_SPEED_FULL) &&
> 
> These tests are redundant.  udev->tt will not be set unless the speed 
> is LOW or FULL.

Ok, I'll remove them.

> > -			udev->tt) {
> > +			udev->parent->parent && udev->tt) {
> >  		slot_ctx->tt_info = udev->tt->hub->slot_id;
> >  		slot_ctx->tt_info |= udev->ttport << 8;
> >  		if (udev->tt->multi)

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux