diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-03-04 10:22:00 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-03-13 16:56:39 -0400 |
commit | be577fabf3ec2c9593f4d3c044283be783b88c3b (patch) | |
tree | 2056b692d20e414758e3a75fae110ef245da641e /drivers/block/nvme-core.c | |
parent | 371ff93a72a1aa14773e2e17548796db8c004a6c (diff) |
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>
Diffstat (limited to 'drivers/block/nvme-core.c')
-rw-r--r-- | drivers/block/nvme-core.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 51824d1f23ea..eca2b3ed8475 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
@@ -1837,31 +1837,16 @@ static int nvme_setup_io_queues(struct nvme_dev *dev) | |||
1837 | /* Deregister the admin queue's interrupt */ | 1837 | /* Deregister the admin queue's interrupt */ |
1838 | free_irq(dev->entry[0].vector, adminq); | 1838 | free_irq(dev->entry[0].vector, adminq); |
1839 | 1839 | ||
1840 | vecs = nr_io_queues; | 1840 | for (i = 0; i < nr_io_queues; i++) |
1841 | for (i = 0; i < vecs; i++) | ||
1842 | dev->entry[i].entry = i; | 1841 | dev->entry[i].entry = i; |
1843 | for (;;) { | 1842 | vecs = pci_enable_msix_range(pdev, dev->entry, 1, nr_io_queues); |
1844 | result = pci_enable_msix(pdev, dev->entry, vecs); | 1843 | if (vecs < 0) { |
1845 | if (result <= 0) | 1844 | vecs = pci_enable_msi_range(pdev, 1, min(nr_io_queues, 32)); |
1846 | break; | 1845 | if (vecs < 0) { |
1847 | vecs = result; | 1846 | vecs = 1; |
1848 | } | 1847 | } else { |
1849 | 1848 | for (i = 0; i < vecs; i++) | |
1850 | if (result < 0) { | 1849 | dev->entry[i].vector = i + pdev->irq; |
1851 | vecs = nr_io_queues; | ||
1852 | if (vecs > 32) | ||
1853 | vecs = 32; | ||
1854 | for (;;) { | ||
1855 | result = pci_enable_msi_block(pdev, vecs); | ||
1856 | if (result == 0) { | ||
1857 | for (i = 0; i < vecs; i++) | ||
1858 | dev->entry[i].vector = i + pdev->irq; | ||
1859 | break; | ||
1860 | } else if (result < 0) { | ||
1861 | vecs = 1; | ||
1862 | break; | ||
1863 | } | ||
1864 | vecs = result; | ||
1865 | } | 1850 | } |
1866 | } | 1851 | } |
1867 | 1852 | ||