diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-02-19 23:16:34 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-03-05 23:24:06 +0300 |
commit | 7ae0fa439faff000744b234d04cb470bfd83593b (patch) | |
tree | fbc0666a921014807cf2de0e9feb5d5faba08de9 /drivers/nvdimm | |
parent | a61fe6f7902ecaa89d5e6c709490fc4324927134 (diff) | |
download | linux-7ae0fa439faff000744b234d04cb470bfd83593b.tar.xz |
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.c | 9 |
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"); |