nvme: fix handling of EINVAL on pci_alloc_irq_vectors_affinity()
authorJens Axboe <axboe@kernel.dk>
Thu, 15 Nov 2018 23:05:02 +0000 (16:05 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Nov 2018 23:05:02 +0000 (16:05 -0700)
commitdb29eb059cdc571f9d75cec4a41b9884b3b8286a
tree9ef51b7c98379b2847600d2a6d48b25ea535c41a
parente815f404afdb70beefe2ffd0d767bf3785985869
nvme: fix handling of EINVAL on pci_alloc_irq_vectors_affinity()

At least on SPARC, if MSI/MSI-X isn't supported, we get EINVAL if
we ask for more than one vector. This isn't covered by our ENOSPC
check.

If we get EINVAL, decrease our ask to just one vector, instead of
bailing out in error.

Fixes: 3b6592f70ad7 ("nvme: utilize two queue maps, one for reads and one for writes")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/pci.c