diff options
| author | Keith Busch <kbusch@kernel.org> | 2026-02-10 21:38:09 +0300 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-02-13 17:47:59 +0300 |
| commit | baa47c4f89eb2e7614e6a06dd5957632e38c4e74 (patch) | |
| tree | e4adde303dab34d80024892e143ead2ce03c33ae | |
| parent | 4735b510a00fb2d4ac9e8d21a8c9552cb281f585 (diff) | |
| download | linux-baa47c4f89eb2e7614e6a06dd5957632e38c4e74.tar.xz | |
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>
| -rw-r--r-- | drivers/nvme/host/pci.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index c63efa49132f..0c1a8d7aa1c0 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2902,6 +2902,18 @@ static int nvme_setup_io_queues(struct nvme_dev *dev) dev->nr_write_queues = write_queues; dev->nr_poll_queues = poll_queues; + if (dev->ctrl.tagset) { + /* + * The set's maps are allocated only once at initialization + * time. We can't add special queues later if their mq_map + * wasn't preallocated. + */ + if (dev->ctrl.tagset->nr_maps < 3) + dev->nr_poll_queues = 0; + if (dev->ctrl.tagset->nr_maps < 2) + dev->nr_write_queues = 0; + } + /* * The initial number of allocated queue slots may be too large if the * user reduced the special queue parameters. Cap the value to the |
