Skip to content

Commit baa47c4

Browse files
committed
nvme-pci: do not try to add queue maps at runtime
The block layer allocates the set's maps once. We can't add special purpose queues at runtime if they weren't allocated at initialization time. Tested-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 4735b51 commit baa47c4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/nvme/host/pci.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,18 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
29022902
dev->nr_write_queues = write_queues;
29032903
dev->nr_poll_queues = poll_queues;
29042904

2905+
if (dev->ctrl.tagset) {
2906+
/*
2907+
* The set's maps are allocated only once at initialization
2908+
* time. We can't add special queues later if their mq_map
2909+
* wasn't preallocated.
2910+
*/
2911+
if (dev->ctrl.tagset->nr_maps < 3)
2912+
dev->nr_poll_queues = 0;
2913+
if (dev->ctrl.tagset->nr_maps < 2)
2914+
dev->nr_write_queues = 0;
2915+
}
2916+
29052917
/*
29062918
* The initial number of allocated queue slots may be too large if the
29072919
* user reduced the special queue parameters. Cap the value to the

0 commit comments

Comments
 (0)