aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-02-19 12:16:34 -0800
committerDan Williams <dan.j.williams@intel.com>2016-03-05 12:24:06 -0800
commit7ae0fa439faff000744b234d04cb470bfd83593b (patch)
treefbc0666a921014807cf2de0e9feb5d5faba08de9 /drivers/nvdimm
parentnfit, tools/testing/nvdimm: unify common init for acpi_nfit_desc (diff)
downloadlinux-dev-7ae0fa439faff000744b234d04cb470bfd83593b.tar.xz
linux-dev-7ae0fa439faff000744b234d04cb470bfd83593b.zip
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>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/core.c9
1 files changed, 9 insertions, 0 deletions
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");