All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-03 22:39 ` Vishal Verma
  0 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2016-03-03 22:39 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Xiao Guangrong, linux-acpi

If firmware doesn't implement any of the ARS commands, take that to
mean that ARS is unsupported, and continue to initialize regions without
bad block lists. We cannot make the assumption that ARS commands will be
unconditionally supported on all NVDIMMs.

Cc: Dan Williams <dan.j.williams@intel.com>
Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---

v2:
- improve the debug message when we his this unimplemented case (Dan).

 drivers/acpi/nfit.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index fb53db1..35947ac 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1590,14 +1590,21 @@ static int acpi_nfit_find_poison(struct acpi_nfit_desc *acpi_desc,
 	start = ndr_desc->res->start;
 	len = ndr_desc->res->end - ndr_desc->res->start + 1;
 
+	/*
+	 * If ARS is unimplemented, unsupported, or if the 'Persistent Memory
+	 * Scrub' flag in extended status is not set, skip this but continue
+	 * initialization
+	 */
 	rc = ars_get_cap(nd_desc, ars_cap, start, len);
+	if (rc == -ENOTTY) {
+		dev_dbg(acpi_desc->dev,
+			"Address Range Scrub is not implemented, won't create an error list\n");
+		rc = 0;
+		goto out;
+	}
 	if (rc)
 		goto out;
 
-	/*
-	 * If ARS is unsupported, or if the 'Persistent Memory Scrub' flag in
-	 * extended status is not set, skip this but continue initialization
-	 */
 	if ((ars_cap->status & 0xffff) ||
 		!(ars_cap->status >> 16 & ND_ARS_PERSISTENT)) {
 		dev_warn(acpi_desc->dev,
-- 
2.5.0

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-03 22:39 ` Vishal Verma
  0 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2016-03-03 22:39 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Vishal Verma, linux-acpi, Dan Williams, Xiao Guangrong

If firmware doesn't implement any of the ARS commands, take that to
mean that ARS is unsupported, and continue to initialize regions without
bad block lists. We cannot make the assumption that ARS commands will be
unconditionally supported on all NVDIMMs.

Cc: Dan Williams <dan.j.williams@intel.com>
Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---

v2:
- improve the debug message when we his this unimplemented case (Dan).

 drivers/acpi/nfit.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index fb53db1..35947ac 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1590,14 +1590,21 @@ static int acpi_nfit_find_poison(struct acpi_nfit_desc *acpi_desc,
 	start = ndr_desc->res->start;
 	len = ndr_desc->res->end - ndr_desc->res->start + 1;
 
+	/*
+	 * If ARS is unimplemented, unsupported, or if the 'Persistent Memory
+	 * Scrub' flag in extended status is not set, skip this but continue
+	 * initialization
+	 */
 	rc = ars_get_cap(nd_desc, ars_cap, start, len);
+	if (rc == -ENOTTY) {
+		dev_dbg(acpi_desc->dev,
+			"Address Range Scrub is not implemented, won't create an error list\n");
+		rc = 0;
+		goto out;
+	}
 	if (rc)
 		goto out;
 
-	/*
-	 * If ARS is unsupported, or if the 'Persistent Memory Scrub' flag in
-	 * extended status is not set, skip this but continue initialization
-	 */
 	if ((ars_cap->status & 0xffff) ||
 		!(ars_cap->status >> 16 & ND_ARS_PERSISTENT)) {
 		dev_warn(acpi_desc->dev,
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
  2016-03-03 22:39 ` Vishal Verma
@ 2016-03-03 22:53   ` Dan Williams
  -1 siblings, 0 replies; 10+ messages in thread
From: Dan Williams @ 2016-03-03 22:53 UTC (permalink / raw)
  To: Vishal Verma; +Cc: Linux ACPI, Xiao Guangrong, linux-nvdimm

On Thu, Mar 3, 2016 at 2:39 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> If firmware doesn't implement any of the ARS commands, take that to
> mean that ARS is unsupported, and continue to initialize regions without
> bad block lists. We cannot make the assumption that ARS commands will be
> unconditionally supported on all NVDIMMs.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>
> v2:
> - improve the debug message when we his this unimplemented case (Dan).
>
>  drivers/acpi/nfit.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index fb53db1..35947ac 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -1590,14 +1590,21 @@ static int acpi_nfit_find_poison(struct acpi_nfit_desc *acpi_desc,
>         start = ndr_desc->res->start;
>         len = ndr_desc->res->end - ndr_desc->res->start + 1;
>
> +       /*
> +        * If ARS is unimplemented, unsupported, or if the 'Persistent Memory
> +        * Scrub' flag in extended status is not set, skip this but continue
> +        * initialization
> +        */
>         rc = ars_get_cap(nd_desc, ars_cap, start, len);
> +       if (rc == -ENOTTY) {
> +               dev_dbg(acpi_desc->dev,
> +                       "Address Range Scrub is not implemented, won't create an error list\n");
> +               rc = 0;
> +               goto out;
> +       }
>         if (rc)
>                 goto out;
>
> -       /*
> -        * If ARS is unsupported, or if the 'Persistent Memory Scrub' flag in
> -        * extended status is not set, skip this but continue initialization
> -        */
>         if ((ars_cap->status & 0xffff) ||
>                 !(ars_cap->status >> 16 & ND_ARS_PERSISTENT)) {
>                 dev_warn(acpi_desc->dev,
> --
> 2.5.0
>


Looks good to me.  Thanks Vishal!
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-03 22:53   ` Dan Williams
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Williams @ 2016-03-03 22:53 UTC (permalink / raw)
  To: Vishal Verma; +Cc: linux-nvdimm, Linux ACPI, Xiao Guangrong

On Thu, Mar 3, 2016 at 2:39 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> If firmware doesn't implement any of the ARS commands, take that to
> mean that ARS is unsupported, and continue to initialize regions without
> bad block lists. We cannot make the assumption that ARS commands will be
> unconditionally supported on all NVDIMMs.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>
> v2:
> - improve the debug message when we his this unimplemented case (Dan).
>
>  drivers/acpi/nfit.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index fb53db1..35947ac 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -1590,14 +1590,21 @@ static int acpi_nfit_find_poison(struct acpi_nfit_desc *acpi_desc,
>         start = ndr_desc->res->start;
>         len = ndr_desc->res->end - ndr_desc->res->start + 1;
>
> +       /*
> +        * If ARS is unimplemented, unsupported, or if the 'Persistent Memory
> +        * Scrub' flag in extended status is not set, skip this but continue
> +        * initialization
> +        */
>         rc = ars_get_cap(nd_desc, ars_cap, start, len);
> +       if (rc == -ENOTTY) {
> +               dev_dbg(acpi_desc->dev,
> +                       "Address Range Scrub is not implemented, won't create an error list\n");
> +               rc = 0;
> +               goto out;
> +       }
>         if (rc)
>                 goto out;
>
> -       /*
> -        * If ARS is unsupported, or if the 'Persistent Memory Scrub' flag in
> -        * extended status is not set, skip this but continue initialization
> -        */
>         if ((ars_cap->status & 0xffff) ||
>                 !(ars_cap->status >> 16 & ND_ARS_PERSISTENT)) {
>                 dev_warn(acpi_desc->dev,
> --
> 2.5.0
>


Looks good to me.  Thanks Vishal!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
  2016-03-03 22:39 ` Vishal Verma
@ 2016-03-04  3:28   ` Xiao Guangrong
  -1 siblings, 0 replies; 10+ messages in thread
From: Xiao Guangrong @ 2016-03-04  3:28 UTC (permalink / raw)
  To: Vishal Verma, linux-nvdimm; +Cc: linux-acpi


CCed: Haozhong.

On 03/04/2016 06:39 AM, Vishal Verma wrote:
> If firmware doesn't implement any of the ARS commands, take that to
> mean that ARS is unsupported, and continue to initialize regions without
> bad block lists. We cannot make the assumption that ARS commands will be
> unconditionally supported on all NVDIMMs.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>

Thank you for the fix, Vishal! it looks good to me.

However, It is haozhong's credit as he is the one reported the bug not
me. :)

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-04  3:28   ` Xiao Guangrong
  0 siblings, 0 replies; 10+ messages in thread
From: Xiao Guangrong @ 2016-03-04  3:28 UTC (permalink / raw)
  To: Vishal Verma, linux-nvdimm; +Cc: linux-acpi, Dan Williams, Zhang, Haozhong


CCed: Haozhong.

On 03/04/2016 06:39 AM, Vishal Verma wrote:
> If firmware doesn't implement any of the ARS commands, take that to
> mean that ARS is unsupported, and continue to initialize regions without
> bad block lists. We cannot make the assumption that ARS commands will be
> unconditionally supported on all NVDIMMs.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>

Thank you for the fix, Vishal! it looks good to me.

However, It is haozhong's credit as he is the one reported the bug not
me. :)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
  2016-03-04  3:28   ` Xiao Guangrong
@ 2016-03-04  3:34     ` Zhang, Haozhong
  -1 siblings, 0 replies; 10+ messages in thread
From: Zhang, Haozhong @ 2016-03-04  3:34 UTC (permalink / raw)
  To: Vishal Verma, Xiao Guangrong; +Cc: linux-acpi, linux-nvdimm

On 03/04/16 11:28, Xiao Guangrong wrote:
> 
> CCed: Haozhong.
> 
> On 03/04/2016 06:39 AM, Vishal Verma wrote:
> >If firmware doesn't implement any of the ARS commands, take that to
> >mean that ARS is unsupported, and continue to initialize regions without
> >bad block lists. We cannot make the assumption that ARS commands will be
> >unconditionally supported on all NVDIMMs.
> >
> >Cc: Dan Williams <dan.j.williams@intel.com>
> >Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> 
> Thank you for the fix, Vishal! it looks good to me.
> 
> However, It is haozhong's credit as he is the one reported the bug not
> me. :)
> 

Thanks! I have tested on QEMU which has not implemented ARS yet and
this patch does work.

Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-04  3:34     ` Zhang, Haozhong
  0 siblings, 0 replies; 10+ messages in thread
From: Zhang, Haozhong @ 2016-03-04  3:34 UTC (permalink / raw)
  To: Vishal Verma, Xiao Guangrong; +Cc: linux-nvdimm, linux-acpi, Dan Williams

On 03/04/16 11:28, Xiao Guangrong wrote:
> 
> CCed: Haozhong.
> 
> On 03/04/2016 06:39 AM, Vishal Verma wrote:
> >If firmware doesn't implement any of the ARS commands, take that to
> >mean that ARS is unsupported, and continue to initialize regions without
> >bad block lists. We cannot make the assumption that ARS commands will be
> >unconditionally supported on all NVDIMMs.
> >
> >Cc: Dan Williams <dan.j.williams@intel.com>
> >Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> 
> Thank you for the fix, Vishal! it looks good to me.
> 
> However, It is haozhong's credit as he is the one reported the bug not
> me. :)
> 

Thanks! I have tested on QEMU which has not implemented ARS yet and
this patch does work.

Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
  2016-03-04  3:34     ` Zhang, Haozhong
@ 2016-03-04  4:27       ` Vishal Verma
  -1 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2016-03-04  4:27 UTC (permalink / raw)
  To: Zhang, Haozhong, Vishal Verma, Xiao Guangrong; +Cc: linux-acpi, linux-nvdimm

On Fri, 2016-03-04 at 11:34 +0800, Zhang, Haozhong wrote:
> On 03/04/16 11:28, Xiao Guangrong wrote:
> > 
> > 
> > CCed: Haozhong.
> > 
> > On 03/04/2016 06:39 AM, Vishal Verma wrote:
> > > 
> > > If firmware doesn't implement any of the ARS commands, take that
> > > to
> > > mean that ARS is unsupported, and continue to initialize regions
> > > without
> > > bad block lists. We cannot make the assumption that ARS commands
> > > will be
> > > unconditionally supported on all NVDIMMs.
> > > 
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> > Thank you for the fix, Vishal! it looks good to me.
> > 
> > However, It is haozhong's credit as he is the one reported the bug
> > not
> > me. :)
> > 
> Thanks! I have tested on QEMU which has not implemented ARS yet and
> this patch does work.
> 
> Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>

Thanks, both Haozhong and Guangrong. Dan, can you please fixup the
Reported-by tag when you apply.

	-Vishal

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

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-04  4:27       ` Vishal Verma
  0 siblings, 0 replies; 10+ messages in thread
From: Vishal Verma @ 2016-03-04  4:27 UTC (permalink / raw)
  To: Zhang, Haozhong, Vishal Verma, Xiao Guangrong
  Cc: linux-acpi, linux-nvdimm, Williams, Dan J

On Fri, 2016-03-04 at 11:34 +0800, Zhang, Haozhong wrote:
> On 03/04/16 11:28, Xiao Guangrong wrote:
> > 
> > 
> > CCed: Haozhong.
> > 
> > On 03/04/2016 06:39 AM, Vishal Verma wrote:
> > > 
> > > If firmware doesn't implement any of the ARS commands, take that
> > > to
> > > mean that ARS is unsupported, and continue to initialize regions
> > > without
> > > bad block lists. We cannot make the assumption that ARS commands
> > > will be
> > > unconditionally supported on all NVDIMMs.
> > > 
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Reported-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> > Thank you for the fix, Vishal! it looks good to me.
> > 
> > However, It is haozhong's credit as he is the one reported the bug
> > not
> > me. :)
> > 
> Thanks! I have tested on QEMU which has not implemented ARS yet and
> this patch does work.
> 
> Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>

Thanks, both Haozhong and Guangrong. Dan, can you please fixup the
Reported-by tag when you apply.

	-Vishal

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

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-03-04  4:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-03 22:39 [PATCH v2] nfit: Continue init even if ARS commands are unimplemented Vishal Verma
2016-03-03 22:39 ` Vishal Verma
2016-03-03 22:53 ` Dan Williams
2016-03-03 22:53   ` Dan Williams
2016-03-04  3:28 ` Xiao Guangrong
2016-03-04  3:28   ` Xiao Guangrong
2016-03-04  3:34   ` Zhang, Haozhong
2016-03-04  3:34     ` Zhang, Haozhong
2016-03-04  4:27     ` Vishal Verma
2016-03-04  4:27       ` Vishal Verma

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.