linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: skip optional id ctrl csi if it failed
@ 2023-05-30 15:22 Keith Busch
  2023-05-31 13:03 ` Christoph Hellwig
  2023-06-05 23:02 ` Sagi Grimberg
  0 siblings, 2 replies; 3+ messages in thread
From: Keith Busch @ 2023-05-30 15:22 UTC (permalink / raw)
  To: linux-nvme, hch, sagi; +Cc: Keith Busch

From: Keith Busch <kbusch@kernel.org>

I frequently recieved report is the driver requests the optional
Command Set Specific Identify Controller structure. Some controllers
report this in their error log, which tiggers other warnings to user
space monitoring the devices.

These error entries are harmless and of questionable value to save in
the log, but let's reduce their occurance by not resending the command
if it previously failed.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217445
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/core.c | 5 ++++-
 drivers/nvme/host/nvme.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1f0cbb77b2493..0fe8d9c18759a 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3064,7 +3064,8 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 		ctrl->max_zeroes_sectors = 0;
 
 	if (ctrl->subsys->subtype != NVME_NQN_NVME ||
-	    nvme_ctrl_limited_cns(ctrl))
+	    nvme_ctrl_limited_cns(ctrl) ||
+	    test_bit(NVME_CTRL_SKIP_ID_CNS_CS, ctrl->flags))
 		return 0;
 
 	id = kzalloc(sizeof(*id), GFP_KERNEL);
@@ -3086,6 +3087,8 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 		ctrl->max_zeroes_sectors = nvme_mps_to_sectors(ctrl, id->wzsl);
 
 free_data:
+	if (ret > 0)
+		set_bit(NVME_CTRL_SKIP_ID_CNS_CS, ctrl->flags);
 	kfree(id);
 	return ret;
 }
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index a2d4f59e0535a..2f11f1d9a85ac 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -247,6 +247,7 @@ enum nvme_ctrl_flags {
 	NVME_CTRL_ADMIN_Q_STOPPED	= 1,
 	NVME_CTRL_STARTED_ONCE		= 2,
 	NVME_CTRL_STOPPED		= 3,
+	NVME_CTRL_SKIP_ID_CNS_CS	= 4,
 };
 
 struct nvme_ctrl {
-- 
2.34.1



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

* Re: [PATCH] nvme: skip optional id ctrl csi if it failed
  2023-05-30 15:22 [PATCH] nvme: skip optional id ctrl csi if it failed Keith Busch
@ 2023-05-31 13:03 ` Christoph Hellwig
  2023-06-05 23:02 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-05-31 13:03 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, hch, sagi, Keith Busch

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

* Re: [PATCH] nvme: skip optional id ctrl csi if it failed
  2023-05-30 15:22 [PATCH] nvme: skip optional id ctrl csi if it failed Keith Busch
  2023-05-31 13:03 ` Christoph Hellwig
@ 2023-06-05 23:02 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2023-06-05 23:02 UTC (permalink / raw)
  To: Keith Busch, linux-nvme, hch; +Cc: Keith Busch

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


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

end of thread, other threads:[~2023-06-05 23:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 15:22 [PATCH] nvme: skip optional id ctrl csi if it failed Keith Busch
2023-05-31 13:03 ` Christoph Hellwig
2023-06-05 23:02 ` Sagi Grimberg

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).