From: niravkumar.l.rabara@intel.com
To: niravkumar.l.rabara@intel.com
Cc: bp@alien8.de, dinguyen@kernel.org, james.morse@arm.com,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
mchehab@kernel.org, rric@kernel.org, tony.luck@intel.com
Subject: [PATCH v2 2/2] EDAC/altera: Check previous DDR DBE during driver probe
Date: Wed, 3 May 2023 18:18:21 +0800 [thread overview]
Message-ID: <20230503101821.3342935-3-niravkumar.l.rabara@intel.com> (raw)
In-Reply-To: <20230503101821.3342935-1-niravkumar.l.rabara@intel.com>
From: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
Add DDR DBE check during driver probe to notify user if previous
reboot cause by DDR DBE and print DBE error related information.
Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
---
drivers/edac/altera_edac.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 8b31cd54bdb6..398a49a3eb89 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -2159,6 +2159,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
#ifdef CONFIG_64BIT
{
int dberror, err_addr;
+ struct arm_smccc_res result;
edac->panic_notifier.notifier_call = s10_edac_dberr_handler;
atomic_notifier_chain_register(&panic_notifier_list,
@@ -2168,11 +2169,28 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_VAL_OFST,
&dberror);
if (dberror) {
- regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_ADDR_OFST,
- &err_addr);
- edac_printk(KERN_ERR, EDAC_DEVICE,
- "Previous Boot UE detected[0x%X] @ 0x%X\n",
- dberror, err_addr);
+ /* Bit-31 is set if previous DDR UE happened */
+ if (dberror & (1 << 31)) {
+ /* Read previous DDR UE info */
+ arm_smccc_smc(INTEL_SIP_SMC_READ_SEU_ERR, 0,
+ 0, 0, 0, 0, 0, 0, &result);
+
+ if (!(int)result.a0) {
+ edac_printk(KERN_ERR, EDAC_DEVICE,
+ "Previous DDR UE:Count=0x%X,Address=0x%X,ErrorData=0x%X\n"
+ , (unsigned int)result.a1, (unsigned int)result.a2
+ , (unsigned int)result.a3);
+ } else {
+ edac_printk(KERN_ERR, EDAC_DEVICE,
+ "INTEL_SIP_SMC_SEU_ERR_STATUS failed\n");
+ }
+ } else {
+ regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_ADDR_OFST,
+ &err_addr);
+ edac_printk(KERN_ERR, EDAC_DEVICE,
+ "Previous Boot UE detected[0x%X] @ 0x%X\n",
+ dberror, err_addr);
+ }
/* Reset the sticky registers */
regmap_write(edac->ecc_mgr_map,
S10_SYSMGR_UE_VAL_OFST, 0);
@@ -2180,6 +2198,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
S10_SYSMGR_UE_ADDR_OFST, 0);
}
}
+
#else
edac->db_irq = platform_get_irq(pdev, 1);
if (edac->db_irq < 0)
--
2.25.1
next prev parent reply other threads:[~2023-05-03 10:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 6:09 [PATCH 0/2] EDAC/altera: Check previous DDR DBE during driver probe niravkumar.l.rabara
2023-05-03 6:09 ` [PATCH 1/2] firmware: stratix10-svc: Add command to get SEU error info niravkumar.l.rabara
2023-05-03 6:10 ` [PATCH 2/2] EDAC/altera: Check previous DDR DBE during driver probe niravkumar.l.rabara
2023-05-03 10:18 ` [PATCH v2 0/2]EDAC/altera: " niravkumar.l.rabara
2023-05-03 10:18 ` [PATCH v2 1/2] firmware: stratix10-svc: Add command to get SEU error info niravkumar.l.rabara
2023-05-05 12:23 ` Dinh Nguyen
2023-05-03 10:18 ` niravkumar.l.rabara [this message]
2023-05-05 12:25 ` [PATCH v2 2/2] EDAC/altera: Check previous DDR DBE during driver probe Dinh Nguyen
2023-05-11 4:12 ` [PATCH v3 0/2] " niravkumar.l.rabara
2023-05-11 4:12 ` [PATCH v3 1/2] firmware: stratix10-svc: Add command to get SEU error info niravkumar.l.rabara
2023-05-11 4:12 ` [PATCH v3 2/2] EDAC/altera: Check previous DDR DBE during driver probe niravkumar.l.rabara
2023-05-23 12:23 ` dinh.linux
2023-06-15 2:25 ` [PATCH v4 0/1] " niravkumar.l.rabara
2023-06-15 2:25 ` [PATCH v4 1/1] " niravkumar.l.rabara
2023-06-15 18:49 ` Dinh Nguyen
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=20230503101821.3342935-3-niravkumar.l.rabara@intel.com \
--to=niravkumar.l.rabara@intel.com \
--cc=bp@alien8.de \
--cc=dinguyen@kernel.org \
--cc=james.morse@arm.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rric@kernel.org \
--cc=tony.luck@intel.com \
/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).