aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-06-06 14:10:46 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-06-06 16:31:42 -0400
commit8b8d2b658f2cb7092672a56c72b41121ce786d93 (patch)
tree0e0d26115dcb96c4ee13436375ef783ff477234d
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
PCI/AER: Don't parse HEST table for non-PCIe devices
AER is a PCIe-only capability, so there's no point in trying to match a HEST PCIe structure with a non-PCIe device. Previously, a HEST global AER bridge entry (type 8) could incorrectly match *any* bridge, even a legacy PCI-PCI bridge, and a non-global HEST entry could match a legacy PCI device. Tested-by: Betty Dall <betty.dall@hp.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/pcie/aer/aerdrv_acpi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c
index 5194a7d41730..4f798ab629c8 100644
--- a/drivers/pci/pcie/aer/aerdrv_acpi.c
+++ b/drivers/pci/pcie/aer/aerdrv_acpi.c
@@ -59,8 +59,7 @@ static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data)
59 59
60 p = (struct acpi_hest_aer_common *)(hest_hdr + 1); 60 p = (struct acpi_hest_aer_common *)(hest_hdr + 1);
61 if (p->flags & ACPI_HEST_GLOBAL) { 61 if (p->flags & ACPI_HEST_GLOBAL) {
62 if ((pci_is_pcie(info->pci_dev) && 62 if ((pci_pcie_type(info->pci_dev) == pcie_type) || bridge)
63 pci_pcie_type(info->pci_dev) == pcie_type) || bridge)
64 ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST); 63 ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
65 } else 64 } else
66 if (hest_match_pci(p, info->pci_dev)) 65 if (hest_match_pci(p, info->pci_dev))
@@ -89,6 +88,9 @@ static void aer_set_firmware_first(struct pci_dev *pci_dev)
89 88
90int pcie_aer_get_firmware_first(struct pci_dev *dev) 89int pcie_aer_get_firmware_first(struct pci_dev *dev)
91{ 90{
91 if (!pci_is_pcie(dev))
92 return 0;
93
92 if (!dev->__aer_firmware_first_valid) 94 if (!dev->__aer_firmware_first_valid)
93 aer_set_firmware_first(dev); 95 aer_set_firmware_first(dev);
94 return dev->__aer_firmware_first; 96 return dev->__aer_firmware_first;