]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nvme-core: do ioccsz/iorcsz validation only for I/O controllers
authorKamaljit Singh <kamaljit.singh@opensource.wdc.com>
Fri, 5 Sep 2025 23:25:50 +0000 (16:25 -0700)
committerKeith Busch <kbusch@kernel.org>
Tue, 23 Sep 2025 22:38:28 +0000 (15:38 -0700)
An administrative controller does not support I/O queues, hence it
should ignore existing checks for IOCCSZ/IORCSZ. Currently, these checks
only exclude a discovery controller but need to also exclude an
administrative controller.

Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index 0f20adcebcf156bb62c9f57318936fa9d9df496d..edfe7a267a4b67dc3b497d3a30f61d722f2e4f9e 100644 (file)
@@ -3492,14 +3492,14 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
                return -EINVAL;
        }
 
-       if (!nvme_discovery_ctrl(ctrl) && ctrl->ioccsz < 4) {
+       if (nvme_is_io_ctrl(ctrl) && ctrl->ioccsz < 4) {
                dev_err(ctrl->device,
                        "I/O queue command capsule supported size %d < 4\n",
                        ctrl->ioccsz);
                return -EINVAL;
        }
 
-       if (!nvme_discovery_ctrl(ctrl) && ctrl->iorcsz < 1) {
+       if (nvme_is_io_ctrl(ctrl) && ctrl->iorcsz < 1) {
                dev_err(ctrl->device,
                        "I/O queue response capsule supported size %d < 1\n",
                        ctrl->iorcsz);