From: Aviv Heller <Aviv.Heller@kioxia.com>
To: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: "kbusch@kernel.org" <kbusch@kernel.org>, "hch@lst.de" <hch@lst.de>
Subject: [PATCH 1/1] nvme: check for Identify CNS 06h opcode support
Date: Thu, 30 Sep 2021 12:14:26 +0000 [thread overview]
Message-ID: <5721a04a493e4f7fb87f2899d08391ef@kioxia.com> (raw)
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
next reply other threads:[~2021-09-30 12:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 12:14 Aviv Heller [this message]
2021-09-30 16:04 ` [PATCH 1/1] nvme: check for Identify CNS 06h opcode support Keith Busch
2021-10-04 15:57 ` Aviv Heller
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=5721a04a493e4f7fb87f2899d08391ef@kioxia.com \
--to=aviv.heller@kioxia.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
/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