Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+8
+7
drivers/acpi/nfit/core.c
··· 2581 2581 acpi_nfit_register_region(acpi_desc, nfit_spa); 2582 2582 } 2583 2583 } 2584 + acpi_desc->init_complete = 1; 2584 2585 2585 2586 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) 2586 2587 acpi_nfit_async_scrub(acpi_desc, nfit_spa); ··· 2784 2783 /* bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */ 2785 2784 device_lock(dev); 2786 2785 device_unlock(dev); 2786 + 2787 + /* bounce the init_mutex to make init_complete valid */ 2788 + mutex_lock(&acpi_desc->init_mutex); 2789 + mutex_unlock(&acpi_desc->init_mutex); 2790 + if (acpi_desc->init_complete) 2791 + return 0; 2787 2792 2788 2793 /* 2789 2794 * Scrub work could take 10s of seconds, userspace may give up so we
+1
drivers/acpi/nfit/nfit.h
··· 163 163 unsigned int scrub_count; 164 164 unsigned int scrub_mode; 165 165 unsigned int cancel:1; 166 + unsigned int init_complete:1; 166 167 unsigned long dimm_cmd_force_en; 167 168 unsigned long bus_cmd_force_en; 168 169 int (*blk_do_io)(struct nd_blk_region *ndbr, resource_size_t dpa,