Thread (29 messages) 29 messages, 7 authors, 2023-07-03

RE: [PATCH v2 05/19] EDAC/synopsys: Fix reading errors count before ECC status

From: "Datta, Shubhrajyoti" <shubhrajyoti.datta@amd.com>
Date: 2022-09-12 05:26:16
Also in: linux-devicetree, linux-edac, lkml

[AMD Official Use Only - General]


-----Original Message-----
From: Serge Semin <redacted>
Sent: Sunday, September 11, 2022 1:12 AM
To: Rob Herring <robh+dt@kernel.org>; Krzysztof Kozlowski
[off-list ref]; Michal Simek
[off-list ref]; Borislav Petkov [off-list ref]; Mauro
Carvalho Chehab [off-list ref]; Tony Luck
[off-list ref]; James Morse [off-list ref]; Robert
Richter [off-list ref]; Shubhrajyoti Datta
[off-list ref]
Cc: Serge Semin <redacted>; Serge Semin
[off-list ref]; Alexey Malahov
[off-list ref]; Michail Ivanov
[off-list ref]; Pavel Parkhomenko
[off-list ref]; Punnaiah Choudary Kalluri
[off-list ref]; Manish Narani
[off-list ref]; Dinh Nguyen [off-list ref]; Rob
Herring [off-list ref]; Krzysztof Kozlowski
[off-list ref]; devicetree@vger.kernel.org; linux-arm-
kernel@lists.infradead.org; linux-edac@vger.kernel.org; linux-
kernel@vger.kernel.org; Borislav Petkov [off-list ref]
Subject: [PATCH v2 05/19] EDAC/synopsys: Fix reading errors count before
ECC status

CAUTION: This message has originated from an External Source. Please use
proper judgment and caution when opening attachments, clicking links, or
responding to this email.


Aside with fixing the errors count CSR usage the commit e2932d1f6f05
("EDAC/synopsys: Read the error count from the correct register") all of the
sudden has also changed the order of the errors status check procedure. So
now the errors handler method first reads the number of CE and UE and only
then makes sure that any of these errors have actually happened. It doesn't
make much sense. Let's fix that by getting back the procedures order: first
check the ECC status, then read the number of errors.

Fixes: e2932d1f6f05 ("EDAC/synopsys: Read the error count from the correct
register")
Signed-off-by: Serge Semin <redacted>

Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
quoted hunk ↗ jump to hunk
---
 drivers/edac/synopsys_edac.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
index da1d90a87778..558d3b3e6864 100644
--- a/drivers/edac/synopsys_edac.c
+++ b/drivers/edac/synopsys_edac.c
@@ -423,18 +423,18 @@ static int zynqmp_get_error_info(struct
synps_edac_priv *priv)
        base = priv->baseaddr;
        p = &priv->stat;

-       regval = readl(base + ECC_ERRCNT_OFST);
-       p->ce_cnt = regval & ECC_ERRCNT_CECNT_MASK;
-       p->ue_cnt = (regval & ECC_ERRCNT_UECNT_MASK) >>
ECC_ERRCNT_UECNT_SHIFT;
-       if (!p->ce_cnt)
-               goto ue_err;
-
        regval = readl(base + ECC_STAT_OFST);
        if (!regval)
                return 1;

        p->ceinfo.bitpos = (regval & ECC_STAT_BITNUM_MASK);

+       regval = readl(base + ECC_ERRCNT_OFST);
+       p->ce_cnt = regval & ECC_ERRCNT_CECNT_MASK;
+       p->ue_cnt = (regval & ECC_ERRCNT_UECNT_MASK) >>
ECC_ERRCNT_UECNT_SHIFT;
+       if (!p->ce_cnt)
+               goto ue_err;
+
        regval = readl(base + ECC_CEADDR0_OFST);
        p->ceinfo.row = (regval & ECC_CEADDR0_RW_MASK);
        regval = readl(base + ECC_CEADDR1_OFST);
--
2.37.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help