[PATCH] EDAC/synopsys: Clear the ecc counters at init

Datta, Shubhrajyoti shubhrajyoti.datta at amd.com
Wed Jun 11 04:42:33 PDT 2025


[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Borislav Petkov <bp at alien8.de>
> Sent: Wednesday, June 4, 2025 3:08 PM
> To: Datta, Shubhrajyoti <shubhrajyoti.datta at amd.com>
> Cc: linux-arm-kernel at lists.infradead.org; linux-edac at vger.kernel.org; linux-
> kernel at vger.kernel.org; git (AMD-Xilinx) <git at amd.com>; Simek, Michal
> <michal.simek at amd.com>; Tony Luck <tony.luck at intel.com>; James Morse
> <james.morse at arm.com>; Mauro Carvalho Chehab <mchehab at kernel.org>;
> Robert Richter <rric at kernel.org>
> Subject: Re: [PATCH] EDAC/synopsys: Clear the ecc counters at init
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Wed, Jun 04, 2025 at 05:58:22AM +0000, Datta, Shubhrajyoti wrote:
> > zynqmp_get_ecc_state is getting called from probe/init.
> > I will update the commit message to reflect the same.
>
> No need.
>
> Next question: There's zynq_get_ecc_state() which is almost the same. Does
> that need clearing too?
Yes

>
> If so, the right thing to do is to unify both functions and get rid of the silly
> function pointers calling them but simply do ECC state reading once in
> mc_probe() and be done with it.
>
> The duplication here is very much unnecessary.

However the registers for Zynqmp and Zynq is different to differentiate
Should the usage of quirk be fine code snippet below

static bool get_ecc_state(struct synps_edac_priv *priv)
{
       enum dev_type dt;
       u32 ecctype, clearval;

       if (!priv->p_data->quirks) {
               check ecc and write to ECC_CTRL_OFST to clear the counters.
       } else {
              Zynqmp handling ..
               Checkecc and write to ECC_CLR_OFST clear the zynqmp ecc counters.
       }
}

And then call the get_ecc_state in probe.
>
> Thx.
>
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette


More information about the linux-arm-kernel mailing list