diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-04-14 08:48:46 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-04-17 22:34:17 +0300 |
commit | 9ccaed4bfd4f186e8350ffc7d8f188f8d2991fd9 (patch) | |
tree | e7c195ad3cf57ad677c766f1433835633a9a1d8f /drivers/acpi/nfit/core.c | |
parent | caa603aae0cc0b6f25fa4673de067f625faaf47f (diff) | |
download | linux-9ccaed4bfd4f186e8350ffc7d8f188f8d2991fd9.tar.xz |
acpi, nfit: limit ->flush_probe() to initialization work
The nvdimm probe flushing mechanism gives userspace a sync point where
it knows all asynchronous driver probe sequences have completed.
However, it need not wait for other asynchronous actions, like
on-demand address-range-scrub. Track the init work separately from other
work in the workqueue, and only flush the former.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi/nfit/core.c')
-rw-r--r-- | drivers/acpi/nfit/core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 1d54833ade3f..69c6cc77130c 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2581,6 +2581,7 @@ static void acpi_nfit_scrub(struct work_struct *work) acpi_nfit_register_region(acpi_desc, nfit_spa); } } + acpi_desc->init_complete = 1; list_for_each_entry(nfit_spa, &acpi_desc->spas, list) acpi_nfit_async_scrub(acpi_desc, nfit_spa); @@ -2784,6 +2785,12 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) device_lock(dev); device_unlock(dev); + /* bounce the init_mutex to make init_complete valid */ + mutex_lock(&acpi_desc->init_mutex); + mutex_unlock(&acpi_desc->init_mutex); + if (acpi_desc->init_complete) + return 0; + /* * Scrub work could take 10s of seconds, userspace may give up so we * need to be interruptible while waiting. |