]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
nvme-pci: only set nr_maps to 2 if poll queues are supported
authorChristoph Hellwig <hch@lst.de>
Fri, 14 Dec 2018 13:06:59 +0000 (14:06 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 18 Dec 2018 16:50:44 +0000 (17:50 +0100)
The block layer now enables polling support on a queue if nr_maps
includes the poll map, so we should only set that if we actually
support poll queues.

Fixes: 6544d229bf ("block: enable polling by default if a poll map is initalized")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/pci.c

index 698b350b38cffd3cc44974ba4ead96c35c79a3fc..a3e0b9378e54c01a734698142a5a2db5abb3591c 100644 (file)
@@ -2289,6 +2289,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 */
+               if (dev->io_queues[HCTX_TYPE_POLL])
+                       dev->tagset.nr_maps++;
                dev->tagset.nr_maps = HCTX_MAX_TYPES;
                dev->tagset.timeout = NVME_IO_TIMEOUT;
                dev->tagset.numa_node = dev_to_node(dev->dev);