nvme-pci: fix nvme_setup_irqs()
authorMing Lei <ming.lei@redhat.com>
Thu, 3 Jan 2019 01:34:39 +0000 (09:34 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Jan 2019 16:44:28 +0000 (09:44 -0700)
commitc45b1fa2433c65e44bdf48f513cb37289f3116b9
treef8dc802dee1950b7419eb0e63669c5e0932d454b
parentfb8658581a150a859b654b154cefe3118ff4f1e0
nvme-pci: fix nvme_setup_irqs()

When -ENOSPC is returned from pci_alloc_irq_vectors_affinity(),
we still try to allocate multiple irq vectors again, so irq queues
covers the admin queue actually. But we don't consider that, then
number of the allocated irq vector may be same with sum of
io_queues[HCTX_TYPE_DEFAULT] and io_queues[HCTX_TYPE_READ], this way
is obviously wrong, and finally breaks nvme_pci_map_queues(), and
warning from pci_irq_get_affinity() is triggered.

IRQ queues should cover admin queues, this patch makes this
point explicitely in nvme_calc_io_queues().

We got severl boot failure internal report on aarch64, so please
consider to fix it in v4.20.

Fixes: 6451fe73fa0f ("nvme: fix irq vs io_queue calculations")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Tested-by: fin4478 <fin4478@hotmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/pci.c