Skip to content

Commit 51c9e6c

Browse files
author
Sarah Sharp
committed
xhci: Avoid dead ports when CONFIG_USB_XHCI_HCD=n
If the user chooses to say "no" to CONFIG_USB_XHCI_HCD on a system with an Intel Panther Point chipset, the PCI quirks code or the EHCI driver will switch the ports over to the xHCI host, but the xHCI driver will never load. The ports will be powered off and seem "dead" to the user. Fix this by only switching the ports over if CONFIG_USB_XHCI_HCD is either compiled in, or compiled as a module. This patch should be backported to stable kernels as old as 3.0, that contain commit 69e848c "Intel xhci: Support EHCI/xHCI port switching." Signed-off-by: Sarah Sharp <[email protected]> Reported-by: Eric Anholt <[email protected]> Reported-by: David Bein <[email protected]> Cc: [email protected]
1 parent 9c74599 commit 51c9e6c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/usb/host/pci-quirks.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <linux/types.h>
12+
#include <linux/kconfig.h>
1213
#include <linux/kernel.h>
1314
#include <linux/pci.h>
1415
#include <linux/init.h>
@@ -742,6 +743,19 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev)
742743
{
743744
u32 ports_available;
744745

746+
/* Don't switchover the ports if the user hasn't compiled the xHCI
747+
* driver. Otherwise they will see "dead" USB ports that don't power
748+
* the devices.
749+
*/
750+
if (!IS_ENABLED(CONFIG_USB_XHCI_HCD)) {
751+
dev_warn(&xhci_pdev->dev,
752+
"CONFIG_USB_XHCI_HCD is turned off, "
753+
"defaulting to EHCI.\n");
754+
dev_warn(&xhci_pdev->dev,
755+
"USB 3.0 devices will work at USB 2.0 speeds.\n");
756+
return;
757+
}
758+
745759
ports_available = 0xffffffff;
746760
/* Write USB3_PSSEN, the USB 3.0 Port SuperSpeed Enable
747761
* Register, to turn on SuperSpeed terminations for all

0 commit comments

Comments
 (0)