aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-04-05 08:47:00 -0400
committerLen Brown <len.brown@intel.com>2006-07-26 01:19:26 -0400
commit16a74744231e57e354253567490ab9e4ccd2d605 (patch)
treef1706a2217f91202f01fd34be820a0d88071815d /drivers/pci
parentb4e54de8d34afe7fcf08bfe91070d9dfeae6ed27 (diff)
PCI: quirk to disable e100 interrupt if RESET failed to
Without this quirk, e100 can be pulling on a shared interrupt line when another device (eg. USB) loads, causing the interrupt to scream and get disabled. http://bugzilla.kernel.org/show_bug.cgi?id=5918 Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/quirks.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e3c78c39b7e4..5ca1e94887be 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1511,6 +1511,63 @@ static void __devinit quirk_netmos(struct pci_dev *dev)
1511} 1511}
1512DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos); 1512DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos);
1513 1513
1514static void __devinit quirk_e100_interrupt(struct pci_dev *dev)
1515{
1516 u16 command;
1517 u32 bar;
1518 u8 __iomem *csr;
1519 u8 cmd_hi;
1520
1521 switch (dev->device) {
1522 /* PCI IDs taken from drivers/net/e100.c */
1523 case 0x1029:
1524 case 0x1030 ... 0x1034:
1525 case 0x1038 ... 0x103E:
1526 case 0x1050 ... 0x1057:
1527 case 0x1059:
1528 case 0x1064 ... 0x106B:
1529 case 0x1091 ... 0x1095:
1530 case 0x1209:
1531 case 0x1229:
1532 case 0x2449:
1533 case 0x2459:
1534 case 0x245D:
1535 case 0x27DC:
1536 break;
1537 default:
1538 return;
1539 }
1540
1541 /*
1542 * Some firmware hands off the e100 with interrupts enabled,
1543 * which can cause a flood of interrupts if packets are
1544 * received before the driver attaches to the device. So
1545 * disable all e100 interrupts here. The driver will
1546 * re-enable them when it's ready.
1547 */
1548 pci_read_config_word(dev, PCI_COMMAND, &command);
1549 pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar);
1550
1551 if (!(command & PCI_COMMAND_MEMORY) || !bar)
1552 return;
1553
1554 csr = ioremap(bar, 8);
1555 if (!csr) {
1556 printk(KERN_WARNING "PCI: Can't map %s e100 registers\n",
1557 pci_name(dev));
1558 return;
1559 }
1560
1561 cmd_hi = readb(csr + 3);
1562 if (cmd_hi == 0) {
1563 printk(KERN_WARNING "PCI: Firmware left %s e100 interrupts "
1564 "enabled, disabling\n", pci_name(dev));
1565 writeb(1, csr + 3);
1566 }
1567
1568 iounmap(csr);
1569}
1570DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt);
1514 1571
1515static void __devinit fixup_rev1_53c810(struct pci_dev* dev) 1572static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
1516{ 1573{