]> git.hungrycats.org Git - linux/commitdiff
xhci: Show what USB release number the xHC supports from protocol capablity
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 16 Mar 2018 14:33:06 +0000 (16:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:46:10 +0000 (16:46 +0200)
[ Upstream commit 0ee78c101425aae681c631ba59c6ac7f44b1d83a ]

xhci driver displays the supported xHC USB revision in a message during
driver load:

"Host supports USB 3.1 Enhanced SuperSpeed"

Get the USB minor revision number from the xhci protocol capability.
This will show the correct supported revisions for new USB 3.2 and later
hosts

Don't rely on the SBRN (serial bus revision number) register, it's often
showing 0x30 (USB3.0) for hosts that support USB 3.1

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c

index b60a02c50b89a43d28bc0599844ab85df88c6f04..bd281a96485c0281f143c37d0fccde434d076011 100644 (file)
@@ -4769,6 +4769,7 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
         * quirks
         */
        struct device           *dev = hcd->self.sysdev;
+       unsigned int            minor_rev;
        int                     retval;
 
        /* Accept arbitrarily long scatter-gather lists */
@@ -4796,12 +4797,19 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
                 */
                hcd->has_tt = 1;
        } else {
-               /* Some 3.1 hosts return sbrn 0x30, can't rely on sbrn alone */
-               if (xhci->sbrn == 0x31 || xhci->usb3_rhub.min_rev >= 1) {
-                       xhci_info(xhci, "Host supports USB 3.1 Enhanced SuperSpeed\n");
+               /*
+                * Some 3.1 hosts return sbrn 0x30, use xhci supported protocol
+                * minor revision instead of sbrn
+                */
+               minor_rev = xhci->usb3_rhub.min_rev;
+               if (minor_rev) {
                        hcd->speed = HCD_USB31;
                        hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
                }
+               xhci_info(xhci, "Host supports USB 3.%x %s SuperSpeed\n",
+                         minor_rev,
+                         minor_rev ? "Enhanced" : "");
+
                /* xHCI private pointer was set in xhci_pci_probe for the second
                 * registered roothub.
                 */