From 7ae0fa439faff000744b234d04cb470bfd83593b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 19 Feb 2016 12:16:34 -0800 Subject: 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 --- drivers/nvdimm/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/nvdimm') diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c index f309e6bf6833..79646d0c3277 100644 --- a/drivers/nvdimm/core.c +++ b/drivers/nvdimm/core.c @@ -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"); -- cgit v1.2.3-59-g8ed1b