From: Keith Busch <kbusch@kernel.org>
Date: Mon, 4 Jan 2021 15:02:57 -0800
Subject: PCI/AER: Clear AER status from Root Port when resetting Downstream
Port
Git-commit: 7a8a22be35a5058366429e311017e05206c43137
Patch-mainline: v5.12-rc1
References: bsc#1174426
The pci_dev parameter given to aer_root_reset() may be a Downstream Port
rather than the Root Port. Get the Root Port from the provided device in
order to clear the root's AER status.
Link: https://lore.kernel.org/r/20210104230300.1277180-3-kbusch@kernel.org
Tested-by: Hedi Berriche <hedi.berriche@hpe.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Sean V Kelley <sean.v.kelley@intel.com>
Acked-by: Hedi Berriche <hedi.berriche@hpe.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
---
drivers/pci/pcie/aer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1325,7 +1325,7 @@ static pci_ers_result_t aer_root_reset(s
if (type == PCI_EXP_TYPE_RC_END)
root = dev->rcec;
else
- root = dev;
+ root = pcie_find_root_port(dev);
/*
* If the platform retained control of AER, an RCiEP may not have