nfit, libnvdimm: async region scrub workqueue
Introduce a workqueue that will be used to run address range scrub asynchronously with the rest of nvdimm device probing. Userspace still wants notification when probing operations complete, so introduce a new callback to flush this workqueue when userspace is awaiting probe completion. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
@@ -298,6 +298,15 @@ static int flush_regions_dimms(struct device *dev, void *data)
|
||||
static ssize_t wait_probe_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct nvdimm_bus *nvdimm_bus = to_nvdimm_bus(dev);
|
||||
struct nvdimm_bus_descriptor *nd_desc = nvdimm_bus->nd_desc;
|
||||
int rc;
|
||||
|
||||
if (nd_desc->flush_probe) {
|
||||
rc = nd_desc->flush_probe(nd_desc);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
nd_synchronize();
|
||||
device_for_each_child(dev, NULL, flush_regions_dimms);
|
||||
return sprintf(buf, "1\n");
|
||||
|
Reference in New Issue
Block a user