diff mbox series

[3/5] libnvdimm: remove driver attached check for secure erase

Message ID 153936864380.55836.1354884792663339045.stgit@djiang5-desk3.ch.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/5] libnvdimm: fix updating of kernel key during nvdimm key update | expand

Commit Message

Dave Jiang Oct. 12, 2018, 6:24 p.m. UTC
We should be able to do secure erase when dimm is idle but not disabled.
Remove check for driver attachment.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/nvdimm/security.c |    6 ------
 1 file changed, 6 deletions(-)

Comments

Dan Williams Oct. 12, 2018, 7:23 p.m. UTC | #1
On Fri, Oct 12, 2018 at 11:24 AM Dave Jiang <dave.jiang@intel.com> wrote:
>
> We should be able to do secure erase when dimm is idle but not disabled.
> Remove check for driver attachment.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

Yup, looks good.

Since there's no dependency on the other patches in this series I'll
just go ahead and apply this.
diff mbox series

Patch

diff --git a/drivers/nvdimm/security.c b/drivers/nvdimm/security.c
index cf934c6025d9..f9ca1575012e 100644
--- a/drivers/nvdimm/security.c
+++ b/drivers/nvdimm/security.c
@@ -148,12 +148,6 @@  int nvdimm_security_erase(struct nvdimm *nvdimm, unsigned int keyid)
 		goto out;
 	}
 
-	if (dev_get_drvdata(dev)) {
-		dev_warn(dev, "Unable to secure erase while DIMM enabled.\n");
-		rc = -EBUSY;
-		goto out;
-	}
-
 	if (nvdimm->state == NVDIMM_SECURITY_UNSUPPORTED) {
 		dev_warn(dev, "Attempt to secure erase in wrong state.\n");
 		rc = -EOPNOTSUPP;