* [PATCH] acpi/nfit: queue issuing of ars when an uc error notification comes in
@ 2018-07-27 16:04 Dave Jiang
2018-07-27 18:41 ` Verma, Vishal L
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2018-07-27 16:04 UTC (permalink / raw)
To: vishal.l.verma; +Cc: linux-nvdimm
When the ACPI UC error notifier gets called and ARS_REQ bit is set
with the passed in flag, we can receive -EBUSY if ARS_REQ bit is already
set for the nfit_spa->ars_state. When that happens, the ARS request is
dropped. That can potentially cause us to miss the unreported errors that
the on going ARS request does not receive. Add an ARS_REQ_REDO state that
will request short ARS upon ARS completion to grab any errors we missed.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
drivers/acpi/nfit/core.c | 12 +++++++++---
drivers/acpi/nfit/nfit.h | 1 +
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 274f636cd3d2..def64259f9a7 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2567,7 +2567,12 @@ static void ars_complete(struct acpi_nfit_desc *acpi_desc,
test_bit(ARS_SHORT, &nfit_spa->ars_state)
? "short" : "long");
clear_bit(ARS_SHORT, &nfit_spa->ars_state);
- set_bit(ARS_DONE, &nfit_spa->ars_state);
+ if (test_and_clear_bit(ARS_REQ_REDO, &nfit_spa->ars_state)) {
+ set_bit(ARS_SHORT, &nfit_spa->ars_state);
+ set_bit(ARS_REQ, &nfit_spa->ars_state);
+ dev_dbg(dev, "ARS: processing scrub request received while in progress\n");
+ } else
+ set_bit(ARS_DONE, &nfit_spa->ars_state);
}
static int ars_status_process_records(struct acpi_nfit_desc *acpi_desc)
@@ -3264,9 +3269,10 @@ int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, unsigned long flags)
if (test_bit(ARS_FAILED, &nfit_spa->ars_state))
continue;
- if (test_and_set_bit(ARS_REQ, &nfit_spa->ars_state))
+ if (test_and_set_bit(ARS_REQ, &nfit_spa->ars_state)) {
busy++;
- else {
+ set_bit(ARS_REQ_REDO, &nfit_spa->ars_state);
+ } else {
if (test_bit(ARS_SHORT, &flags))
set_bit(ARS_SHORT, &nfit_spa->ars_state);
scheduled++;
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
index a97ff42fe311..d1274ea2d251 100644
--- a/drivers/acpi/nfit/nfit.h
+++ b/drivers/acpi/nfit/nfit.h
@@ -119,6 +119,7 @@ enum nfit_dimm_notifiers {
enum nfit_ars_state {
ARS_REQ,
+ ARS_REQ_REDO,
ARS_DONE,
ARS_SHORT,
ARS_FAILED,
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] acpi/nfit: queue issuing of ars when an uc error notification comes in
2018-07-27 16:04 [PATCH] acpi/nfit: queue issuing of ars when an uc error notification comes in Dave Jiang
@ 2018-07-27 18:41 ` Verma, Vishal L
0 siblings, 0 replies; 2+ messages in thread
From: Verma, Vishal L @ 2018-07-27 18:41 UTC (permalink / raw)
To: Jiang, Dave; +Cc: linux-nvdimm@lists.01.org
On Fri, 2018-07-27 at 09:04 -0700, Dave Jiang wrote:
> When the ACPI UC error notifier gets called and ARS_REQ bit is set
> with the passed in flag, we can receive -EBUSY if ARS_REQ bit is already
> set for the nfit_spa->ars_state. When that happens, the ARS request is
> dropped. That can potentially cause us to miss the unreported errors that
> the on going ARS request does not receive. Add an ARS_REQ_REDO state that
> will request short ARS upon ARS completion to grab any errors we missed.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/acpi/nfit/core.c | 12 +++++++++---
> drivers/acpi/nfit/nfit.h | 1 +
> 2 files changed, 10 insertions(+), 3 deletions(-)
Looks good to me, you can add:
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 274f636cd3d2..def64259f9a7 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -2567,7 +2567,12 @@ static void ars_complete(struct acpi_nfit_desc *acpi_desc,
> test_bit(ARS_SHORT, &nfit_spa->ars_state)
> ? "short" : "long");
> clear_bit(ARS_SHORT, &nfit_spa->ars_state);
> - set_bit(ARS_DONE, &nfit_spa->ars_state);
> + if (test_and_clear_bit(ARS_REQ_REDO, &nfit_spa->ars_state)) {
> + set_bit(ARS_SHORT, &nfit_spa->ars_state);
> + set_bit(ARS_REQ, &nfit_spa->ars_state);
> + dev_dbg(dev, "ARS: processing scrub request received while in progress\n");
> + } else
> + set_bit(ARS_DONE, &nfit_spa->ars_state);
> }
>
> static int ars_status_process_records(struct acpi_nfit_desc *acpi_desc)
> @@ -3264,9 +3269,10 @@ int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, unsigned long flags)
> if (test_bit(ARS_FAILED, &nfit_spa->ars_state))
> continue;
>
> - if (test_and_set_bit(ARS_REQ, &nfit_spa->ars_state))
> + if (test_and_set_bit(ARS_REQ, &nfit_spa->ars_state)) {
> busy++;
> - else {
> + set_bit(ARS_REQ_REDO, &nfit_spa->ars_state);
> + } else {
> if (test_bit(ARS_SHORT, &flags))
> set_bit(ARS_SHORT, &nfit_spa->ars_state);
> scheduled++;
> diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
> index a97ff42fe311..d1274ea2d251 100644
> --- a/drivers/acpi/nfit/nfit.h
> +++ b/drivers/acpi/nfit/nfit.h
> @@ -119,6 +119,7 @@ enum nfit_dimm_notifiers {
>
> enum nfit_ars_state {
> ARS_REQ,
> + ARS_REQ_REDO,
> ARS_DONE,
> ARS_SHORT,
> ARS_FAILED,
>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-27 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-27 16:04 [PATCH] acpi/nfit: queue issuing of ars when an uc error notification comes in Dave Jiang
2018-07-27 18:41 ` Verma, Vishal L
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox