Re: [PATCH] Usbcore: Do not disable USB3 protocol ports in hub_activate

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

 



On Wed, Mar 03, 2010 at 11:27:12AM -0500, Alan Stern wrote:
> On Wed, 3 Mar 2010, Andiry Xu wrote:
> 
> > >From 970df30f8661db0f8bc7602adfe07f469f655c86 Mon Sep 17 00:00:00 2001
> > From: Andiry Xu <andiry.xu@xxxxxxx>
> > Date: Wed, 3 Mar 2010 16:13:08 +0800
> > Subject: [PATCH] Usbcore: Do not disable USB3 protocol ports in hub_activate
> > 
> > When USB3 port detects an USB3.0 device attach, the port will
> > automatically transition to the Enabled state upon the completion
> > of successful link training.
> > 
> > Do not clear enable state for USB3 protocol port in hub_activate(),
> > or USB3.0 device will fail to be recognized if xHCI bus power
> > management is implemented.
> > 
> > Signed-off-by: Andiry Xu <andiry.xu@xxxxxxx>
> > ---
> >  drivers/usb/core/hub.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > index 3dfeb4a..ce62218 100644
> > --- a/drivers/usb/core/hub.c
> > +++ b/drivers/usb/core/hub.c
> > @@ -710,7 +710,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
> >  		 * Unconnected ports should likewise be disabled (paranoia),
> >  		 * and so should ports for which we have no usb_device.
> >  		 */
> > -		if ((portstatus & USB_PORT_STAT_ENABLE) && (
> > +		if ((portstatus & USB_PORT_STAT_ENABLE) &&
> > +		    !(portstatus & (1 << USB_PORT_FEAT_SUPERSPEED)) && (
> 
> This can't be right.  There _is_ no SUPERSPEED feature; the macro
> definition in hub.h is bogus.  (For that matter, there is no HIGHSPEED
> feature either -- that ought to be cleaned up.)  Note that (1 <<
> USB_PORT_FEAT_SUPERSPEED) is actually equal to USB_PORT_STAT_TEST --
> which is certainly not what you want.

Hmm, well, I just copied the high speed case when I created
USB_PORT_FEAT_SUPERSPEED.  I really had no idea what the hub driver was
doing.  Maybe you can relook at the xhci-hub.c code and the
modifications I made to khubd?

> I'm not sure exactly what is the right thing to test here; certainly
> you need to check whether the hub supports USB-3.0.  However it's not
> clear exactly how external hubs will behave; the USB-3.0 spec says that
> hubs are the only devices allowed to function at high-speed and
> SuperSpeed at the same time, but it doesn't explain what that entails.

AFAIK, you'll see two hub attaches, one is a SuperSpeed only hub, and
the other is a USB 2.0 hub.  When you unplug the USB 3.0 hub, both of
the devices go away.

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