[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201126011816.711106-2-helgaas@kernel.org>
Date: Wed, 25 Nov 2020 19:18:12 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc: ashok.raj@...el.com, knsathya@...nel.org,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Bjorn Helgaas <bhelgaas@...gle.com>,
Olof Johansson <olof@...om.net>
Subject: [PATCH 1/5] PCI/DPC: Ignore devices with no AER Capability
From: Bjorn Helgaas <bhelgaas@...gle.com>
Downstream Ports may support DPC regardless of whether they support AER
(see PCIe r5.0, sec 6.2.10.2). Previously, if the user booted with
"pcie_ports=dpc-native", it was possible for dpc_probe() to succeed even if
the device had no AER Capability, but dpc_get_aer_uncorrect_severity()
depends on the AER Capability.
dpc_probe() previously failed if:
!pcie_aer_is_native(pdev) && !pcie_ports_dpc_native
!(pcie_aer_is_native() || pcie_ports_dpc_native) # by De Morgan's law
so it succeeded if:
pcie_aer_is_native() || pcie_ports_dpc_native
Fail dpc_probe() if the device has no AER Capability.
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Olof Johansson <olof@...om.net>
---
drivers/pci/pcie/dpc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index e05aba86a317..ed0dbc43d018 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -287,6 +287,9 @@ static int dpc_probe(struct pcie_device *dev)
int status;
u16 ctl, cap;
+ if (!pdev->aer_cap)
+ return -ENOTSUPP;
+
if (!pcie_aer_is_native(pdev) && !pcie_ports_dpc_native)
return -ENOTSUPP;
--
2.25.1
Powered by blists - more mailing lists