summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/core.c
diff options
context:
space:
mode:
authorMartin George <martinus.gpy@gmail.com>2023-03-16 17:20:09 +0530
committerChristoph Hellwig <hch@lst.de>2023-03-22 09:17:52 +0100
commitdef84ab600b71ea3fcc422a876d5d0d0daa7d4f3 (patch)
tree78af195cbddc09ace18577b638986d1aeb662106 /drivers/nvme/host/core.c
parent9d2789ac9d60c049d26ef6d3005d9c94c5a559e9 (diff)
downloadlinux-def84ab600b71ea3fcc422a876d5d0d0daa7d4f3.tar.gz
linux-def84ab600b71ea3fcc422a876d5d0d0daa7d4f3.tar.bz2
linux-def84ab600b71ea3fcc422a876d5d0d0daa7d4f3.zip
nvme: send Identify with CNS 06h only to I/O controllers
Identify CNS 06h (I/O Command Set Specific Identify Controller data structure) is supported only on i/o controllers. But nvme_init_non_mdts_limits() currently invokes this on all controllers. Correct this by ensuring this is sent to I/O controllers only. Signed-off-by: Martin George <marting@netapp.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/core.c')
-rw-r--r--drivers/nvme/host/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d4be525f8100..53ef028596c6 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3063,7 +3063,8 @@ 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->subsys->subtype != NVME_NQN_NVME ||
+ nvme_ctrl_limited_cns(ctrl))
return 0;
id = kzalloc(sizeof(*id), GFP_KERNEL);