Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH V2] nvme: Add support for ACRE Command Interrupted status
@ 2019-11-27 19:12 Meneghini, John
  2019-12-03 17:38 ` Meneghini, John
  0 siblings, 1 reply; 7+ messages in thread
From: Meneghini, John @ 2019-11-27 19:12 UTC (permalink / raw)
  To: Christoph Hellwig, Sagi Grimberg, linux-nvme, Jen Axboe,
	linux-block, Knight, Frederick, Keith Busch
  Cc: Meneghini, John

I’ve rebased this patch onto nvme-5.5 and removed the NVME_SC_CMD_INTERRUPTED definition.

johnm@johnm-mac-1:nvme(fix_acre) > git logl -2 
* b77e5bbd8847 2019-11-27  (HEAD -> fix_acre) nvme: Add support for ACRE Command Interrupted status [ John Meneghini / johnm@netapp.com ]
* 6c6aa2f26c68 2019-11-22  (origin/nvme-5.5, nvme-5.5) nvme: hwmon: add quirk to avoid changing temperature threshold [ Keith Busch / akinobu.mita@gmail.com ]

And I've replaced BLK_STS_RESOURCE with BLK_STS_DEV_RESOURCE.  This should make it clear to the block layer that this is not a kernel resource problem,
but a device resource problem.  But the block layer should only see this error when the controller runs out of request retries.

johnm@johnm-mac-1:nvme(fix_acre) > cat 0001-nvme-Add-support-for-ACRE-Command-Interrupted-status.patch
From 8cff18fe2f52477bfa693ee89d374e689a47a79f Mon Sep 17 00:00:00 2001
From: John Meneghini <johnm@netapp.com>
Date: Wed, 27 Nov 2019 13:27:35 -0500
Subject: [PATCH] nvme: Add support for ACRE Command Interrupted status

 - Fixes bug in nvme_complete_rq logic introduced by
   Enhanced Command Retry code. According to TP-4033
   when ACRE is enabled the host needs to support
   the Command Interrupted status.
 - The current code interprets Command Interrupted status
   as a BLK_STS_IOERR. This results in a controller reset
   when REQ_NVME_MPATH is set; in nvme_failover_req.

Fixes: 49cd84b6f8b677e ("nvme: implement Enhanced Command Retry")
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 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 9696404a6182..24dc9ed1a11b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -230,6 +230,8 @@ static blk_status_t nvme_error_status(u16 status)
                return BLK_STS_NEXUS;
        case NVME_SC_HOST_PATH_ERROR:
                return BLK_STS_TRANSPORT;
+       case NVME_SC_CMD_INTERRUPTED:
+               return BLK_STS_DEV_RESOURCE;
        default:
                return BLK_STS_IOERR;
        }
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index d688b96d1d63..6efee8f1b91b 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_DEV_RESOURCE:
                return false;
        }
 
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 19:12 [PATCH V2] nvme: Add support for ACRE Command Interrupted status Meneghini, John
2019-12-03 17:38 ` Meneghini, John
2019-12-03 21:00   ` Keith Busch
2019-12-04 13:26     ` Hannes Reinecke
2019-12-04 14:48       ` Meneghini, John
2019-12-04 16:07       ` Keith Busch
2019-12-04 18:33         ` Meneghini, John

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git