All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200
@ 2017-11-10 21:12 jeffreyalien
  2017-11-10 21:35 ` Keith Busch
  0 siblings, 1 reply; 6+ messages in thread
From: jeffreyalien @ 2017-11-10 21:12 UTC (permalink / 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

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

* [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200
  2017-11-10 21:12 [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200 jeffreyalien
@ 2017-11-10 21:35 ` Keith Busch
  0 siblings, 0 replies; 6+ messages in thread
From: Keith Busch @ 2017-11-10 21:35 UTC (permalink / raw)


On Fri, Nov 10, 2017@03:12:03PM -0600, jeffreyalien wrote:
>  #define NVME_QUIRK_DELAY_AMOUNT		2000
> +#define NVME_QUIRK_DELAY_AMOUNT_2	2300

These two delay times are close enough, let's just make it the higher of
the two so we only have one delay quirk.

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

* [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200
  2017-11-21 16:44 Jeff Lien
@ 2017-11-23  8:11 ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2017-11-23  8:11 UTC (permalink / raw)


Thanks Jeff,

applied for nvme-4.15 with a stable tag added.

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

* [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200
@ 2017-11-21 16:44 Jeff Lien
  2017-11-23  8:11 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Lien @ 2017-11-21 16:44 UTC (permalink / raw)


Signed-off-by: Jeff Lien <jeff.lien at wdc.com>
---
 drivers/nvme/host/nvme.h | 2 +-
 drivers/nvme/host/pci.c  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index c0873a68872f..ea1aa5283e8e 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -114,7 +114,7 @@ static inline struct nvme_request *nvme_req(struct request *req)
  * NVME_QUIRK_DELAY_BEFORE_CHK_RDY quirk enabled. The value (in ms) was
  * found empirically.
  */
-#define NVME_QUIRK_DELAY_AMOUNT		2000
+#define NVME_QUIRK_DELAY_AMOUNT		2300
 
 enum nvme_ctrl_state {
 	NVME_CTRL_NEW,
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index a11cfd470089..9567b1c8bb1a 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2665,6 +2665,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, },
 	{ 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

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

* [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200
  2017-11-10 22:04 jeffreyalien
@ 2017-11-20  7:31 ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2017-11-20  7:31 UTC (permalink / raw)


I'm a bit grumpy that this still shows up for a new design after
the issue is known..

On Fri, Nov 10, 2017@04:04:59PM -0600, jeffreyalien wrote:
> Signed-off-by: jeffreyalien <jeff.lien at wdc.com>

Jeff, can you provide your properly formatted name so that we can
apply this?

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

* [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200
@ 2017-11-10 22:04 jeffreyalien
  2017-11-20  7:31 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: jeffreyalien @ 2017-11-10 22:04 UTC (permalink / raw)


Signed-off-by: jeffreyalien <jeff.lien at wdc.com>
---
 drivers/nvme/host/nvme.h | 2 +-
 drivers/nvme/host/pci.c  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index d3f3c4447515..044af553204c 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -108,7 +108,7 @@ static inline struct nvme_request *nvme_req(struct request *req)
  * NVME_QUIRK_DELAY_BEFORE_CHK_RDY quirk enabled. The value (in ms) was
  * found empirically.
  */
-#define NVME_QUIRK_DELAY_AMOUNT		2000
+#define NVME_QUIRK_DELAY_AMOUNT		2300
 
 enum nvme_ctrl_state {
 	NVME_CTRL_NEW,
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 3f5a04c586ce..75539f7c58b9 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, },
 	{ 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

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

end of thread, other threads:[~2017-11-23  8:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 21:12 [PATCH] NVMe: Add Quirk Delay Before CHK RDY for WDC SN200 jeffreyalien
2017-11-10 21:35 ` Keith Busch
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.