diff options
author | Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 2007-12-17 16:39:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 18:04:26 -0500 |
commit | e64aeccbeca1f7e22174ca3a12ec35a8f5566515 (patch) | |
tree | ee091a713624bfcb8faae2e06852efd8faaea816 /drivers/pci | |
parent | 3609801ecc63e7def325752a19065980410d37ad (diff) |
PCI: fix for quirk_e100_interrupt()
Check that the e100 is in the D0 power state. If it's not, it won't
respond to MMIO accesses and we end up with master-abort machine
checks on some platforms.
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/quirks.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 63357f07ca43..637903a2df3a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1415,9 +1415,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos); | |||
1415 | 1415 | ||
1416 | static void __devinit quirk_e100_interrupt(struct pci_dev *dev) | 1416 | static void __devinit quirk_e100_interrupt(struct pci_dev *dev) |
1417 | { | 1417 | { |
1418 | u16 command; | 1418 | u16 command, pmcsr; |
1419 | u8 __iomem *csr; | 1419 | u8 __iomem *csr; |
1420 | u8 cmd_hi; | 1420 | u8 cmd_hi; |
1421 | int pm; | ||
1421 | 1422 | ||
1422 | switch (dev->device) { | 1423 | switch (dev->device) { |
1423 | /* PCI IDs taken from drivers/net/e100.c */ | 1424 | /* PCI IDs taken from drivers/net/e100.c */ |
@@ -1451,6 +1452,17 @@ static void __devinit quirk_e100_interrupt(struct pci_dev *dev) | |||
1451 | if (!(command & PCI_COMMAND_MEMORY) || !pci_resource_start(dev, 0)) | 1452 | if (!(command & PCI_COMMAND_MEMORY) || !pci_resource_start(dev, 0)) |
1452 | return; | 1453 | return; |
1453 | 1454 | ||
1455 | /* | ||
1456 | * Check that the device is in the D0 power state. If it's not, | ||
1457 | * there is no point to look any further. | ||
1458 | */ | ||
1459 | pm = pci_find_capability(dev, PCI_CAP_ID_PM); | ||
1460 | if (pm) { | ||
1461 | pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); | ||
1462 | if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0) | ||
1463 | return; | ||
1464 | } | ||
1465 | |||
1454 | /* Convert from PCI bus to resource space. */ | 1466 | /* Convert from PCI bus to resource space. */ |
1455 | csr = ioremap(pci_resource_start(dev, 0), 8); | 1467 | csr = ioremap(pci_resource_start(dev, 0), 8); |
1456 | if (!csr) { | 1468 | if (!csr) { |