Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] nvme: check for Identify CNS 06h opcode support
@ 2021-09-30 12:14 Aviv Heller
  2021-09-30 16:04 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: Aviv Heller @ 2021-09-30 12:14 UTC (permalink / raw)
  To: linux-nvme@lists.infradead.org; +Cc: kbusch@kernel.org, hch@lst.de

nvme_init_non_mdts_limits() issues Identify CNS 06h command, and
silently fails in case of command failure.

The code checks whether CNS values greater than 1 are supported,
however, CNS 06h is only supported since 2.0.

Modify the check such that the command is only issued for 2.0
compliant devices.

Fixes: 5befc7c26e5a ("nvme: implement non-mdts command limits")
Signed-off-by: Aviv Heller <aviv.heller@kioxia.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e486845d2c7e..8cfb4ebe1279 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2823,7 +2823,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 	else
 		ctrl->max_zeroes_sectors = 0;
 
-	if (nvme_ctrl_limited_cns(ctrl))
+	if (ctrl->vs < NVME_VS(2, 0, 0))
 		return 0;
 
 	id = kzalloc(sizeof(*id), GFP_KERNEL);
-- 
2.30.2

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

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

end of thread, other threads:[~2021-10-04 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-30 12:14 [PATCH 1/1] nvme: check for Identify CNS 06h opcode support Aviv Heller
2021-09-30 16:04 ` Keith Busch
2021-10-04 15:57   ` Aviv Heller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox