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

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

 



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
0x0210 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.

Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
---

Ok, this version actually compiles and doesn't cause kernel oopses.
I'll queue this up to my for-usb-next branch for 3.4 if no one objects.

 drivers/usb/core/hub.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 79d339e..15da2d5 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3142,6 +3142,16 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1)
 	kfree(qual);
 }
 
+static void check_superspeed(struct usb_hub *hub, struct usb_device *udev,
+		int port1)
+{
+	/* BOS descriptor should have already been fetched by now. */
+	if (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0300 &&
+			udev->bos && udev->bos->ss_cap)
+		dev_info(&udev->dev, "not running at top speed; "
+			"connect to a SuperSpeed hub or host\n");
+}
+
 static unsigned
 hub_power_remaining (struct usb_hub *hub)
 {
@@ -3361,6 +3371,7 @@ 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);
+		check_superspeed(hub, udev, port1);
 
 		/* Store the parent's children[] pointer.  At this point
 		 * udev becomes globally accessible, although presumably
-- 
1.7.5.4

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