Commit ddd57980 authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman

xhci: detect USB 3.2 capable host controllers correctly

USB 3.2 capability in a host can be detected from the
xHCI Supported Protocol Capability major and minor revision fields.

If major is 0x3 and minor 0x20 then the host is USB 3.2 capable.

For USB 3.2 capable hosts set the root hub lane count to 2.

The Major Revision and Minor Revision fields contain a BCD version number.
The value of the Major Revision field is JJh and the value of the Minor
Revision field is MNh for version JJ.M.N, where JJ = major revision number,
M - minor version number, N = sub-minor version number,
e.g. version 3.1 is represented with a value of 0310h.

Also fix the extra whitespace printed out when announcing regular
SuperSpeed hosts.

Cc: <stable@vger.kernel.org> # v4.18+
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b8c3b718
...@@ -5065,16 +5065,26 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) ...@@ -5065,16 +5065,26 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
} else { } else {
/* /*
* Some 3.1 hosts return sbrn 0x30, use xhci supported protocol * Some 3.1 hosts return sbrn 0x30, use xhci supported protocol
* minor revision instead of sbrn * minor revision instead of sbrn. Minor revision is a two digit
* BCD containing minor and sub-minor numbers, only show minor.
*/ */
minor_rev = xhci->usb3_rhub.min_rev; minor_rev = xhci->usb3_rhub.min_rev / 0x10;
if (minor_rev) {
switch (minor_rev) {
case 2:
hcd->speed = HCD_USB32;
hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
hcd->self.root_hub->rx_lanes = 2;
hcd->self.root_hub->tx_lanes = 2;
break;
case 1:
hcd->speed = HCD_USB31; hcd->speed = HCD_USB31;
hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS; hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
break;
} }
xhci_info(xhci, "Host supports USB 3.%x %s SuperSpeed\n", xhci_info(xhci, "Host supports USB 3.%x %sSuperSpeed\n",
minor_rev, minor_rev,
minor_rev ? "Enhanced" : ""); minor_rev ? "Enhanced " : "");
xhci->usb3_rhub.hcd = hcd; xhci->usb3_rhub.hcd = hcd;
/* xHCI private pointer was set in xhci_pci_probe for the second /* xHCI private pointer was set in xhci_pci_probe for the second
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment