Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Javier González <javier.gonz@samsung.com>
Reviewed-by: Joel Granados <j.granados@samsung.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
71882e7d 04c170f6

+6 -6
+6 -6
drivers/nvme/host/core.c
··· 4294 4294 if (nvme_identify_ns_descs(ctrl, nsid, &ids)) 4295 4295 return; 4296 4296 4297 + if (ids.csi != NVME_CSI_NVM && !nvme_multi_css(ctrl)) { 4298 + dev_warn(ctrl->device, 4299 + "command set not reported for nsid: %d\n", nsid); 4300 + return; 4301 + } 4302 + 4297 4303 /* 4298 4304 * Check if the namespace is ready. If not ignore it, we will get an 4299 4305 * AEN once it becomes ready and restart the scan. ··· 4328 4322 if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED)) { 4329 4323 dev_warn(ctrl->device, 4330 4324 "nsid %u not supported without CONFIG_BLK_DEV_ZONED\n", 4331 - nsid); 4332 - break; 4333 - } 4334 - if (!nvme_multi_css(ctrl)) { 4335 - dev_warn(ctrl->device, 4336 - "command set not reported for nsid: %d\n", 4337 4325 nsid); 4338 4326 break; 4339 4327 }