[PATCH 1/1] nvme: check for Identify CNS 06h opcode support

Aviv Heller Aviv.Heller at kioxia.com
Thu Sep 30 05:14:26 PDT 2021


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 at 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



More information about the Linux-nvme mailing list