Re: [PATCH v13 15/18] EDAC: Add memory repair control feature

Jonathan Cameron
2024-10-14T17:02:24Z

On Mon, 14 Oct 2024 17:39:12 +0100
Shiju Jose <shiju.jose@huawei.com> wrote:

> >-----Original Message-----
> >From: Jonathan Cameron <jonathan.cameron@huawei.com>
> >Sent: 14 October 2024 17:23
> >To: Shiju Jose <shiju.jose@huawei.com>
> >Cc: linux-edac@vger.kernel.org; linux-cxl@vger.kernel.org; linux-
> >acpi@vger.kernel.org; linux-mm@kvack.org; linux-kernel@vger.kernel.org;
> >bp@alien8.de; tony.luck@intel.com; rafael@kernel.org; lenb@kernel.org;
> >mchehab@kernel.org; dan.j.williams@intel.com; dave@stgolabs.net;
> >dave.jiang@intel.com; alison.schofield@intel.com; vishal.l.verma@intel.com;
> >ira.weiny@intel.com; david@redhat.com; Vilas.Sridharan@amd.com;
> >leo.duran@amd.com; Yazen.Ghannam@amd.com; rientjes@google.com;
> >jiaqiyan@google.com; Jon.Grimm@amd.com; dave.hansen@linux.intel.com;
> >naoya.horiguchi@nec.com; james.morse@arm.com; jthoughton@google.com;
> >somasundaram.a@hpe.com; erdemaktas@google.com; pgonda@google.com;
> >duenwen@google.com; gthelen@google.com;
> >wschwartz@amperecomputing.com; dferguson@amperecomputing.com;
> >wbs@os.amperecomputing.com; nifan.cxl@gmail.com; tanxiaofei
> ><tanxiaofei@huawei.com>; Zengtao (B) <prime.zeng@hisilicon.com>; Roberto
> >Sassu <roberto.sassu@huawei.com>; kangkang.shen@futurewei.com;
> >wanghuiqiang <wanghuiqiang@huawei.com>; Linuxarm
> ><linuxarm@huawei.com>
> >Subject: Re: [PATCH v13 15/18] EDAC: Add memory repair control feature
> >
> >On Wed, 9 Oct 2024 13:41:16 +0100
> ><shiju.jose@huawei.com> wrote:
> >
> >> From: Shiju Jose <shiju.jose@huawei.com>
> >>
> >> Add generic EDAC memory repair control, eg. PPR(Post Package Repair),
> >> memory sparing etc, control driver in order to control memory repairs
> >> in the system. Supports sPPR(soft PPR), hPPR(hard PPR), soft/hard
> >> memory sparing, memory sparing at cacheline/row/bank/rank granularity etc.
> >> Device with memory repair features registers with EDAC device driver,
> >> which retrieves memory repair descriptor from EDAC memory repair
> >> driver and exposes the sysfs repair control attributes to userspace in
> >> /sys/bus/edac/devices/<dev-name>/mem_repairX/.
> >>
> >> The common memory repair control interface abstracts the control of an
> >> arbitrary memory repair functionality to a common set of functions.
> >> The sysfs memory repair attribute nodes would be present only if the
> >> client driver has implemented the corresponding attribute callback
> >> function and passed in ops to the EDAC device driver during registration.
> >>
> >> Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
> [...]
> >
> >> +
> >> +What: /sys/bus/edac/devices/<dev-name>/mem_repairX/hpa
> >> +Date: Oct 2024
> >> +KernelVersion: 6.12
> >> +Contact: linux-edac@vger.kernel.org
> >> +Description:
> >> + (WO) Set HPA (Host Physical Address) for memory repair.
> >
> >Can we not just read back what was written? Seems like userspace might expect
> >that?
> I am fine to add read back.
> I did not add read back for controls because there was no such requirement from the client driver and
> also tried to reduce the number of callbacks in the initial version.

I think we can for now at least just cache in the core code.
If we have future implementations where more validation is possible
then we can add optional callbacks at that stage.

Jonathan

>
> Thanks,
> Shiju