Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

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>

authored by

Alexander Gordeev and committed by
Christoph Hellwig
b427d00f 8cb7f63d

+6 -14
+6 -14
drivers/scsi/bfa/bfad.c
··· 1234 1234 if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) || 1235 1235 (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) { 1236 1236 1237 - error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec); 1237 + error = pci_enable_msix_exact(bfad->pcidev, 1238 + msix_entries, bfad->nvec); 1238 1239 /* In CT1 & CT2, try to allocate just one vector */ 1239 - if (error > 0 && bfa_asic_id_ctc(pdev->device)) { 1240 + if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) { 1240 1241 printk(KERN_WARNING "bfa %s: trying one msix " 1241 1242 "vector failed to allocate %d[%d]\n", 1242 1243 bfad->pci_name, bfad->nvec, error); 1243 1244 bfad->nvec = 1; 1244 - error = pci_enable_msix(bfad->pcidev, 1245 - msix_entries, bfad->nvec); 1245 + error = pci_enable_msix_exact(bfad->pcidev, 1246 + msix_entries, 1); 1246 1247 } 1247 1248 1248 - /* 1249 - * Only error number of vector is available. 1250 - * We don't have a mechanism to map multiple 1251 - * interrupts into one vector, so even if we 1252 - * can try to request less vectors, we don't 1253 - * know how to associate interrupt events to 1254 - * vectors. Linux doesn't duplicate vectors 1255 - * in the MSIX table for this case. 1256 - */ 1257 1249 if (error) { 1258 1250 printk(KERN_WARNING "bfad%d: " 1259 - "pci_enable_msix failed (%d), " 1251 + "pci_enable_msix_exact failed (%d), " 1260 1252 "use line based.\n", 1261 1253 bfad->inst_no, error); 1262 1254 goto line_based;