Re: [PATCH v2 4/7] ghes_edac: avoid multiple calls to dmi_walk()

Kani, Toshimitsu
2017-08-07T17:59:18Z

On Sat, 2017-08-05 at 07:16 +0200, Borislav Petkov wrote:
> On Fri, Aug 04, 2017 at 09:02:17PM +0000, Kani, Toshimitsu wrote:
> > GHES platform devices correspond to GHES entries, which define
> > firmware interfaces to report generic memory errors to the OS, such
> > as NMI and SCI.  These devices are associated with all DIMMs, not a
> > particular DIMM.
>
> And? Stating the obvious brings you what exactly?
>
> IOW, you still haven't answered my question.

Sorry about that. Let me copy your original comments to make sure I
answer your questions this time.

> So the problem is that ghes_edac_register() gets called multiple
> times depending on how many GHES platform devices are on the system.
> But yet they all scan *all* DIMMs.

Right, and this patch changes ghes_edac_register() to scan all DIMMs at
the first time and do not scan them next times.

> So instead you should return if
> the DIMMs have been counted already and not register a second time.
> Which makes that whole mc counting kinda useless. So you could rip
>
that out too.

Oh, I see. So, ghes_edac_register() should return no-op a second time,
and does not call edac_mc_add_mc() to register with a separate mci.

I think we should keep the current scheme, which registers an mci for
each GHES entry. ghes_edac_report_mem_error() expects that error-
reporting is serialized per a GHES entry. Sharing a single mci among
all GHES entries / error interfaces might lead to a race condition.

Thanks,
-Toshi