EHCI host broken -- interrupts disabled
A message that is not in the archive (sent off-list or not yet received): 20140114181721.GC12126@xanatos
A message that is not in the archive (sent off-list or not yet received): [email protected]
Bjorn Helgaas
maintainer[+cc linux-pci]
Quoted 51 lines · Alan Stern
Quoted 1 line · Sarah Sharp
Hi Alan,
I'm not a good person to ask about this. Maybe Bjorn can help.
Quoted 31 lines
All this info is second- or third-hand, so please excuse the extremely vague bug report.
A new Intel Atom system (Baytrail) comes with both an xHCI host and an EHCI host, but the BIOS has an "EHCI only" option that hides the xHCI host PCI device from the operating system. It appears that when the BIOS is in this mode, the EHCI PCI interrupt is disabled, and the host simply doesn't work.
Jamie and Gaggery have more details about the system and the exact failure mode. They can provide dmesg as well as a PCI register space dump, if necessary. (Jamie and Gaggery, please note, a publicly archived mailing list is Cc'ed.)
A customer reports that the following patch fixes the issue:
drivers/usb/host/ehci-pci.c +3
-0@@ -112,6 +112,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)case PCI_VENDOR_ID_INTEL :if (pdev->device ==PCI_DEVICE_ID_INTEL_CE4100_USB ) hcd->has_tt =1 ; +/* Baytrail BIOS in EHCI only mode fails to enable interrupts */ +if (pdev->device ==0x0f34 ) +pci_intx (pdev,1 );break ;case PCI_VENDOR_ID_TDI :if (pdev->device ==PCI_DEVICE_ID_TDI_EHCI )Quoted 4 lines
I looked through the USB PCI initialization code, and I can't find any place where interrupts are enabled, so I assume the PCI core is supposed to enable interrupts? Or is it assumed that the system boots with all PCI device interrupts enabled? In that case, is it a BIOS issue?
As I recall, the original PCI spec did not include any way to enable or disable interrupts -- a rather surprising omission. It was added later on.
Anyhow, this is all handled in the PCI core. The device driver shouldn't need to do much more than
pci_enable_device()(which handles power plus I/O and memory resources) andpci_set_master()(which handles DMA). Nothing about enabling interrupt generation.
Quoted 6 lines
A quick search did not show any place where the PCI core explicitly enables interrupts on new devices, so maybe it does assume that the firmware always enables them. I don't know what guarantees (if any) a BIOS is supposed to fulfill.
It seems like the best place to fix this is probably in the PCI core.
I think dev->irq is supposed to be valid after pci_enable_device(), so it seems like it would make sense to clear PCI_COMMAND_INTX_DISABLE there.
I don't know why a BIOS would leave PCI_COMMAND_INTX_DISABLE set for the EHCI device. Does it support MSI, and the BIOS assumes the OS should use that? I don't see any MSI support in the EHCI code. In any case, this doesn't seem like something we need to depend on the BIOS to do for us.
Bjorn
Quoted 3 lines · Bjorn Helgaas
I think
dev->irqis supposed to be valid afterpci_enable_device(), so it seems like it would make sense to clearPCI_COMMAND_INTX_DISABLEthere.
Okay.
Quoted 3 lines
I don't know why a BIOS would leave
PCI_COMMAND_INTX_DISABLEset for the EHCI device. Does it support MSI, and the BIOS assumes the OS should use that? I don't see any MSI support in the EHCI code. In
As far as I know, there aren't any EHCI designs that use MSI. And there is no particular reason why a BIOS would leave INTX_DISABLE set, although come to think of it, there doesn't seem to be any reason why a BIOS should leave that bit clear either.
Quoted 2 lines
any case, this doesn't seem like something we need to depend on the BIOS to do for us.
Could you post a patch for Gaggery or Jamie to try out?
Alan Stern
Bjorn Helgaas
maintainerQuoted 17 lines · Alan Stern
Quoted 3 lines · Bjorn Helgaas
I think
dev->irqis supposed to be valid afterpci_enable_device(), so it seems like it would make sense to clearPCI_COMMAND_INTX_DISABLEthere.Okay.
Quoted 3 lines
I don't know why a BIOS would leave
PCI_COMMAND_INTX_DISABLEset for the EHCI device. Does it support MSI, and the BIOS assumes the OS should use that? I don't see any MSI support in the EHCI code. InAs far as I know, there aren't any EHCI designs that use MSI. And there is no particular reason why a BIOS would leave
INTX_DISABLEset, although come to think of it, there doesn't seem to be any reason why a BIOS should leave that bit clear either.
Quoted 4 lines
Quoted 2 lines
any case, this doesn't seem like something we need to depend on the BIOS to do for us.
Could you post a patch for Gaggery or Jamie to try out?
Can you try the patch below? This is against 6e2d98dc1af4, the tip of the PCI "next" branch, but it should apply easily to any recent kernel.
Can you also collect the dmesg and "lspci -vv" output for reference, in case we need to tweak or rework this in the future? Please remove any non-public details from that information before posting it.
Bjorn
PCI: Enable INTx if BIOS left it disabled
From: Bjorn Helgaas <[email protected]>
Some firmware leaves the Interrupt Disable bit set even if the device uses INTx interrupts. Clear Interrupt Disable so we get those interrupts.
--- drivers/pci/pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/pci/pci.c +10 -0
@@ -1181,6 +1181,8 @@ EXPORT_SYMBOL_GPL(pci_load_and_free_saved_state);static int do_pci_enable_device (struct pci_dev *dev,int bars) {int err; +u16 cmd; +u8 pin; err =pci_set_power_state (dev,PCI_D0 );if (err <0 && err != -EIO )
@@ -1190,6 +1192,14 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars)return err;pci_fixup_device (pci_fixup_enable, dev); +pci_read_config_byte (dev,PCI_INTERRUPT_PIN , &pin); +if (pin) { +pci_read_config_word (dev,PCI_COMMAND , &cmd); +if (cmd &PCI_COMMAND_INTX_DISABLE ) +pci_write_config_word (dev,PCI_COMMAND , + cmd & ~PCI_COMMAND_INTX_DISABLE ); + } +return 0 ; }
Try to apply this patch to kernel 3.8.0.
Make sure the ehci can work fine and lspci show that PCI_COMMAND_INTX_DISABLE is 0.
The patch can resolved this issue.
#lspci -vv
00:1d.0 USB controller: Intel Corporation Device 0f34 (rev 0a) (prog-if 20 [EHCI])
Subsystem: Intel Corporation Device 7270
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 23
Region 0: Memory at 90612000 (32-bit, non-prefetchable) [size=1K]
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [58] Debug port: BAR=1 offset=00a0
Capabilities: [98] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus: TP-
Kernel driver in use: ehci-pci
dmesg:
[ 1.014556] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 1.014559] ehci-pci: EHCI PCI platform driver [ 1.014612] ehci-pci 0000:00:1d.0: setting latency timer to 64 [ 1.014618] ehci-pci 0000:00:1d.0: EHCI Host Controller [ 1.014629] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 1 [ 1.014652] ehci-pci 0000:00:1d.0: debug port 2 [ 1.018562] ehci-pci 0000:00:1d.0: cache line size of 64 is not supported [ 1.018594] ehci-pci 0000:00:1d.0: irq 23, io mem 0x90612000 [ 1.029238] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00 [ 1.029274] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 1.029279] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 1.029283] usb usb1: Product: EHCI Host Controller [ 1.029286] usb usb1: Manufacturer: Linux 3.8.13.13-pci ehci_hcd [ 1.029290] usb usb1: SerialNumber: 0000:00:1d.0 [ 1.029469] hub 1-0:1.0: USB hub found [ 1.029785] ehci-platform: EHCI generic platform driver [ 1.340641] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 1.473442] usb 1-1: New USB device found, idVendor=8087, idProduct=07e6 [ 1.473447] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.475095] hub 1-1:1.0: USB hub found [ 1.749587] usb 1-1.2: new high-speed USB device number 3 using ehci-pci [ 1.841046] usb 1-1.2: New USB device found, idVendor=05e3, idProduct=0608 [ 1.841052] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 1.841056] usb 1-1.2: Product: USB2.0 Hub [ 1.841469] hub 1-1.2:1.0: USB hub found [ 2.115558] usb 1-1.2.1: new high-speed USB device number 4 using ehci-pci [ 2.208321] usb 1-1.2.1: New USB device found, idVendor=05e3, idProduct=0608 [ 2.208327] usb 1-1.2.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 2.208331] usb 1-1.2.1: Product: USB2.0 Hub [ 2.209113] hub 1-1.2.1:1.0: USB hub found [ 2.283104] usb 1-1.2.3: new low-speed USB device number 5 using ehci-pci [ 2.378487] usb 1-1.2.3: New USB device found, idVendor=03f0, idProduct=0c4a [ 2.378492] usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 2.378496] usb 1-1.2.3: Product: HP [ 2.378500] usb 1-1.2.3: Manufacturer: HP [ 2.385945] usbcore: registered new interface driver usbhid [ 2.385950] usbhid: USB HID core driver [ 11.550722] input: HP HP as /devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3:1.0/input/input5 [ 11.550963] hid-generic 0003:03F0:0C4A.0001: input,hidraw0: USB HID v1.11 Mouse [HP HP] on usb-0000:00:1d.0-1.2.3/input0
Jamie
Quoted 5 lines · Jamie
Try to apply this patch to kernel 3.8.0.
Make sure the ehci can work fine and lspci show that
PCI_COMMAND_INTX_DISABLEis 0.The patch can resolved this issue.
Great! Thanks for testing, Jamie.
Bjorn, can you add me to the Cc list for this patch? I'd like to notify other Linux distros when it lands so they can pick it up.
Sarah Sharp
Quoted 63 lines
#lspci -vv
00:1d.0 USB controller: Intel Corporation Device 0f34 (rev 0a) (prog-if 20 [EHCI])
Subsystem: Intel Corporation Device 7270
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 23
Region 0: Memory at 90612000 (32-bit, non-prefetchable) [size=1K]
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mAPME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [58] Debug port: BAR=1 offset=00a0
Capabilities: [98] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus: TP-
Kernel driver in use: ehci-pcidmesg:
[ 1.014556] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 1.014559] ehci-pci: EHCI PCI platform driver [ 1.014612] ehci-pci 0000:00:1d.0: setting latency timer to 64 [ 1.014618] ehci-pci 0000:00:1d.0: EHCI Host Controller [ 1.014629] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 1 [ 1.014652] ehci-pci 0000:00:1d.0: debug port 2 [ 1.018562] ehci-pci 0000:00:1d.0: cache line size of 64 is not supported [ 1.018594] ehci-pci 0000:00:1d.0: irq 23, io mem 0x90612000 [ 1.029238] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00 [ 1.029274] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 1.029279] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 1.029283] usb usb1: Product: EHCI Host Controller [ 1.029286] usb usb1: Manufacturer: Linux 3.8.13.13-pci ehci_hcd [ 1.029290] usb usb1: SerialNumber: 0000:00:1d.0 [ 1.029469] hub 1-0:1.0: USB hub found [ 1.029785] ehci-platform: EHCI generic platform driver [ 1.340641] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 1.473442] usb 1-1: New USB device found, idVendor=8087, idProduct=07e6 [ 1.473447] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.475095] hub 1-1:1.0: USB hub found [ 1.749587] usb 1-1.2: new high-speed USB device number 3 using ehci-pci [ 1.841046] usb 1-1.2: New USB device found, idVendor=05e3, idProduct=0608 [ 1.841052] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 1.841056] usb 1-1.2: Product: USB2.0 Hub [ 1.841469] hub 1-1.2:1.0: USB hub found [ 2.115558] usb 1-1.2.1: new high-speed USB device number 4 using ehci-pci [ 2.208321] usb 1-1.2.1: New USB device found, idVendor=05e3, idProduct=0608 [ 2.208327] usb 1-1.2.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 2.208331] usb 1-1.2.1: Product: USB2.0 Hub [ 2.209113] hub 1-1.2.1:1.0: USB hub found [ 2.283104] usb 1-1.2.3: new low-speed USB device number 5 using ehci-pci [ 2.378487] usb 1-1.2.3: New USB device found, idVendor=03f0, idProduct=0c4a [ 2.378492] usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 2.378496] usb 1-1.2.3: Product: HP [ 2.378500] usb 1-1.2.3: Manufacturer: HP [ 2.385945] usbcore: registered new interface driver usbhid [ 2.385950] usbhid: USB HID core driver [ 11.550722] input: HP HP as /devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3:1.0/input/input5 [ 11.550963] hid-generic 0003:03F0:0C4A.0001: input,hidraw0: USB HID v1.11 Mouse [HP HP] on usb-0000:00:1d.0-1.2.3/input0Jamie
Quoted 11 lines · Sarah Sharp
Quoted 5 lines · Jamie
Try to apply this patch to kernel 3.8.0.
Make sure the ehci can work fine and lspci show that
PCI_COMMAND_INTX_DISABLEis 0.The patch can resolved this issue.
Great! Thanks for testing, Jamie.
Bjorn, can you add me to the Cc list for this patch? I'd like to notify other Linux distros when it lands so they can pick it up.
Might as well mark it for [email protected], so that it does automatically get propagated to the distros...
thanks,
greg k-h
Bjorn Helgaas
maintainerQuoted 5 lines · Jamie
Try to apply this patch to kernel 3.8.0.
Make sure the ehci can work fine and lspci show that
PCI_COMMAND_INTX_DISABLEis 0.The patch can resolved this issue.
Thanks for testing it. Can you collect the complete dmesg output or dmidecode output? (Remove secret details from it, of course.)
I'm going to put this info into a bugzilla report for future reference.
Bjorn
Bjorn Helgaas
maintainerQuoted 11 lines · Bjorn Helgaas
Quoted 5 lines · Jamie
Try to apply this patch to kernel 3.8.0.
Make sure the ehci can work fine and lspci show that
PCI_COMMAND_INTX_DISABLEis 0.The patch can resolved this issue.
Thanks for testing it. Can you collect the complete dmesg output or dmidecode output? (Remove secret details from it, of course.)
I'm going to put this info into a bugzilla report for future reference.
Ping, I'm ready to apply this, just waiting for the dmesg log.
Bjorn
A message that is not in the archive (sent off-list or not yet received): F01C6967BCFFB14E8DF7F5D2FD1053EB1ECC22@PGSMSX103.gar.corp.intel.com
Bjorn Helgaas
maintainerQuoted 3 lines · Jamie
Sorry for late response.
The dmesg attach in the mail.
Thanks, I put this info in
https://bugzilla.kernel.org/show_bug.cgi?id=70601 and applied the patch to pci/misc.
This seems like a potentially important fix, so I think I'll cherry-pick it into for-linus for v3.14.
Bjorn
Quoted 26 lines
Quoted 26 lines
-----Original Message-----
From: Bjorn Helgaas [mailto:[email protected]]
Sent: Wednesday, February 12, 2014 7:24 AM
To: Chen, Jamie
Cc: Alan Stern; Sarah Sharp; USB list; Tsai, Gaggery; [email protected]
Subject: Re: EHCI host broken -- interrupts disabledQuoted 1 line · Bjorn Helgaas
On Mon, Jan 20, 2014 at 5:15 AM, Chen, Jamie <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Try to apply this patch to kernel 3.8.0.
Make sure the ehci can work fine and lspci show that
PCI_COMMAND_INTX_DISABLEis 0.Quoted 7 lines
Quoted 2 lines
The patch can resolved this issue.
Thanks for testing it. Can you collect the complete dmesg output or dmidecode output? (Remove secret details from it, of course.)
I'm going to put this info into a bugzilla report for future reference.
Ping, I'm ready to apply this, just waiting for the dmesg log.
Bjorn
Quoted 11 lines · Bjorn Helgaas
Quoted 3 lines · Jamie
Sorry for late response.
The dmesg attach in the mail.
Thanks, I put this info in
https://bugzilla.kernel.org/show_bug.cgi?id=70601 and applied the patch to pci/misc.This seems like a potentially important fix, so I think I'll cherry-pick it into for-linus for v3.14.
Thanks, Bjorn!
Do you think this patch is a candidate for stable as well? Anyone with an EHCI-only Baytrail system won't have working USB without this patch, and the patch itself seems relatively small.
Sarah Sharp
Bjorn Helgaas
maintainerQuoted 10 lines · Sarah Sharp
Quoted 9 lines · Bjorn Helgaas
Quoted 3 lines · Jamie
Sorry for late response.
The dmesg attach in the mail.
Thanks, I put this info in
https://bugzilla.kernel.org/show_bug.cgi?id=70601 and applied the patch to pci/misc.
Quoted 8 lines
Quoted 2 lines
This seems like a potentially important fix, so I think I'll cherry-pick it into for-linus for v3.14.
Thanks, Bjorn!
Do you think this patch is a candidate for stable as well? Anyone with an EHCI-only Baytrail system won't have working USB without this patch, and the patch itself seems relatively small.
Yep, I marked it for stable. I'll ask Linus to pull it early next week, after it has appeared in at least one -next kernel.
Bjorn
A message that is not in the archive (sent off-list or not yet received): CAAzarHXkEZNKbWzbMAwHYWNm_=m1uiyGGWHSWv6T7-ARAELaHg@mail.gmail.com
Re: USB EHCI broken on Celeron N2920 (Bay Trail)
Hi Chris,
We think the Baytrail BIOS has an issue where it doesn't set the EHCI PCI interrupt enable bit when the computer is in "EHCI only mode". Please try this patch:
http://marc.info/?l=linux-usb&m=138998295909608&w=2
Sarah Sharp
Quoted 28 lines · Chris Cheng
I'm sorry forgot kernel version: 3.13.0 .
--
Chris Cheng 鄭宇廷
Atrust Computer Corp. 冠信電腦股份有限公司
http://www.atrustcorp.com
Tel: +886-3-3288837 ext.1074
3F., No.361, Fusing 1st Rd., Gueishan Township, Taoyuan County 333, Taiwan 333 桃園縣龜山鄉復興一路361號3F2014/1/21 Chris Cheng <[email protected]>:
Quoted 12 lines
Here is kernel message:
[ 2.939251] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 18.490987] usb 1-1: device not accepting address 2, error -110 [ 18.595095] usb 1-1: new high-speed USB device number 3 using ehci-pci [ 34.182233] usb 1-1: device not accepting address 3, error -110 [ 34.286352] usb 1-1: new high-speed USB device number 4 using ehci-pci [ 44.744589] usb 1-1: device not accepting address 4, error -110 [ 44.849590] usb 1-1: new high-speed USB device number 5 using ehci-pci [ 55.307858] usb 1-1: device not accepting address 5, error -110 [ 55.310239] hub 1-0:1.0: unable to enumerate USB device on port 1Quoted 1 line
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB EHCI broken on Celeron N2920 (Bay Trail)
Hi Sarah,
The patch is useful, thanks for your help.
Thanks.
--
Chris Cheng 鄭宇廷
Atrust Computer Corp. 冠信電腦股份有限公司
http://www.atrustcorp.com
Tel: +886-3-3288837 ext.1074
3F., No.361, Fusing 1st Rd., Gueishan Township, Taoyuan County 333, Taiwan 333 桃園縣龜山鄉復興一路361號3F
2014/1/22 Sarah Sharp <[email protected]>:
Quoted 40 lines
Hi Chris,
We think the Baytrail BIOS has an issue where it doesn't set the EHCI PCI interrupt enable bit when the computer is in "EHCI only mode". Please try this patch:
http://marc.info/?l=linux-usb&m=138998295909608&w=2
Sarah Sharp
Quoted 28 lines · Chris Cheng
I'm sorry forgot kernel version: 3.13.0 .
--
Chris Cheng 鄭宇廷
Atrust Computer Corp. 冠信電腦股份有限公司
http://www.atrustcorp.com
Tel: +886-3-3288837 ext.1074
3F., No.361, Fusing 1st Rd., Gueishan Township, Taoyuan County 333, Taiwan 333 桃園縣龜山鄉復興一路361號3F2014/1/21 Chris Cheng <[email protected]>:
Quoted 12 lines
Here is kernel message:
[ 2.939251] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 18.490987] usb 1-1: device not accepting address 2, error -110 [ 18.595095] usb 1-1: new high-speed USB device number 3 using ehci-pci [ 34.182233] usb 1-1: device not accepting address 3, error -110 [ 34.286352] usb 1-1: new high-speed USB device number 4 using ehci-pci [ 44.744589] usb 1-1: device not accepting address 4, error -110 [ 44.849590] usb 1-1: new high-speed USB device number 5 using ehci-pci [ 55.307858] usb 1-1: device not accepting address 5, error -110 [ 55.310239] hub 1-0:1.0: unable to enumerate USB device on port 1Quoted 1 line
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html