From: Christoph Hellwig Date: Fri, 14 Dec 2018 13:06:59 +0000 (+0100) Subject: nvme-pci: only set nr_maps to 2 if poll queues are supported X-Git-Tag: microblaze-v5.1-rc1~53^2~30^2~10 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=ed92ad37e88555864f1f830db4037b9535b3392c;p=linux-2.6-microblaze.git nvme-pci: only set nr_maps to 2 if poll queues are supported 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 Reviewed-by: Jens Axboe Reviewed-by: Sagi Grimberg --- diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 698b350b38cf..a3e0b9378e54 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -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);