On Tue, Nov 7, 2017 at 5:18 PM, <Lijun.Pan(a)dell.com> wrote:
> -----Original Message-----
> From: Dan Williams [mailto:firstname.lastname@example.org]
> Sent: Monday, November 6, 2017 5:32 PM
> To: Pan, Lijun <Lijun_Pan(a)Dell.com>
> Cc: linux-nvdimm(a)lists.01.org
> 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.
Yes, however the DIMM itself is not "read only", that's a default
policy the kernel decides when it see the "not armed" status flag set.
If cockpit wants to show this state it can get it today from the DIMM
state flags emitted by 'ndctl list', see "flag_failed_arm".
# ndctl list -Dd nmem6