From: jeff.lien@wdc.com (jeffreyalien)
Subject: [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200
Date: Fri, 10 Nov 2017 15:12:03 -0600 [thread overview]
Message-ID: <20171110211203.4782-1-jeff.lien@wdc.com> (raw)
Signed-off-by: jeffreyalien <jeff.lien at wdc.com>
---
drivers/nvme/host/core.c | 2 ++
drivers/nvme/host/nvme.h | 7 +++++++
drivers/nvme/host/pci.c | 2 ++
3 files changed, 11 insertions(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 37f9039bb9ca..f5bdf9c970e1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1435,6 +1435,8 @@ int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap)
if (ctrl->quirks & NVME_QUIRK_DELAY_BEFORE_CHK_RDY)
msleep(NVME_QUIRK_DELAY_AMOUNT);
+ if (ctrl->quirks & NVME_QUIRK_DELAY_BEFORE_CHK_RDY_2)
+ msleep(NVME_QUIRK_DELAY_AMOUNT_2);
return nvme_wait_ready(ctrl, cap, false);
}
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index d3f3c4447515..3102124cb2a4 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -80,6 +80,12 @@ enum nvme_quirks {
* Supports the LighNVM command set if indicated in vs[1].
*/
NVME_QUIRK_LIGHTNVM = (1 << 6),
+ /*
+ * The controller needs a delay before starts checking the device
+ * readiness, which is done by reading the NVME_CSTS_RDY bit.
+ */
+ NVME_QUIRK_DELAY_BEFORE_CHK_RDY_2 = (1 << 7),
+
};
/*
@@ -109,6 +115,7 @@ static inline struct nvme_request *nvme_req(struct request *req)
* found empirically.
*/
#define NVME_QUIRK_DELAY_AMOUNT 2000
+#define NVME_QUIRK_DELAY_AMOUNT_2 2300
enum nvme_ctrl_state {
NVME_CTRL_NEW,
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 3f5a04c586ce..826817f4c95e 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2519,6 +2519,8 @@ static const struct pci_device_id nvme_id_table[] = {
.driver_data = NVME_QUIRK_IDENTIFY_CNS, },
{ PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */
.driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
+ { PCI_DEVICE(0x1c58, 0x0023), /* WDC SN200 adapter */
+ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY_2, },
{ PCI_DEVICE(0x1c5f, 0x0540), /* Memblaze Pblaze4 adapter */
.driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
{ PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */
--
2.14.2.746.g8fb8a94
next reply other threads:[~2017-11-10 21:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 21:12 jeffreyalien [this message]
2017-11-10 21:35 ` [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200 Keith Busch
-- strict thread matches above, loose matches on Subject: below --
2017-11-10 22:04 jeffreyalien
2017-11-20 7:31 ` Christoph Hellwig
2017-11-21 16:44 Jeff Lien
2017-11-23 8:11 ` Christoph Hellwig
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=20171110211203.4782-1-jeff.lien@wdc.com \
--to=jeff.lien@wdc.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