]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI/AER: Add bus flag to skip source ID matching
authorJon Derrick <jonathan.derrick@intel.com>
Thu, 25 Aug 2016 23:26:10 +0000 (17:26 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 6 Sep 2016 19:15:11 +0000 (14:15 -0500)
Allow root port buses to choose to skip source id matching when finding the
faulting device.  Certain root port devices may return an incorrect source
ID and recommend to scan child device registers for AER notifications.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/aer/aerdrv_core.c
include/linux/pci.h

index 521e39c1b66d597f8881d9ab02a4e4b41c1b68a0..8f5e14cac600b45a24db556cabd2867613013770 100644 (file)
@@ -132,7 +132,9 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
         * When bus id is equal to 0, it might be a bad id
         * reported by root port.
         */
-       if (!nosourceid && (PCI_BUS_NUM(e_info->id) != 0)) {
+       if (!nosourceid &&
+           (PCI_BUS_NUM(e_info->id) != 0) &&
+           !(dev->bus->bus_flags & PCI_BUS_FLAGS_NO_AERSID)) {
                /* Device ID match? */
                if (e_info->id == ((dev->bus->number << 8) | dev->devfn))
                        return true;
@@ -147,7 +149,8 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
         *      1) nosourceid==y;
         *      2) bus id is equal to 0. Some ports might lose the bus
         *              id of error source id;
-        *      3) There are multiple errors and prior id comparing fails;
+        *      3) bus flag PCI_BUS_FLAGS_NO_AERSID is set
+        *      4) There are multiple errors and prior ID comparing fails;
         * We check AER status registers to find possible reporter.
         */
        if (atomic_read(&dev->enable_cnt) == 0)
index 2599a980340f44f2550bacded406cb34f38808dc..57bc838e0666303ecc907e3c7763754faff887bb 100644 (file)
@@ -187,8 +187,9 @@ enum pci_irq_reroute_variant {
 
 typedef unsigned short __bitwise pci_bus_flags_t;
 enum pci_bus_flags {
-       PCI_BUS_FLAGS_NO_MSI   = (__force pci_bus_flags_t) 1,
-       PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
+       PCI_BUS_FLAGS_NO_MSI    = (__force pci_bus_flags_t) 1,
+       PCI_BUS_FLAGS_NO_MMRBC  = (__force pci_bus_flags_t) 2,
+       PCI_BUS_FLAGS_NO_AERSID = (__force pci_bus_flags_t) 4,
 };
 
 /* These values come from the PCI Express Spec */