Bug 52591 - xhci module fails when booting in UEFI mode
Summary: xhci module fails when booting in UEFI mode
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_pci@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-11 19:37 UTC by frederik
Modified: 2013-09-11 18:48 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.2 - 3.7
Subsystem:
Regression: No
Bisected commit-id:


Attachments
3.7+ dmesg (66.35 KB, text/plain)
2013-02-19 22:50 UTC, Bjorn Helgaas
Details
lspci -vv (27.85 KB, text/plain)
2013-02-19 22:51 UTC, Bjorn Helgaas
Details
dmesg 3.8.0-rc7 (58.68 KB, text/plain)
2013-02-20 07:44 UTC, Hannes Reinecke
Details
lspci -vv (25 bytes, text/plain)
2013-02-20 07:44 UTC, Hannes Reinecke
Details
pci: do not try to assign irq 255 (1.25 KB, patch)
2013-02-20 07:48 UTC, Hannes Reinecke
Details | Diff
dmesg 3.8.0-rc7-fixed (60.77 KB, text/plain)
2013-02-20 07:49 UTC, Hannes Reinecke
Details
lspci -vv (25 bytes, text/plain)
2013-02-20 07:50 UTC, Hannes Reinecke
Details
acpi dump (685.95 KB, text/plain)
2013-02-20 07:55 UTC, Hannes Reinecke
Details

Description frederik 2013-01-11 19:37:47 UTC
I've got a HP EliteBook 8470p on which I installed Debian Wheezy in UEFI 
mode. With both the 3.2 kernel from Wheezy, as the 3.7.1 kernel from 
experimental, xhci fails to initialize and my USB mouse connected to one 
of these ports is not recognized at all. The USB3 ports work fine in 
Windows.

[    1.316248] xhci_hcd 0000:00:14.0: can't derive routing for PCI INT A
[    1.316251] xhci_hcd 0000:00:14.0: PCI INT A: no GSI
[    1.316253] 
[    1.316277] xhci_hcd 0000:00:14.0: setting latency timer to 64
[    1.316281] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    1.316287] xhci_hcd 0000:00:14.0: new USB bus registered, assigned 
bus number 1
[    1.316393] xhci_hcd 0000:00:14.0: cache line size of 64 is not 
supported
[    1.316395] xhci_hcd 0000:00:14.0: request interrupt 255 failed
[    1.316447] xhci_hcd 0000:00:14.0: USB bus 1 deregistered
[    1.316466] xhci_hcd 0000:00:14.0: can't derive routing for PCI INT A
[    1.316467] xhci_hcd 0000:00:14.0: init 0000:00:14.0 fail, -22
[    1.316505] xhci_hcd: probe of 0000:00:14.0 failed with error -22

Full dmesg, lspci, lsusb and lsmod can be found here:
http://artipc10.vub.ac.be/~frederik/uefi-xhci/

I found this report about the same problem on a HP Probook system: 
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1072918
Comment 1 Bjorn Helgaas 2013-02-19 22:50:06 UTC
Created attachment 93621 [details]
3.7+ dmesg

From http://artipc10.vub.ac.be/~frederik/uefi-xhci/dmesg
Comment 2 Bjorn Helgaas 2013-02-19 22:51:08 UTC
Created attachment 93631 [details]
lspci -vv

From http://artipc10.vub.ac.be/~frederik/uefi-xhci/lspci
Comment 3 Hannes Reinecke 2013-02-20 07:44:09 UTC
Created attachment 93651 [details]
dmesg 3.8.0-rc7

Dmesg from stock 3.8.0-rc7.
Comment 4 Hannes Reinecke 2013-02-20 07:44:48 UTC
Created attachment 93661 [details]
lspci -vv

lspci -vv from 3.8.0-rc7
Comment 5 Hannes Reinecke 2013-02-20 07:48:21 UTC
Created attachment 93671 [details]
pci: do not try to assign irq 255

Proposed patch.
Comment 6 Hannes Reinecke 2013-02-20 07:49:21 UTC
Created attachment 93681 [details]
dmesg 3.8.0-rc7-fixed

Dmesg after patching kernel.
Comment 7 Hannes Reinecke 2013-02-20 07:50:01 UTC
Created attachment 93691 [details]
lspci -vv

lspci -vv from the patched kernel.
Comment 8 Hannes Reinecke 2013-02-20 07:53:49 UTC
The proposed patch makes the system boot and seems to work as expected.
However, I'm not sure here if that's a generic fix (irq 255 has a questionable existence anyway) or if it should move into a quirk.
Comment 9 Hannes Reinecke 2013-02-20 07:55:03 UTC
Created attachment 93731 [details]
acpi dump

Output of acpidump from the system.
Comment 10 Hannes Reinecke 2013-02-20 07:56:02 UTC
And here is the ACPI dump for completeness. As you can see, the xhci device does not appear in the ACPI tables, hence the fallback to the old, supposedly obsolete method for selecting INTx.
Comment 11 Hannes Reinecke 2013-02-20 10:11:49 UTC
The curious thing here is that when booted with CSM only the BIOS assigns IRQ 10 to the device, so we're hitting a different branch in drivers/acpi/pci_irq.c:

		/* Interrupt Line values above 0xF are forbidden */
		if (dev->irq > 0 && (dev->irq <= 0xF) &&
		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
				 pin_name(pin), dev->irq);
			acpi_register_gsi(&dev->dev, dev_gsi,
					  ACPI_LEVEL_SENSITIVE,
					  ACPI_ACTIVE_LOW);
		} else {
			dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
				 pin_name(pin));
		}
		return 0;

hence these devices work when booted with CSM only.
Comment 12 Hannes Reinecke 2013-02-20 10:51:37 UTC
Which, of course, leads to an alternative fix:

diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 68a921d..d5db256 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -469,6 +469,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
                } else {
                        dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
                                 pin_name(pin));
+                       dev->irq = -1;
                }
                return 0;
        }
Comment 13 Hannes Reinecke 2013-02-20 10:52:07 UTC
Except that the '-1' should be a '0'.
Of course.
Comment 14 frederik 2013-09-11 18:48:17 UTC
This is working now with recent Linux kernels thanks to this commit
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=00eed9c814cb8f281be6f0f5d8f45025dc0a97eb

Note You need to log in before you can comment on or make changes to this bug.