From 4d25fd1e66e5a17084ce6128ae29db866a4d240c Mon Sep 17 00:00:00 2001 From: Qiuxu Zhuo Date: Thu, 21 Apr 2022 21:49:55 +0800 Subject: [PATCH] PCI/AER: Add RCEC AER error injection support mainline inclusion from mainline-v5.11-rc1 commit d292dd0eb3ac category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I51U4T CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d292dd0eb3ac6ce6ea66715bb9f6b8e2ae70747c -------------------------------------------------------------------------- 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 Link: https://lore.kernel.org/r/20201121001036.8560-16-sean.v.kelley@intel.com Tested-by: Jonathan Cameron # non-native/no RCEC Signed-off-by: Qiuxu Zhuo Signed-off-by: Sean V Kelley Signed-off-by: Bjorn Helgaas Signed-off-by: Jiefeng Ou Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Jay Fang Reviewed-by: Xiongfeng Wang Signed-off-by: Zheng Zengkai --- drivers/pci/pcie/aer_inject.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c index 4dc1d95f085b..ba11a0eed2be 100644 --- a/drivers/pci/pcie/aer_inject.c +++ b/drivers/pci/pcie/aer_inject.c @@ -341,8 +341,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; } -- GitLab