Skip to content

Commit 1f42db7

Browse files
committed
PCI: Enable INTx if BIOS left them disabled
Some firmware leaves the Interrupt Disable bit set even if the device uses INTx interrupts. Clear Interrupt Disable so we get those interrupts. Based on the report mentioned below, if the user selects the "EHCI only" option in the Intel Baytrail BIOS, the EHCI device is handed off to the OS with the PCI_COMMAND_INTX_DISABLE bit set. Link: http://lkml.kernel.org/r/20140114181721.GC12126@xanatos Link: https://bugzilla.kernel.org/show_bug.cgi?id=70601 Reported-by: Chris Cheng <chris.cheng@atrustcorp.com> Reported-and-tested-by: Jamie Chen <jamie.chen@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: stable@vger.kernel.org CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
1 parent 3ce4e86 commit 1f42db7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/pci/pci.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,8 @@ EXPORT_SYMBOL_GPL(pci_load_and_free_saved_state);
11811181
static int do_pci_enable_device(struct pci_dev *dev, int bars)
11821182
{
11831183
int err;
1184+
u16 cmd;
1185+
u8 pin;
11841186

11851187
err = pci_set_power_state(dev, PCI_D0);
11861188
if (err < 0 && err != -EIO)
@@ -1190,6 +1192,14 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars)
11901192
return err;
11911193
pci_fixup_device(pci_fixup_enable, dev);
11921194

1195+
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
1196+
if (pin) {
1197+
pci_read_config_word(dev, PCI_COMMAND, &cmd);
1198+
if (cmd & PCI_COMMAND_INTX_DISABLE)
1199+
pci_write_config_word(dev, PCI_COMMAND,
1200+
cmd & ~PCI_COMMAND_INTX_DISABLE);
1201+
}
1202+
11931203
return 0;
11941204
}
11951205

0 commit comments

Comments
 (0)