From: Dan Williams [mailto:email@example.com]
Sent: Monday, November 6, 2017 5:32 PM
To: Pan, Lijun <Lijun_Pan(a)Dell.com>
Subject: Re: [PATCH] acpi/nfit: export read_only attribute of dimms
On Mon, Oct 30, 2017 at 1:41 PM, Lijun Pan <Lijun.Pan(a)dell.com> wrote:
> Though flags attribute provides enough information about
> the dimm, it is nice to export the read_only attribute if
> bit3 of NVDIMM state flag is set.
> If error is injected by BIOS, bit3 and bit1 are both set.
> If DIMM is set to read-only by BIOS, bit3 is set.
> Hence bit3 is good enough to tell whether the dimm is in
> read-only mode or not.
Hmm, can you say about more about why we need this additional attribute?
Applications don't read and write the DIMM directly, they only
interface with the DIMM through namespaces of a given region. The
region device already has a 'read_only' attribute. See
read_only_show() in drivers/nvdimm/region_devs.c.
redhat's cockpit can show the server's info like dimm, cpu, network,etc.
If the read_only attribute is exported, it is easy for the program to check.
I agree read_only status of the specific dimm can be retrieved via checking
bit3 of nvdimm state flag, but it is not explicit.
If 2 nvdimms are interleaved together, region's read_only only shows that
the region is read only, it does not show the 2 underlying physical dimms comprising
the region are read only.