diff options
author | Alan Mikhak <alan.mikhak@sifive.com> | 2019-07-08 10:24:12 -0700 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-07-09 13:44:44 -0700 |
commit | 0298d5435276e7795b0b939d74827f6e775e7009 (patch) | |
tree | 99115a44bc7c164b68715dca7cc0bc80cc4e4f81 /drivers/nvme | |
parent | 4fe06923f5181d57178e01add4ba54e269c59e9e (diff) | |
download | linux-0298d5435276e7795b0b939d74827f6e775e7009.tar.bz2 |
nvme-pci: don't create a read hctx mapping without read queues
Only request an IRQ mapping for read queues if at least one read queue
is being allocted, as nvme_pci_map_queues() will later on ignore the
unnecessary mapping request should nvme_dev_add() request such an IRQ
mapping even though no read queues are being allocated. However,
nvme_dev_add() can avoid making the request by checking the number of
read queues without assuming. This would bring it more in line with
nvme_setup_irqs() and nvme_calc_irq_sets().
Signed-off-by: Alan Mikhak <alan.mikhak@sifive.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/pci.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 49c1fc9907a6..0423ddd97f4b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2250,7 +2250,9 @@ static int nvme_dev_add(struct nvme_dev *dev) if (!dev->ctrl.tagset) { dev->tagset.ops = &nvme_mq_ops; dev->tagset.nr_hw_queues = dev->online_queues - 1; - dev->tagset.nr_maps = 2; /* default + read */ + dev->tagset.nr_maps = 1; /* default */ + if (dev->io_queues[HCTX_TYPE_READ]) + dev->tagset.nr_maps++; if (dev->io_queues[HCTX_TYPE_POLL]) dev->tagset.nr_maps++; dev->tagset.timeout = NVME_IO_TIMEOUT; |