All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Santosh Sivaraj <santosh@fossix.org>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Linux NVDIMM <linux-nvdimm@lists.01.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Vaibhav Jain <vaibhav@linux.ibm.com>,
	Shivaprasad G Bhat <sbhat@linux.ibm.com>,
	Harish Sriram <harish@linux.ibm.com>
Subject: Re: [ndctl 3/5] papr: Add support to parse save_fail flag for dimm
Date: Thu, 25 Feb 2021 11:23:10 +0530	[thread overview]
Message-ID: <87pn0oelrt.fsf@santosiv.in.ibm.com> (raw)
In-Reply-To: <CAPcyv4jv-+gFP68RKD57+=QhT_SUWqXPJ4qFgmVZfVgNkVESCg@mail.gmail.com>

Dan Williams <dan.j.williams@intel.com> writes:

> On Mon, Dec 21, 2020 at 8:26 PM Santosh Sivaraj <santosh@fossix.org> wrote:
>>
>> This will help in getting the dimm fail tests to run on papr family too.
>> Also add nvdimm_test compatibility string for recognizing the test module.
>>
>> Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
>> ---
>>  ndctl/lib/libndctl.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
>> index 5f09628..3fb3aed 100644
>> --- a/ndctl/lib/libndctl.c
>> +++ b/ndctl/lib/libndctl.c
>> @@ -815,6 +815,8 @@ static void parse_papr_flags(struct ndctl_dimm *dimm, char *flags)
>>                         dimm->flags.f_restore = 1;
>>                 else if (strcmp(start, "smart_notify") == 0)
>>                         dimm->flags.f_smart = 1;
>> +               else if (strcmp(start, "save_fail") == 0)
>> +                       dimm->flags.f_save = 1;
>>                 start = end + 1;
>>         }
>>         if (end != start)
>> @@ -1044,7 +1046,8 @@ NDCTL_EXPORT int ndctl_bus_is_papr_scm(struct ndctl_bus *bus)
>>         if (sysfs_read_attr(bus->ctx, bus->bus_buf, buf) < 0)
>>                 return 0;
>>
>> -       return (strcmp(buf, "ibm,pmemory") == 0);
>> +       return (strcmp(buf, "ibm,pmemory") == 0 ||
>> +               strcmp(buf, "nvdimm_test") == 0);
>
> A bit unfortunate to leak test details into the production path,
> especially when nvdimm_test is meant to be generic. It seems what you
> really want is a generic way to determine if dimm supports the common
> error state flags, right? I'd add an api for that and say yes for nfit
> and papr.

Sorry to get to this late.

Though I would like it to be generic, there is some advantage of code reuse if
it's part of the PAPR_FAMILY.

So the idea in the above code is to determine which flag parsing code to call,
either parse_nfit_mem_flags or parse_papr_flags. Or I could write a new function
if the bus is of neither type. But that would again want me to duplicate error
inject related code, and may be other paths too.

Thanks,
Santosh
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply	other threads:[~2021-02-25  5:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22  4:22 [0/7] PMEM device emulation without nfit depenency Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 1/7] testing/nvdimm: Add test module for non-nfit platforms Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 2/7] ndtest: Add compatability string to treat it as PAPR family Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 3/7] ndtest: Add dimms to the two buses Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 4/7] ndtest: Add dimm attributes Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 5/7] ndtest: Add regions and mappings to the test buses Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 6/7] ndtest: Add nvdimm control functions Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 7/7] ndtest: Add papr health related flags Santosh Sivaraj
2020-12-22  4:25 ` [ndctl 1/5] libndctl: test enablement for non-nfit devices Santosh Sivaraj
2020-12-22  4:25   ` [ndctl 2/5] test: Don't skip tests if nfit modules are missing Santosh Sivaraj
2020-12-22  4:25   ` [ndctl 3/5] papr: Add support to parse save_fail flag for dimm Santosh Sivaraj
2021-01-28  1:16     ` Dan Williams
2021-02-25  5:53       ` Santosh Sivaraj [this message]
2020-12-22  4:25   ` [ndctl 4/5] test/libndctl: skip SMART tests on non-nfit devices Santosh Sivaraj
2020-12-22  4:25   ` [ndctl 5/5] Use page size as alignment value Santosh Sivaraj
2021-01-28  1:24     ` Dan Williams
2021-01-29  6:24       ` Santosh Sivaraj
2021-02-25  5:54       ` Santosh Sivaraj
2020-12-24 18:26 ` [0/7] PMEM device emulation without nfit depenency Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn0oelrt.fsf@santosiv.in.ibm.com \
    --to=santosh@fossix.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=harish@linux.ibm.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=sbhat@linux.ibm.com \
    --cc=vaibhav@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.