]> git.karo-electronics.de Git - linux-beck.git/commitdiff
bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
authorAlexander Gordeev <agordeev@redhat.com>
Wed, 16 Jul 2014 18:05:08 +0000 (20:05 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 29 Jul 2014 12:38:52 +0000 (08:38 -0400)
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>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/bfa/bfad.c

index c18279fbb8b39ad76432a9647f6d27b94d526109..e90a3742f09d9b9b19fea19bfb3e7d1285e8ca99 100644 (file)
@@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
        if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
           (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
 
-               error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
+               error = pci_enable_msix_exact(bfad->pcidev,
+                                             msix_entries, bfad->nvec);
                /* In CT1 & CT2, try to allocate just one vector */
-               if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
+               if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
                        printk(KERN_WARNING "bfa %s: trying one msix "
                               "vector failed to allocate %d[%d]\n",
                               bfad->pci_name, bfad->nvec, error);
                        bfad->nvec = 1;
-                       error = pci_enable_msix(bfad->pcidev,
-                                               msix_entries, bfad->nvec);
+                       error = pci_enable_msix_exact(bfad->pcidev,
+                                                     msix_entries, 1);
                }
 
-               /*
-                * Only error number of vector is available.
-                * We don't have a mechanism to map multiple
-                * interrupts into one vector, so even if we
-                * can try to request less vectors, we don't
-                * know how to associate interrupt events to
-                *  vectors. Linux doesn't duplicate vectors
-                * in the MSIX table for this case.
-                */
                if (error) {
                        printk(KERN_WARNING "bfad%d: "
-                              "pci_enable_msix failed (%d), "
+                              "pci_enable_msix_exact failed (%d), "
                               "use line based.\n",
                                bfad->inst_no, error);
                        goto line_based;