[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230209-cxl-pci-aer-v1-1-f9a817fa4016@intel.com>
Date: Fri, 10 Feb 2023 14:33:23 -0800
From: Ira Weiny <ira.weiny@...el.com>
To: Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Ben Widawsky <bwidawsk@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Mahesh J Salgaonkar <mahesh@...ux.ibm.com>,
Oliver O'Halloran <oohall@...il.com>
Cc: linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Bjorn Helgaas <helgaas@...nel.org>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Dave Jiang <dave.jiang@...el.com>, Stefan Roese <sr@...x.de>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Ira Weiny <ira.weiny@...el.com>
Subject: [PATCH RFC] PCI/AER: Enable internal AER errors by default
The CXL driver expects internal error reporting to be enabled via
pci_enable_pcie_error_reporting(). It is likely other drivers expect the same.
Dave submitted a patch to enable the CXL side[1] but the PCI AER registers
still mask errors.
PCIe v6.0 Uncorrectable Mask Register (7.8.4.3) and Correctable Mask
Register (7.8.4.6) default to masking internal errors. The
Uncorrectable Error Severity Register (7.8.4.4) defaults internal errors
as fatal.
Enable internal errors to be reported via the standard
pci_enable_pcie_error_reporting() call. Ensure uncorrectable errors are set
non-fatal to limit any impact to other drivers.
[1] https://lore.kernel.org/all/167604864163.2392965.5102660329807283871.stgit@djiang5-mobl3.local/
Cc: Bjorn Helgaas <helgaas@...nel.org>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Dave Jiang <dave.jiang@...el.com>
Cc: Stefan Roese <sr@...x.de>
Cc: "Kuppuswamy Sathyanarayanan" <sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc: Mahesh J Salgaonkar <mahesh@...ux.ibm.com>
Cc: Oliver O'Halloran <oohall@...il.com>
Cc: linux-cxl@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: linux-pci@...r.kernel.org
Cc: linuxppc-dev@...ts.ozlabs.org
Signed-off-by: Ira Weiny <ira.weiny@...el.com>
---
This is RFC to see if it is acceptable to be part of the standard
pci_enable_pcie_error_reporting() call or perhaps a separate pci core
call should be introduced. It is anticipated that enabling this error
reporting is what existing drivers are expecting. The errors are marked
non-fatal therefore it should not adversely affect existing devices.
---
drivers/pci/pcie/aer.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 625f7b2cafe4..9d3ed3a5fc23 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -229,11 +229,28 @@ int pcie_aer_is_native(struct pci_dev *dev)
int pci_enable_pcie_error_reporting(struct pci_dev *dev)
{
+ int pos_cap_err;
+ u32 reg;
int rc;
if (!pcie_aer_is_native(dev))
return -EIO;
+ pos_cap_err = dev->aer_cap;
+
+ /* Unmask correctable and uncorrectable (non-fatal) internal errors */
+ pci_read_config_dword(dev, pos_cap_err + PCI_ERR_COR_MASK, ®);
+ reg &= ~PCI_ERR_COR_INTERNAL;
+ pci_write_config_dword(dev, pos_cap_err + PCI_ERR_COR_MASK, reg);
+
+ pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, ®);
+ reg &= ~PCI_ERR_UNC_INTN;
+ pci_write_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, reg);
+
+ pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_MASK, ®);
+ reg &= ~PCI_ERR_UNC_INTN;
+ pci_write_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_MASK, reg);
+
rc = pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_AER_FLAGS);
return pcibios_err_to_errno(rc);
}
---
base-commit: e5ab7f206ffc873160bd0f1a52cae17ab692a9d1
change-id: 20230209-cxl-pci-aer-18dda61c8239
Best regards,
--
Ira Weiny <ira.weiny@...el.com>
Powered by blists - more mailing lists