From: Martin George Date: Thu, 16 Mar 2023 11:50:09 +0000 (+0530) Subject: nvme: send Identify with CNS 06h only to I/O controllers X-Git-Tag: v6.1.37~2192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb0cf2bd636328b129e72f48c01e7dfa8f650d6f;p=platform%2Fkernel%2Flinux-starfive.git nvme: send Identify with CNS 06h only to I/O controllers [ Upstream commit def84ab600b71ea3fcc422a876d5d0d0daa7d4f3 ] 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 Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index cb71ce3..c54c6ff 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3074,7 +3074,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);