Commit 71882e7d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

nvme: generalize the nvme_multi_css check in nvme_scan_ns

Check for multiple command set support early on an error out if is
not supported when a !NVM command set namespace is found.  This
prepares for adding command set independent passthrough support.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJavier González <javier.gonz@samsung.com>
Reviewed-by: default avatarJoel Granados <j.granados@samsung.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarKanchan Joshi <joshi.k@samsung.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 04c170f6
...@@ -4294,6 +4294,12 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid) ...@@ -4294,6 +4294,12 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
if (nvme_identify_ns_descs(ctrl, nsid, &ids)) if (nvme_identify_ns_descs(ctrl, nsid, &ids))
return; return;
if (ids.csi != NVME_CSI_NVM && !nvme_multi_css(ctrl)) {
dev_warn(ctrl->device,
"command set not reported for nsid: %d\n", nsid);
return;
}
/* /*
* Check if the namespace is ready. If not ignore it, we will get an * Check if the namespace is ready. If not ignore it, we will get an
* AEN once it becomes ready and restart the scan. * AEN once it becomes ready and restart the scan.
...@@ -4325,12 +4331,6 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid) ...@@ -4325,12 +4331,6 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
nsid); nsid);
break; break;
} }
if (!nvme_multi_css(ctrl)) {
dev_warn(ctrl->device,
"command set not reported for nsid: %d\n",
nsid);
break;
}
nvme_alloc_ns(ctrl, nsid, &ids); nvme_alloc_ns(ctrl, nsid, &ids);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment