Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vishal Verma <vishal@kernel.org>
To: Linda Knippers <linda.knippers@hpe.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	Vishal L Verma <vishal.l.verma@intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: acpi_nfit_query_poison() broken on non-ARS systems
Date: Fri, 29 Apr 2016 18:03:19 -0600	[thread overview]
Message-ID: <1461974599.11211.6.camel@kernel.org> (raw)
In-Reply-To: <5723EFEE.9060200@hpe.com>

On Fri, 2016-04-29 at 19:36 -0400, Linda Knippers wrote:

[snip]
> 
> > static int acpi_nfit_query_poison(struct acpi_nfit_desc *acpi_desc,
> >                 struct nfit_spa *nfit_spa)
> > {
> >         struct acpi_nfit_system_address *spa = nfit_spa->spa;
> >         int rc;
> > 
> >         if (!nfit_spa->max_ars) {
> On a platform that doesn't support ARS, max_ars will always be zero
> so you'll keep executing this code when it seems like you're trying
> to avoid that.
> 
> > 
> >                 struct nd_cmd_ars_cap ars_cap;
> > 
> >                 memset(&ars_cap, 0, sizeof(ars_cap));
> >                 rc = ars_get_cap(acpi_desc, &ars_cap, nfit_spa);
> >                 if (rc < 0)
> >                         return rc;
> The call succeeds so this return isn't taken, but then the code
> assumes
> everything is good.  It should check ars_cap.status so see if the
> function
> is supported or if there was an error and return something
> appropriate.
> In previous version of the code, that's what acpi_nfit_find_poison()
> did.
> Instead, this function continues, using data that's not right and
> making
> more calls that also aren't supported.

Good point - I think we should add a check here and make sure ARS is
supported using the status field. I can work on a patch. Thanks for the
report!

	-Vishal


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

  reply	other threads:[~2016-04-30  0:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 23:36 acpi_nfit_query_poison() broken on non-ARS systems Linda Knippers
2016-04-30  0:03 ` Vishal Verma [this message]
2016-04-30  0:04   ` Dan Williams
2016-04-30  0:15     ` Vishal Verma
2016-04-30  0:15       ` Dan Williams
2016-04-30  0:18         ` Vishal Verma
2016-05-01 17:27           ` Linda Knippers
2016-04-30  0:12 ` Dan Williams
2016-05-01 17:42   ` Linda Knippers
2016-05-01 19:44     ` Linda Knippers
2016-05-02  0:33       ` Dan Williams
2016-05-02 15:05         ` Linda Knippers

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=1461974599.11211.6.camel@kernel.org \
    --to=vishal@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=linda.knippers@hpe.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=vishal.l.verma@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox