All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-05  0:46 ` Dan Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2016-03-05  0:46 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, Haozhong Zhang, Xiao Guangrong, linux-kernel, Vishal Verma

From: Vishal Verma <vishal.l.verma@intel.com>

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.

Reported-by: Haozhong Zhang <haozhong.zhang@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Acked-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 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 fb53db187854..35947ac87644 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,

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

* [PATCH] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-05  0:46 ` Dan Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2016-03-05  0:46 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, Haozhong Zhang, Xiao Guangrong, linux-kernel, Vishal Verma

From: Vishal Verma <vishal.l.verma@intel.com>

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.

Reported-by: Haozhong Zhang <haozhong.zhang@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Acked-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 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 fb53db187854..35947ac87644 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,

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] nfit: Continue init even if ARS commands are unimplemented
  2016-03-05  0:46 ` Dan Williams
@ 2016-03-05  0:48   ` Dan Williams
  -1 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2016-03-05  0:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linux MM, Haozhong Zhang, Xiao Guangrong, linux-kernel, Vishal Verma

Andrew, sorry, ignore this, I fumble fingered a ^R in bash and sent
this.  I'm going to include this in a pull request to Linus.

On Fri, Mar 4, 2016 at 4:46 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> From: Vishal Verma <vishal.l.verma@intel.com>
>
> 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.
>
> Reported-by: Haozhong Zhang <haozhong.zhang@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> Acked-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  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 fb53db187854..35947ac87644 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,
>

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

* Re: [PATCH] nfit: Continue init even if ARS commands are unimplemented
@ 2016-03-05  0:48   ` Dan Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2016-03-05  0:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linux MM, Haozhong Zhang, Xiao Guangrong, linux-kernel, Vishal Verma

Andrew, sorry, ignore this, I fumble fingered a ^R in bash and sent
this.  I'm going to include this in a pull request to Linus.

On Fri, Mar 4, 2016 at 4:46 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> From: Vishal Verma <vishal.l.verma@intel.com>
>
> 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.
>
> Reported-by: Haozhong Zhang <haozhong.zhang@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> Acked-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
> Tested-by: Haozhong Zhang <haozhong.zhang@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  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 fb53db187854..35947ac87644 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,
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2016-03-05  0:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-05  0:46 [PATCH] nfit: Continue init even if ARS commands are unimplemented Dan Williams
2016-03-05  0:46 ` Dan Williams
2016-03-05  0:48 ` Dan Williams
2016-03-05  0:48   ` Dan Williams

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.