From: dmilburn@redhat.com (David Milburn)
Subject: [PATCH] nvme: report subsystem-reset not supported by controller.
Date: Tue, 29 May 2018 15:42:34 -0500 [thread overview]
Message-ID: <1527626554-101086-1-git-send-email-dmilburn@redhat.com> (raw)
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(-)
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 17d2f7c..319fc39 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -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);
}
--
1.8.3.1
next reply other threads:[~2018-05-29 20:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 20:42 David Milburn [this message]
2018-05-31 16:22 ` [PATCH] nvme: report subsystem-reset not supported by controller Christoph Hellwig
2018-05-31 18:48 ` David Milburn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1527626554-101086-1-git-send-email-dmilburn@redhat.com \
--to=dmilburn@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).