aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiuxu Zhuo <[email protected]>2020-11-20 16:10:36 -0800
committerBjorn Helgaas <[email protected]>2020-12-05 15:26:02 -0600
commitd292dd0eb3ac6ce6ea66715bb9f6b8e2ae70747c (patch)
treef4708e31fd1562f3aa6c269949be8000302a6581
parent9a2f604f44979e0effa8cf067e5a8ecda729f23b (diff)
PCI/AER: Add RCEC AER error injection support
Root Complex Event Collectors (RCEC) appear as peers to Root Ports and may also have the AER capability. Add RCEC support to the AER error injection driver. Co-developed-by: Sean V Kelley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Jonathan Cameron <[email protected]> # non-native/no RCEC Signed-off-by: Qiuxu Zhuo <[email protected]> Signed-off-by: Sean V Kelley <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>
-rw-r--r--drivers/pci/pcie/aer_inject.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c
index c2cbf425afc5..767f8859b99b 100644
--- a/drivers/pci/pcie/aer_inject.c
+++ b/drivers/pci/pcie/aer_inject.c
@@ -333,8 +333,11 @@ static int aer_inject(struct aer_error_inj *einj)
if (!dev)
return -ENODEV;
rpdev = pcie_find_root_port(dev);
+ /* If Root Port not found, try to find an RCEC */
+ if (!rpdev)
+ rpdev = dev->rcec;
if (!rpdev) {
- pci_err(dev, "Root port not found\n");
+ pci_err(dev, "Neither Root Port nor RCEC found\n");
ret = -ENODEV;
goto out_put;
}