Commit 3278a55a authored by Sarah Sharp's avatar Sarah Sharp

xhci: Fix oops caused by more USB2 ports than USB3 ports.

The code to set the device removable bits in the USB 2.0 roothub
descriptor was accidentally looking at the USB 3.0 port registers
instead of the USB 2.0 registers.  This can cause an oops if there are
more USB 2.0 registers than USB 3.0 registers.

This should be backported to kernels as old as 2.6.39, that contain the
commit 4bbb0ace "xhci: Return a USB 3.0
hub descriptor for USB3 roothub."
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
parent d9f5343e
...@@ -93,7 +93,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, ...@@ -93,7 +93,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
*/ */
memset(port_removable, 0, sizeof(port_removable)); memset(port_removable, 0, sizeof(port_removable));
for (i = 0; i < ports; i++) { for (i = 0; i < ports; i++) {
portsc = xhci_readl(xhci, xhci->usb3_ports[i]); portsc = xhci_readl(xhci, xhci->usb2_ports[i]);
/* If a device is removable, PORTSC reports a 0, same as in the /* If a device is removable, PORTSC reports a 0, same as in the
* hub descriptor DeviceRemovable bits. * hub descriptor DeviceRemovable bits.
*/ */
......
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