linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <keith.busch@intel.com>,
	Hannes Reinecke <hare@suse.de>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, John Meneghini <johnm@netapp.com>
Subject: [PATCH] nvme: Add support for ACRE Command Interrupted status
Date: Tue, 26 Nov 2019 14:36:50 +0100	[thread overview]
Message-ID: <20191126133650.72196-1-hare@suse.de> (raw)

From: John Meneghini <johnm@netapp.com>

This patch fixes a bug in nvme_complete_rq logic introduced by
Enhanced Command Retry code. According to TP-4033 the controller
only sets CDR when the Command Interrupted status is returned.
The current code interprets Command Interrupted status as a
BLK_STS_IOERR, which results in a controller reset if
REQ_NVME_MPATH is set.

Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/nvme/host/core.c  | 2 ++
 include/linux/blk_types.h | 1 +
 include/linux/nvme.h      | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 108f60b46804..752a40daf2b3 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -201,6 +201,8 @@ static blk_status_t nvme_error_status(u16 status)
 	switch (status & 0x7ff) {
 	case NVME_SC_SUCCESS:
 		return BLK_STS_OK;
+	case NVME_SC_COMMAND_INTERRUPTED:
+		return BLK_STS_RESOURCE;
 	case NVME_SC_CAP_EXCEEDED:
 		return BLK_STS_NOSPC;
 	case NVME_SC_LBA_RANGE:
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index d688b96d1d63..3a0d84528325 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -84,6 +84,7 @@ static inline bool blk_path_error(blk_status_t error)
 	case BLK_STS_NEXUS:
 	case BLK_STS_MEDIUM:
 	case BLK_STS_PROTECTION:
+	case BLK_STS_RESOURCE:
 		return false;
 	}
 
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index f61d6906e59d..6b21f3888cad 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -1292,6 +1292,8 @@ enum {
 
 	NVME_SC_NS_WRITE_PROTECTED	= 0x20,
 
+	NVME_SC_COMMAND_INTERRUPTED	= 0x21,
+
 	NVME_SC_LBA_RANGE		= 0x80,
 	NVME_SC_CAP_EXCEEDED		= 0x81,
 	NVME_SC_NS_NOT_READY		= 0x82,
-- 
2.16.4


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

             reply	other threads:[~2019-11-26 13:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 13:36 Hannes Reinecke [this message]
2019-11-26 14:48 ` [PATCH] nvme: Add support for ACRE Command Interrupted status George, Martin
2019-11-26 16:05 ` Keith Busch
2019-11-26 16:24   ` Christoph Hellwig
2019-11-27 15:29     ` Meneghini, John
2019-11-27 19:08       ` Keith Busch
2019-11-27 19:22         ` Meneghini, John
2019-11-26 16:32   ` Hannes Reinecke
2019-11-27 17:17     ` Meneghini, John

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=20191126133650.72196-1-hare@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=johnm@netapp.com \
    --cc=keith.busch@intel.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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).