summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
authorGuilherme G. Piccoli <gpiccoli@canonical.com>2019-08-14 11:26:10 -0300
committerJens Axboe <axboe@kernel.dk>2019-08-20 11:02:10 -0600
commita89fcca8185633993018dc081d6b021d005e6d0b (patch)
tree613431c0907a7577475ebf919459a86a115b9285 /drivers/nvme/host/pci.c
parent504db087aaccdb32af61539916409f7dca31ceb5 (diff)
downloadlwn-a89fcca8185633993018dc081d6b021d005e6d0b.tar.gz
lwn-a89fcca8185633993018dc081d6b021d005e6d0b.zip
nvme: Fix cntlid validation when not using NVMEoF
Commit 1b1031ca63b2 ("nvme: validate cntlid during controller initialisation") introduced a validation for controllers with duplicate cntlid that runs on nvme_init_subsystem(). The problem is that the validation relies on ctrl->cntlid, and this value is assigned (from id_ctrl value) after the call for nvme_init_subsystem() in nvme_init_identify() for non-fabrics scenario. That leads to ctrl->cntlid always being 0 in case we have a physical set of controllers in the same subsystem. This patch fixes that by loading the discovered cntlid id_ctrl value into ctrl->cntlid before the subsystem initialization, only for the non-fabrics case. The patch was tested with emulated nvme devices (qemu) having two controllers in a single subsystem. Without the patch, we couldn't make it work failing in the duplicate check; when running with the patch, we could see the subsystem holding both controllers. For the fabrics case we see ctrl->cntlid has a more intricate relation with the admin connect, so we didn't change that. Fixes: 1b1031ca63b2 ("nvme: validate cntlid during controller initialisation") Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/host/pci.c')
0 files changed, 0 insertions, 0 deletions