mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-11 07:30:16 +00:00
nvme: Use pci_enable_msi_range() and pci_enable_msix_range()
As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Cc: Keith Busch <keith.busch@intel.com> Cc: Matthew Wilcox <willy@linux.intel.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: linux-nvme@lists.infradead.org Cc: linux-pci@vger.kernel.org Reviewed-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
371ff93a72
commit
be577fabf3
@ -1837,31 +1837,16 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
|
|||||||
/* Deregister the admin queue's interrupt */
|
/* Deregister the admin queue's interrupt */
|
||||||
free_irq(dev->entry[0].vector, adminq);
|
free_irq(dev->entry[0].vector, adminq);
|
||||||
|
|
||||||
vecs = nr_io_queues;
|
for (i = 0; i < nr_io_queues; i++)
|
||||||
for (i = 0; i < vecs; i++)
|
|
||||||
dev->entry[i].entry = i;
|
dev->entry[i].entry = i;
|
||||||
for (;;) {
|
vecs = pci_enable_msix_range(pdev, dev->entry, 1, nr_io_queues);
|
||||||
result = pci_enable_msix(pdev, dev->entry, vecs);
|
if (vecs < 0) {
|
||||||
if (result <= 0)
|
vecs = pci_enable_msi_range(pdev, 1, min(nr_io_queues, 32));
|
||||||
break;
|
if (vecs < 0) {
|
||||||
vecs = result;
|
vecs = 1;
|
||||||
}
|
} else {
|
||||||
|
for (i = 0; i < vecs; i++)
|
||||||
if (result < 0) {
|
dev->entry[i].vector = i + pdev->irq;
|
||||||
vecs = nr_io_queues;
|
|
||||||
if (vecs > 32)
|
|
||||||
vecs = 32;
|
|
||||||
for (;;) {
|
|
||||||
result = pci_enable_msi_block(pdev, vecs);
|
|
||||||
if (result == 0) {
|
|
||||||
for (i = 0; i < vecs; i++)
|
|
||||||
dev->entry[i].vector = i + pdev->irq;
|
|
||||||
break;
|
|
||||||
} else if (result < 0) {
|
|
||||||
vecs = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
vecs = result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user