mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
PCI/AER: Take reference on error devices
[ Upstream commit 60271ab044 ]
Error handling may be running in parallel with a hot removal. Reference
count the device during AER handling so the device can not be freed while
AER wants to reference it.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
40ebd8b31f
commit
f3f55d83ea
@@ -866,7 +866,7 @@ void cper_print_aer(struct pci_dev *dev, int aer_severity,
|
||||
static int add_error_device(struct aer_err_info *e_info, struct pci_dev *dev)
|
||||
{
|
||||
if (e_info->error_dev_num < AER_MAX_MULTI_ERR_DEVICES) {
|
||||
e_info->dev[e_info->error_dev_num] = dev;
|
||||
e_info->dev[e_info->error_dev_num] = pci_dev_get(dev);
|
||||
e_info->error_dev_num++;
|
||||
return 0;
|
||||
}
|
||||
@@ -1013,6 +1013,7 @@ static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info)
|
||||
pcie_do_nonfatal_recovery(dev);
|
||||
else if (info->severity == AER_FATAL)
|
||||
pcie_do_fatal_recovery(dev, PCIE_PORT_SERVICE_AER);
|
||||
pci_dev_put(dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI_APEI_PCIEAER
|
||||
|
||||
Reference in New Issue
Block a user