From c05e243eb33909f572cc8dd829c1ddb405fe095e Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Apr 20 2023 11:00:48 +0000 Subject: nvme: send Identify with CNS 06h only to I/O controllers (bsc#1012628). --- diff --git a/patches.kernel.org/6.2.12-093-nvme-send-Identify-with-CNS-06h-only-to-I-O-co.patch b/patches.kernel.org/6.2.12-093-nvme-send-Identify-with-CNS-06h-only-to-I-O-co.patch new file mode 100644 index 0000000..efa9da6 --- /dev/null +++ b/patches.kernel.org/6.2.12-093-nvme-send-Identify-with-CNS-06h-only-to-I-O-co.patch @@ -0,0 +1,41 @@ +From: Martin George +Date: Thu, 16 Mar 2023 17:20:09 +0530 +Subject: [PATCH] nvme: send Identify with CNS 06h only to I/O controllers +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: def84ab600b71ea3fcc422a876d5d0d0daa7d4f3 + +[ 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 +Signed-off-by: Jiri Slaby +--- + drivers/nvme/host/core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c +index ee1b075d..c0429f9f 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -3106,7 +3106,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); +-- +2.35.3 + diff --git a/series.conf b/series.conf index bc3b318..1f84628 100644 --- a/series.conf +++ b/series.conf @@ -2320,6 +2320,7 @@ patches.kernel.org/6.2.12-090-hwmon-xgene-Fix-ioremap-and-memremap-leak.patch patches.kernel.org/6.2.12-091-verify_pefile-relax-wrapper-length-check.patch patches.kernel.org/6.2.12-092-asymmetric_keys-log-on-fatal-failures-in-PE-pk.patch + patches.kernel.org/6.2.12-093-nvme-send-Identify-with-CNS-06h-only-to-I-O-co.patch ######################################################## # Build fixes that apply to the vanilla kernel too.