diff options
author | Christoph Hellwig <hch@lst.de> | 2022-07-12 18:15:01 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-08-02 17:22:51 -0600 |
commit | 71882e7d23b84036d4b0bea896a7b457478f3df2 (patch) | |
tree | 02154fc08e76c21a77042b453c592ee3c0d319f0 /drivers/nvme/host | |
parent | 04c170f669f1686b8b762625ac9c5297bfd5add2 (diff) | |
download | linux-71882e7d23b84036d4b0bea896a7b457478f3df2.tar.bz2 |
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>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r-- | drivers/nvme/host/core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index c8d7bb06e371..25d0af78fb00 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4294,6 +4294,12 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid) if (nvme_identify_ns_descs(ctrl, nsid, &ids)) 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 * AEN once it becomes ready and restart the scan. @@ -4325,12 +4331,6 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid) nsid); 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); break; default: |