Skip to contentSkip to conversation

nvme: report subsystem-reset not supported by controller.

PATCH New David Milburn 2 participants 3 messages May 29, 2018 – May 31, 2018 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: report subsystem-reset not supported by controller.

Add a little more description for "nvme subsystem-reset" failures, currently driver reports "Inappropriate ioctl for device".

$ nvme subsystem-reset /dev/nvme0
Subsystem-reset: Inappropriate ioctl for device

With this change report not permitted on controller's that do not support NVM Subsystem Reset.

$ nvme subsystem-reset /dev/nvme0
Subsystem-reset: Operation not permitted

<dmesg>

[   88.261923] nvme nvme0: NVM Subsystem Reset not supported.
---
 drivers/nvme/host/nvme.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nvme/host/nvme.h +4 -2
index 17d2f7c..319fc39 100644
@@ -343,8 +343,10 @@ static inline bool nvme_ctrl_ready(struct nvme_ctrl *ctrl)
 
 static inline int nvme_reset_subsystem(struct nvme_ctrl *ctrl)
 {
-	if (!ctrl->subsystem)
-		return -ENOTTY;
+	if (!ctrl->subsystem) {
+		dev_err(ctrl->device, "NVM Subsystem Reset not supported.\n");
+		return -EPERM;
+	}
 	return ctrl->ops->reg_write32(ctrl, NVME_REG_NSSR, 0x4E564D65);
 }
 
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 nvme: report subsystem-reset not supported by controller.

Quoted 3 lines · David Milburn

Add a little more description for "nvme subsystem-reset" failures, currently driver reports "Inappropriate ioctl for device".

A warning sounds nice, but why can't we add it in nvme-cli?

#2 lore raw

PATCH 1/1 nvme: report subsystem-reset not supported by controller.

Hi,

Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · David Milburn

Add a little more description for "nvme subsystem-reset" failures, currently driver reports "Inappropriate ioctl for device".

A warning sounds nice, but why can't we add it in nvme-cli?

Ok, will do.

Thanks,
David

Quoted 6 lines

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme