* [PATCH] nvme: report subsystem-reset not supported by controller.
@ 2018-05-29 20:42 David Milburn
2018-05-31 16:22 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: David Milburn @ 2018-05-29 20:42 UTC (permalink / 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] nvme: report subsystem-reset not supported by controller.
2018-05-29 20:42 [PATCH] nvme: report subsystem-reset not supported by controller David Milburn
@ 2018-05-31 16:22 ` Christoph Hellwig
2018-05-31 18:48 ` David Milburn
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2018-05-31 16:22 UTC (permalink / raw)
On Tue, May 29, 2018@03:42:34PM -0500, David Milburn wrote:
> 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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] nvme: report subsystem-reset not supported by controller.
2018-05-31 16:22 ` Christoph Hellwig
@ 2018-05-31 18:48 ` David Milburn
0 siblings, 0 replies; 3+ messages in thread
From: David Milburn @ 2018-05-31 18:48 UTC (permalink / raw)
Hi,
On 05/31/2018 11:22 AM, Christoph Hellwig wrote:
> On Tue, May 29, 2018@03:42:34PM -0500, David Milburn wrote:
>> 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
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-31 18:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-29 20:42 [PATCH] nvme: report subsystem-reset not supported by controller David Milburn
2018-05-31 16:22 ` Christoph Hellwig
2018-05-31 18:48 ` David Milburn
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).