diff options
author | Lance Ortiz <lance.ortiz@hp.com> | 2013-05-30 10:25:12 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2013-05-30 13:51:20 -0400 |
commit | 37448adfc7ce0d6d5892b87aa8d57edde4126f49 (patch) | |
tree | 384a776fe506e4dfb1cb6d64cc56ce7ae3c289e9 /drivers/acpi | |
parent | e4aa937ec75df0eea0bee03bffa3303ad36c986b (diff) |
aerdrv: Move cper_print_aer() call out of interrupt context
The following warning was seen on 3.9 when a corrected PCIe error was being
handled by the AER subsystem.
WARNING: at .../drivers/pci/search.c:214 pci_get_dev_by_id+0x8a/0x90()
This occurred because a call to pci_get_domain_bus_and_slot() was added to
cper_print_pcie() to setup for the call to cper_print_aer(). The warning
showed up because cper_print_pcie() is called in an interrupt context and
pci_get* functions are not supposed to be called in that context.
The solution is to move the cper_print_aer() call out of the interrupt
context and into aer_recover_work_func() to avoid any warnings when calling
pci_get* functions.
Signed-off-by: Lance Ortiz <lance.ortiz@hp.com>
Acked-by: Borislav Petkov <bp@suse.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/apei/cper.c | 18 | ||||
-rw-r--r-- | drivers/acpi/apei/ghes.c | 4 |
2 files changed, 3 insertions, 19 deletions
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c index fefc2ca7cc3e..33dc6a004802 100644 --- a/drivers/acpi/apei/cper.c +++ b/drivers/acpi/apei/cper.c | |||
@@ -250,10 +250,6 @@ static const char *cper_pcie_port_type_strs[] = { | |||
250 | static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, | 250 | static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, |
251 | const struct acpi_hest_generic_data *gdata) | 251 | const struct acpi_hest_generic_data *gdata) |
252 | { | 252 | { |
253 | #ifdef CONFIG_ACPI_APEI_PCIEAER | ||
254 | struct pci_dev *dev; | ||
255 | #endif | ||
256 | |||
257 | if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) | 253 | if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) |
258 | printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, | 254 | printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, |
259 | pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ? | 255 | pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ? |
@@ -285,20 +281,6 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, | |||
285 | printk( | 281 | printk( |
286 | "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", | 282 | "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", |
287 | pfx, pcie->bridge.secondary_status, pcie->bridge.control); | 283 | pfx, pcie->bridge.secondary_status, pcie->bridge.control); |
288 | #ifdef CONFIG_ACPI_APEI_PCIEAER | ||
289 | dev = pci_get_domain_bus_and_slot(pcie->device_id.segment, | ||
290 | pcie->device_id.bus, pcie->device_id.function); | ||
291 | if (!dev) { | ||
292 | pr_err("PCI AER Cannot get PCI device %04x:%02x:%02x.%d\n", | ||
293 | pcie->device_id.segment, pcie->device_id.bus, | ||
294 | pcie->device_id.slot, pcie->device_id.function); | ||
295 | return; | ||
296 | } | ||
297 | if (pcie->validation_bits & CPER_PCIE_VALID_AER_INFO) | ||
298 | cper_print_aer(pfx, dev, gdata->error_severity, | ||
299 | (struct aer_capability_regs *) pcie->aer_info); | ||
300 | pci_dev_put(dev); | ||
301 | #endif | ||
302 | } | 284 | } |
303 | 285 | ||
304 | static const char *apei_estatus_section_flag_strs[] = { | 286 | static const char *apei_estatus_section_flag_strs[] = { |
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index d668a8ae602b..403baf4dffc1 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
@@ -454,7 +454,9 @@ static void ghes_do_proc(struct ghes *ghes, | |||
454 | aer_severity = cper_severity_to_aer(sev); | 454 | aer_severity = cper_severity_to_aer(sev); |
455 | aer_recover_queue(pcie_err->device_id.segment, | 455 | aer_recover_queue(pcie_err->device_id.segment, |
456 | pcie_err->device_id.bus, | 456 | pcie_err->device_id.bus, |
457 | devfn, aer_severity); | 457 | devfn, aer_severity, |
458 | (struct aer_capability_regs *) | ||
459 | pcie_err->aer_info); | ||
458 | } | 460 | } |
459 | 461 | ||
460 | } | 462 | } |