Skip to content

Commit b427d00

Browse files
Alexander GordeevChristoph Hellwig
authored andcommitted
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>
1 parent 8cb7f63 commit b427d00

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

‎drivers/scsi/bfa/bfad.c‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
12341234
if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
12351235
(bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
12361236

1237-
error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
1237+
error = pci_enable_msix_exact(bfad->pcidev,
1238+
msix_entries, bfad->nvec);
12381239
/* 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)) {
12401241
printk(KERN_WARNING "bfa %s: trying one msix "
12411242
"vector failed to allocate %d[%d]\n",
12421243
bfad->pci_name, bfad->nvec, error);
12431244
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);
12461247
}
12471248

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-
*/
12571249
if (error) {
12581250
printk(KERN_WARNING "bfad%d: "
1259-
"pci_enable_msix failed (%d), "
1251+
"pci_enable_msix_exact failed (%d), "
12601252
"use line based.\n",
12611253
bfad->inst_no, error);
12621254
goto line_based;

0 commit comments

Comments
 (0)