diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-09-25 20:01:31 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-09-28 18:10:14 +0200 |
commit | d34cb808402898e53b9a9bcbbedd01667a78723b (patch) | |
tree | d4ea0dbd680af3ddf3b3ec5655916a76fa21f57b /drivers/nvdimm/dimm_devs.c | |
parent | Linux 4.14-rc2 (diff) | |
download | linux-d34cb808402898e53b9a9bcbbedd01667a78723b.tar.xz linux-d34cb808402898e53b9a9bcbbedd01667a78723b.zip |
libnvdimm, dimm: clear 'locked' status on successful DIMM enable
If we successfully enable a DIMM then it must not be locked and we can
clear the label-read failure condition. Otherwise, we need to reload the
entire bus provider driver to achieve the same effect, and that can
disrupt unrelated DIMMs and namespaces.
Fixes: 9d62ed965118 ("libnvdimm: handle locked label storage areas")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/dimm_devs.c')
-rw-r--r-- | drivers/nvdimm/dimm_devs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c index f0d1b7e5de01..5f1385b96b13 100644 --- a/drivers/nvdimm/dimm_devs.c +++ b/drivers/nvdimm/dimm_devs.c @@ -200,6 +200,13 @@ void nvdimm_set_locked(struct device *dev) set_bit(NDD_LOCKED, &nvdimm->flags); } +void nvdimm_clear_locked(struct device *dev) +{ + struct nvdimm *nvdimm = to_nvdimm(dev); + + clear_bit(NDD_LOCKED, &nvdimm->flags); +} + static void nvdimm_release(struct device *dev) { struct nvdimm *nvdimm = to_nvdimm(dev); |