diff options
author | Dan Williams <dan.j.williams@intel.com> | 2018-07-05 14:58:49 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-07-05 19:33:53 -0700 |
commit | 33cc2c9667561b224215e6dfb5bf98e8fa17914e (patch) | |
tree | 64f01a6dcb817b41fc694dc2a31999650c91a3c1 /drivers/acpi/nfit/nfit.h | |
parent | 1273c253c32b9a073a4d8921ed079177ccc7c8af (diff) | |
download | linux-33cc2c9667561b224215e6dfb5bf98e8fa17914e.tar.bz2 |
acpi, nfit: Fix scrub idle detection
The notification of scrub completion happens within the scrub workqueue.
That can clearly race someone running scrub_show() and work_busy()
before the workqueue has a chance to flush the recently completed work.
Add a flag to reliably indicate the idle vs busy state. Without this
change applications using poll(2) to wait for scrub-completion may
falsely wakeup and read ARS as being busy even though the thread is
going idle and then hang indefinitely.
Fixes: bc6ba8085842 ("nfit, address-range-scrub: rework and simplify ARS...")
Cc: <stable@vger.kernel.org>
Reported-by: Vishal Verma <vishal.l.verma@intel.com>
Tested-by: Vishal Verma <vishal.l.verma@intel.com>
Reported-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi/nfit/nfit.h')
-rw-r--r-- | drivers/acpi/nfit/nfit.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h index 7d15856a739f..a97ff42fe311 100644 --- a/drivers/acpi/nfit/nfit.h +++ b/drivers/acpi/nfit/nfit.h @@ -203,6 +203,7 @@ struct acpi_nfit_desc { unsigned int max_ars; unsigned int scrub_count; unsigned int scrub_mode; + unsigned int scrub_busy:1; unsigned int cancel:1; unsigned long dimm_cmd_force_en; unsigned long bus_cmd_force_en; |