From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42710 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753469AbdK0Qaj (ORCPT ); Mon, 27 Nov 2017 11:30:39 -0500 Subject: Patch "libnvdimm, dimm: clear 'locked' status on successful DIMM enable" has been added to the 4.14-stable tree To: dan.j.williams@intel.com, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 27 Nov 2017 17:30:30 +0100 Message-ID: <151180023065236@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled libnvdimm, dimm: clear 'locked' status on successful DIMM enable to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: libnvdimm-dimm-clear-locked-status-on-successful-dimm-enable.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From d34cb808402898e53b9a9bcbbedd01667a78723b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 25 Sep 2017 11:01:31 -0700 Subject: libnvdimm, dimm: clear 'locked' status on successful DIMM enable From: Dan Williams commit d34cb808402898e53b9a9bcbbedd01667a78723b upstream. 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") Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/nvdimm/dimm.c | 1 + drivers/nvdimm/dimm_devs.c | 7 +++++++ drivers/nvdimm/nd.h | 1 + 3 files changed, 9 insertions(+) --- a/drivers/nvdimm/dimm.c +++ b/drivers/nvdimm/dimm.c @@ -68,6 +68,7 @@ static int nvdimm_probe(struct device *d rc = nd_label_reserve_dpa(ndd); if (ndd->ns_current >= 0) nvdimm_set_aliasing(dev); + nvdimm_clear_locked(dev); nvdimm_bus_unlock(dev); if (rc) --- a/drivers/nvdimm/dimm_devs.c +++ b/drivers/nvdimm/dimm_devs.c @@ -200,6 +200,13 @@ void nvdimm_set_locked(struct device *de 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); --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -254,6 +254,7 @@ long nvdimm_clear_poison(struct device * unsigned int len); void nvdimm_set_aliasing(struct device *dev); void nvdimm_set_locked(struct device *dev); +void nvdimm_clear_locked(struct device *dev); struct nd_btt *to_nd_btt(struct device *dev); struct nd_gen_sb { Patches currently in stable-queue which might be from dan.j.williams@intel.com are queue-4.14/libnvdimm-dimm-clear-locked-status-on-successful-dimm-enable.patch queue-4.14/libnvdimm-pfn-make-resource-attribute-only-readable-by-root.patch queue-4.14/libnvdimm-region-make-resource-attribute-only-readable-by-root.patch queue-4.14/dax-fix-pmd-faults-on-zero-length-files.patch queue-4.14/libnvdimm-namespace-make-resource-attribute-only-readable-by-root.patch queue-4.14/dax-fix-general-protection-fault-in-dax_alloc_inode.patch queue-4.14/libnvdimm-namespace-fix-label-initialization-to-use-valid-seq-numbers.patch