Re: [PATCH v2] USB: Warn about USB3 devices plugged into USB2 hub.

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

 



On Tue, 10 Jan 2012, Sarah Sharp wrote:

> When a SuperSpeed device is plugged into a high speed hub or an EHCI
> port, it will show up as a high speed device with a BCD of 0x0201 or
> 0x210 and it will contain a SuperSpeed Capabilities BOS descriptor.  If
> we see such a high speed device, warn the user that they should plug
> their device into a USB 3.0 hub or xHCI root port.  Only warn the user
> if there is at least one SuperSpeed roothub available.
> 
> We could attempt to fetch BOS descriptors for low or full speed devices,
> in case the user plugs in a USB 3.0 device into an OHCI or UHCI-only
> port, but it's possible those devices will choke on the request and fail
> to be enumerated.  Keep the current behavior of only asking for BOS
> descriptors for devices that advertise a bcdUSB of 0x0201 and above.
> 
> Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Cc: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
>  drivers/usb/core/hub.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 79d339e..1224a69 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c

> @@ -3361,6 +3375,10 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
>  				&& udev->speed == USB_SPEED_FULL
>  				&& highspeed_hubs != 0)
>  			check_highspeed (hub, udev, port1);
> +		if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0201 &&
> +				udev->speed == USB_SPEED_HIGH &&
> +				superspeed_hubs != 0)
> +			check_superspeed(hub, udev, port1);

I'm probably just repeating Sebastian's advice, but...

There's no reason to check bcdUSB.  All you care about is whether or
not there is a BOS descriptor with an SS capability, and
check_superspeed() looks for that.

Also, for thoroughness the test should be udev->speed <
USB_SPEED_SUPER.  (The highspeed check code ought to have done the same
sort of thing.)  In theory, somebody could plug a USB-3.0 device into a
USB-1.1 controller.

Alan Stern

--
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