From: willy@linux.intel.com (Matthew Wilcox)
Subject: [PATCH RFC 2/5] NVMe: Basic NVMe device hotplug support
Date: Tue, 31 Dec 2013 08:35:40 -0500 [thread overview]
Message-ID: <20131231133540.GL4945@linux.intel.com> (raw)
In-Reply-To: <1388399240-13828-3-git-send-email-santoshsy@gmail.com>
On Mon, Dec 30, 2013@03:57:17PM +0530, Santosh Y wrote:
> + if ((status & 0xff) == NVME_SC_INVALID_NS) {
> + bio_endio(bio, -ENODEV);
> + } else if ((status & 0xff) == NVME_SC_NS_NOT_READY) {
> + bio->bi_rw |= REQ_FAILFAST_DRIVER;
> + nvme_requeue_bio(dev, bio);
> + } else
BTW, ANDing with 0xff is wrong. The NVME_SC_NS_NOT_READY test would also
catch NVME_SC_GUARD_CHECK (value 0x282). We should include:
NVME_SC_MASK = 0xbff
as part of the enum, or perhaps have a macro:
#define nvme_status_code(status) ((status) & 0xbff)
BTW, I'm going to update the status codes with the ones found in spec 1.1a:
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index f009c15..ca4a9fa 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -412,9 +412,15 @@ enum {
NVME_SC_FUSED_MISSING = 0xa,
NVME_SC_INVALID_NS = 0xb,
NVME_SC_CMD_SEQ_ERROR = 0xc,
+ NVME_SC_SGL_LAST_SEG = 0xd,
+ NVME_SC_SGL_COUNT = 0xe,
+ NVME_SC_SGL_DATA_LEN = 0xf,
+ NVME_SC_SGL_METADATA_LEN = 0x10,
+ NVME_SC_SGL_TYPE = 0x11,
NVME_SC_LBA_RANGE = 0x80,
NVME_SC_CAP_EXCEEDED = 0x81,
NVME_SC_NS_NOT_READY = 0x82,
+ NVME_SC_RESERVATION_CONFLICT = 0x83,
NVME_SC_CQ_INVALID = 0x100,
NVME_SC_QID_INVALID = 0x101,
NVME_SC_QUEUE_SIZE = 0x102,
@@ -426,7 +432,15 @@ enum {
NVME_SC_INVALID_VECTOR = 0x108,
NVME_SC_INVALID_LOG_PAGE = 0x109,
NVME_SC_INVALID_FORMAT = 0x10a,
+ NVME_SC_CONVENTIONAL_RESET = 0x10b,
+ NVME_SC_INVALID_QUEUE = 0x10c,
+ NVME_SC_FEAT_NOT_SAVABLE = 0x10d,
+ NVME_SC_FEAT_NOT_CHANGABLE = 0x10e,
+ NVME_SC_FEAT_NOT_NS = 0x10f,
+ NVME_SC_SUBSYSTEM_RESET = 0x110,
NVME_SC_BAD_ATTRIBUTES = 0x180,
+ NVME_SC_INVALID_PI = 0x181,
+ NVME_SC_RANGE_RO = 0x182,
NVME_SC_WRITE_FAULT = 0x280,
NVME_SC_READ_ERROR = 0x281,
NVME_SC_GUARD_CHECK = 0x282,
next prev parent reply other threads:[~2013-12-31 13:35 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-30 10:27 [PATCH RFC 0/5] NVMe: Hotplug support Santosh Y
2013-12-30 10:27 ` [PATCH RFC 1/5] NVMe: Code cleanup and minor checkpatch correction Santosh Y
2013-12-30 13:32 ` Matthew Wilcox
2013-12-30 14:52 ` Keith Busch
2013-12-30 10:27 ` [PATCH RFC 2/5] NVMe: Basic NVMe device hotplug support Santosh Y
2013-12-30 13:46 ` Matthew Wilcox
2013-12-30 13:48 ` Matias Bjorling
2013-12-30 14:09 ` Matias Bjorling
2013-12-30 16:06 ` Keith Busch
2013-12-30 17:21 ` Keith Busch
2013-12-31 8:48 ` Ravi Kumar
2013-12-31 13:35 ` Matthew Wilcox [this message]
2013-12-31 17:17 ` Matthew Wilcox
2013-12-30 10:27 ` [PATCH RFC 3/5] NVMe: Asynchronous device scan support Santosh Y
2013-12-30 13:50 ` Matthew Wilcox
2013-12-30 15:55 ` Keith Busch
2014-03-28 14:02 ` Santosh Y
2014-03-28 16:29 ` Keith Busch
2014-04-11 13:59 ` Matthew Wilcox
2014-04-13 17:42 ` Matthew Wilcox
2013-12-30 10:27 ` [PATCH RFC 4/5] NVMe: Stale node cleanup based on reference count Santosh Y
2013-12-30 14:00 ` Matthew Wilcox
2013-12-30 10:27 ` [PATCH RFC 5/5] NVMe: Hotplug support during hibernate/sleep states Santosh Y
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=20131231133540.GL4945@linux.intel.com \
--to=willy@linux.intel.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).