Commit 9ccaed4b authored by Dan Williams's avatar Dan Williams

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: default avatarDan Williams <dan.j.williams@intel.com>
parent caa603aa
...@@ -2581,6 +2581,7 @@ static void acpi_nfit_scrub(struct work_struct *work) ...@@ -2581,6 +2581,7 @@ static void acpi_nfit_scrub(struct work_struct *work)
acpi_nfit_register_region(acpi_desc, nfit_spa); acpi_nfit_register_region(acpi_desc, nfit_spa);
} }
} }
acpi_desc->init_complete = 1;
list_for_each_entry(nfit_spa, &acpi_desc->spas, list) list_for_each_entry(nfit_spa, &acpi_desc->spas, list)
acpi_nfit_async_scrub(acpi_desc, nfit_spa); acpi_nfit_async_scrub(acpi_desc, nfit_spa);
...@@ -2784,6 +2785,12 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) ...@@ -2784,6 +2785,12 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc)
device_lock(dev); device_lock(dev);
device_unlock(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 * Scrub work could take 10s of seconds, userspace may give up so we
* need to be interruptible while waiting. * need to be interruptible while waiting.
......
...@@ -163,6 +163,7 @@ struct acpi_nfit_desc { ...@@ -163,6 +163,7 @@ struct acpi_nfit_desc {
unsigned int scrub_count; unsigned int scrub_count;
unsigned int scrub_mode; unsigned int scrub_mode;
unsigned int cancel:1; unsigned int cancel:1;
unsigned int init_complete:1;
unsigned long dimm_cmd_force_en; unsigned long dimm_cmd_force_en;
unsigned long bus_cmd_force_en; unsigned long bus_cmd_force_en;
int (*blk_do_io)(struct nd_blk_region *ndbr, resource_size_t dpa, int (*blk_do_io)(struct nd_blk_region *ndbr, resource_size_t dpa,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment