linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naveen Naidu <naveennaidu479@gmail.com>
To: bhelgaas@google.com, tsbogend@alpha.franken.de,
	ruscur@russell.cc, oohall@gmail.com
Cc: Naveen Naidu <naveennaidu479@gmail.com>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	skhan@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-mips@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 1/6] PCI/AER: Enable COR/UNCOR error reporting in set_device_error_reporting()
Date: Mon,  4 Oct 2021 23:29:27 +0530	[thread overview]
Message-ID: <b583172ece1fb1dab3d75c6007ec8c443323158d.1633369560.git.naveennaidu479@gmail.com> (raw)
In-Reply-To: <cover.1633369560.git.naveennaidu479@gmail.com>

The (PCIe r5.0, sec 7.6.4.3, Table 7-101) and  (PCIe r5.0, sec 7.8.4.6,
Table 7-104) states that the default values for the Uncorrectable Error
Mask and Correctable Error Mask should be 0b. But the current code does
not set the default value of these registers when the PCIe bus loads the
AER service driver.

Enable reporting of all correctable and uncorrectable errors during
aer_probe()

Signed-off-by: Naveen Naidu <naveennaidu479@gmail.com>
---
 drivers/pci/pcie/aer.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 9784fdcf3006..88c4ca6098fb 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1212,6 +1212,7 @@ static int set_device_error_reporting(struct pci_dev *dev, void *data)
 {
 	bool enable = *((bool *)data);
 	int type = pci_pcie_type(dev);
+	int aer = dev->aer_cap;
 
 	if ((type == PCI_EXP_TYPE_ROOT_PORT) ||
 	    (type == PCI_EXP_TYPE_RC_EC) ||
@@ -1223,8 +1224,18 @@ static int set_device_error_reporting(struct pci_dev *dev, void *data)
 			pci_disable_pcie_error_reporting(dev);
 	}
 
-	if (enable)
+	if (enable) {
+
+		/* Enable reporting of all uncorrectable errors */
+		/* Uncorrectable Error Mask - turned on bits disable errors */
+		pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, 0);
+
+		/* Enable reporting of all correctable errors */
+		/* Correctable Error Mask - turned on bits disable errors */
+		pci_write_config_dword(dev, aer + PCI_ERR_COR_MASK, 0);
+
 		pcie_set_ecrc_checking(dev);
+	}
 
 	return 0;
 }
-- 
2.25.1


  reply	other threads:[~2021-10-04 18:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 17:59 [PATCH 0/6] MIPS: OCTEON: Remove redundant AER code Naveen Naidu
2021-10-04 17:59 ` Naveen Naidu [this message]
2021-10-19 22:44   ` [PATCH 1/6] PCI/AER: Enable COR/UNCOR error reporting in set_device_error_reporting() Bjorn Helgaas
2021-10-04 17:59 ` [PATCH 2/6] MIPS: OCTEON: Remove redundant clearing of AER status registers Naveen Naidu
2021-10-19 22:53   ` Bjorn Helgaas
2021-10-04 17:59 ` [PATCH 3/6] MIPS: OCTEON: Remove redundant enable of PCIe normal error reporting Naveen Naidu
2021-10-04 17:59 ` [PATCH 4/6] MIPS: OCTEON: Remove redundant enable of COR/UNCOR error Naveen Naidu
2021-10-04 17:59 ` [PATCH 5/6] MIPS: OCTEON: Remove redundant ECRC Generation Enable Naveen Naidu
2021-10-04 17:59 ` [PATCH 6/6] MIPS: OCTEON: Remove redundant enable of RP error reporting Naveen Naidu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b583172ece1fb1dab3d75c6007ec8c443323158d.1633369560.git.naveennaidu479@gmail.com \
    --to=naveennaidu479@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oohall@gmail.com \
    --cc=ruscur@russell.cc \
    --cc=skhan@linuxfoundation.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).