All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: "Boylston, Brian" <brian.boylston@hpe.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH v2 2/4] libndctl: record dsm family in add_dimm()
Date: Thu, 15 Sep 2016 12:27:20 -0700	[thread overview]
Message-ID: <CAPcyv4h9wPiOUNA5eBMPSPiqUQrp_vnxf1Jjh1ag0HbNBqFW0w@mail.gmail.com> (raw)
In-Reply-To: <CS1PR84MB01193D526FA8BBE4269EDB698EF00@CS1PR84MB0119.NAMPRD84.PROD.OUTLOOK.COM>

On Thu, Sep 15, 2016 at 11:17 AM, Boylston, Brian
<brian.boylston@hpe.com> wrote:
> Dan Williams wrote on 2016-09-14:
>> On Tue, Sep 13, 2016 at 10:41 AM, Brian Boylston <brian.boylston@hpe.com> wrote:
>>> The recorded DSM family can be used to provide family-specific
>>> functionality.
>>>
>>> Cc: Dan Williams <dan.j.williams@intel.com>
>>> Signed-off-by: Brian Boylston <brian.boylston@hpe.com>
>>> ---
>>>  ndctl/lib/libndctl.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
>>> index 9a9dc74..c824d83 100644
>>> --- a/ndctl/lib/libndctl.c
>>> +++ b/ndctl/lib/libndctl.c
>>> @@ -136,6 +136,7 @@ struct ndctl_dimm {
>>>         unsigned short subsystem_revision_id;
>>>         unsigned short manufacturing_date;
>>>         unsigned char manufacturing_location;
>>> +       unsigned long dsm_family;
>>>         unsigned long dsm_mask;
>>>         char *unique_id;
>>>         char *dimm_path;
>>> @@ -1145,6 +1146,11 @@ static int add_dimm(void *parent, int id, const char *dimm_base)
>>>         if (sscanf(buf, "%d:%d", &dimm->major, &dimm->minor) != 2)
>>>                 goto err_read;
>>>
>>> +       sprintf(path, "%s/nfit/family", dimm_base);
>>> +       if (sysfs_read_attr(ctx, path, buf) < 0)
>>> +               goto err_read;
>>> +       dimm->dsm_family = strtoul(buf, NULL, 0);
>>
>>
>> Hmm I don't think it should it be fatal to add_dimm() for a failure to
>> have a family.  It's reasonable for a DIMM to exist in the NFIT, but
>> have no DSMs or a DSM implementation that is new to the kernel.  Can
>> we make this continue on and teach consumers of ->dsm_family that it
>> might be an error value?
>
> Sure.  Some of the other values collected in add_dimm() use -1 as an
> error or not available value; ok to use that for dsm_family?

Sounds good.

> Also, should I add a public accessor function such as
> ndctl_dimm_get_dsm_family()?  (although there wouldn't be a consumer yet)

I'm not opposed to it for informational purposes, but I like the
current direction where it doesn't really matter and the other ndctl
routines are taught how to multiplex for different families.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2016-09-15 19:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 17:41 [ndctl PATCH v2 0/4] ndctl: add support for HPE type N SMART health data Brian Boylston
2016-09-13 17:41 ` [ndctl PATCH v2 1/4] libndctl: introduce ndctl_smart_ops Brian Boylston
2016-09-15  2:22   ` Dan Williams
2016-09-13 17:41 ` [ndctl PATCH v2 2/4] libndctl: record dsm family in add_dimm() Brian Boylston
2016-09-15  0:44   ` Dan Williams
2016-09-15 18:17     ` Boylston, Brian
2016-09-15 19:27       ` Dan Williams [this message]
2016-09-13 17:41 ` [ndctl PATCH v2 3/4] libndctl: enable ND_CMD_CALL Brian Boylston
2016-09-13 17:41 ` [ndctl PATCH v2 4/4] libndctl: add support for the HPE1 family of DSM SMART functions Brian Boylston

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=CAPcyv4h9wPiOUNA5eBMPSPiqUQrp_vnxf1Jjh1ag0HbNBqFW0w@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=brian.boylston@hpe.com \
    --cc=linux-nvdimm@lists.01.org \
    /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.