All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>
Cc: "Pathak, Ami G" <ami.g.pathak@intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH v2 2/4] ndctl, inject-smart: switch to ndctl_cmd_submit_xlat
Date: Sat, 12 Jan 2019 02:03:37 +0000	[thread overview]
Message-ID: <a220a83ded81b6530234fb4ae6aec4e227c208d4.camel@intel.com> (raw)
In-Reply-To: <CAPcyv4hTw1Q8kK2py1sySEYMBpGTYSfmHLzAHJ41c3p08BQDmw@mail.gmail.com>


On Fri, 2019-01-11 at 17:58 -0800, Dan Williams wrote:
> On Fri, Jan 11, 2019 at 5:31 PM Vishal Verma <
> vishal.l.verma@intel.com> wrote:
> > 
> > The ndctl inject-smart command was neglecting to check the
> > 'firmware_status' field that is set by the platform firmware to
> > indicate
> > failure. Use the new ndctl_cmd_submit_xlat facility to include the
> > firmware_status check as part of the command submission.
> > 
> > Reported-by: Ami Pathak <ami.g.pathak@intel.com>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> 
> [..]
> > diff --git a/ndctl/util/json-smart.c b/ndctl/util/json-smart.c
> > index 3c1b917..92a9313 100644
> > --- a/ndctl/util/json-smart.c
> > +++ b/ndctl/util/json-smart.c
> > @@ -30,8 +30,8 @@ static void smart_threshold_to_json(struct
> > ndctl_dimm *dimm,
> >         if (!cmd)
> >                 return;
> > 
> > -       rc = ndctl_cmd_submit(cmd);
> > -       if (rc || ndctl_cmd_get_firmware_status(cmd))
> > +       rc = ndctl_cmd_submit_xlat(cmd);
> > +       if ((rc < 0) || ndctl_cmd_get_firmware_status(cmd))
> >                 goto out;
> 
> Can't we just do:
> 
> rc = ndctl_cmd_submit_xlat(cmd);
> if (rc < 0)
>     goto out;
> 
> ...and drop the open coded ndctl_cmd_get_firmware_status()?
> 
> In general it seems like most users of
> ndctl_cmd_get_firmware_status()
> would be happy with ndctl_cmd_submit_xlat() instead.

Yes good catch - I'll see where else we can make this change and
respin. The users of ndctl_cmd_get_firmware_status that use ACPI DSMs
probably still stay since _xlat, at least for now, only handles
commands that are defined in dimm_ops.

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2019-01-12  2:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-12  1:30 [ndctl PATCH v2 0/4] Add missing firmware_status checks Vishal Verma
2019-01-12  1:30 ` [ndctl PATCH v2 1/4] libndctl, intel: Add infrastructure for firmware_status translation Vishal Verma
2019-01-12  1:53   ` Dan Williams
2019-01-12  1:30 ` [ndctl PATCH v2 2/4] ndctl, inject-smart: switch to ndctl_cmd_submit_xlat Vishal Verma
2019-01-12  1:58   ` Dan Williams
2019-01-12  2:03     ` Verma, Vishal L [this message]
2019-01-12  2:05       ` Dan Williams
2019-01-12  1:30 ` [ndctl PATCH v2 3/4] ndctl, monitor: " Vishal Verma
2019-01-12  1:54   ` Dan Williams
2019-01-12  1:30 ` [ndctl PATCH v2 4/4] ndctl: clean up usage of ndctl_cmd_submit Vishal Verma
2019-01-12  1:53   ` 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=a220a83ded81b6530234fb4ae6aec4e227c208d4.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=ami.g.pathak@intel.com \
    --cc=dan.j.williams@intel.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.