aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Derrick <jonathan.derrick@intel.com>2016-08-25 19:26:10 -0400
committerBjorn Helgaas <bhelgaas@google.com>2016-09-06 15:15:11 -0400
commit032c3d86b4acc4c21e435c85c454eac670c15851 (patch)
treecba5819b11e185a6a17ca20a79ce34b4675b147e
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
PCI/AER: Add bus flag to skip source ID matching
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>
-rw-r--r--drivers/pci/pcie/aer/aerdrv_core.c7
-rw-r--r--include/linux/pci.h5
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index 521e39c1b66d..8f5e14cac600 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -132,7 +132,9 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
132 * When bus id is equal to 0, it might be a bad id 132 * When bus id is equal to 0, it might be a bad id
133 * reported by root port. 133 * reported by root port.
134 */ 134 */
135 if (!nosourceid && (PCI_BUS_NUM(e_info->id) != 0)) { 135 if (!nosourceid &&
136 (PCI_BUS_NUM(e_info->id) != 0) &&
137 !(dev->bus->bus_flags & PCI_BUS_FLAGS_NO_AERSID)) {
136 /* Device ID match? */ 138 /* Device ID match? */
137 if (e_info->id == ((dev->bus->number << 8) | dev->devfn)) 139 if (e_info->id == ((dev->bus->number << 8) | dev->devfn))
138 return true; 140 return true;
@@ -147,7 +149,8 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
147 * 1) nosourceid==y; 149 * 1) nosourceid==y;
148 * 2) bus id is equal to 0. Some ports might lose the bus 150 * 2) bus id is equal to 0. Some ports might lose the bus
149 * id of error source id; 151 * id of error source id;
150 * 3) There are multiple errors and prior id comparing fails; 152 * 3) bus flag PCI_BUS_FLAGS_NO_AERSID is set
153 * 4) There are multiple errors and prior ID comparing fails;
151 * We check AER status registers to find possible reporter. 154 * We check AER status registers to find possible reporter.
152 */ 155 */
153 if (atomic_read(&dev->enable_cnt) == 0) 156 if (atomic_read(&dev->enable_cnt) == 0)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2599a980340f..57bc838e0666 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -187,8 +187,9 @@ enum pci_irq_reroute_variant {
187 187
188typedef unsigned short __bitwise pci_bus_flags_t; 188typedef unsigned short __bitwise pci_bus_flags_t;
189enum pci_bus_flags { 189enum pci_bus_flags {
190 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, 190 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1,
191 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, 191 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
192 PCI_BUS_FLAGS_NO_AERSID = (__force pci_bus_flags_t) 4,
192}; 193};
193 194
194/* These values come from the PCI Express Spec */ 195/* These values come from the PCI Express Spec */