Skip to content

Commit 45dc8f2

Browse files
chenhuacaimartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix qla2x00_request_irqs() for MSI
Commit 4fa1834 ("scsi: qla2xxx: Utilize pci_alloc_irq_vectors/ pci_free_irq_vectors calls.") use pci_alloc_irq_vectors() to replace pci_enable_msi() but it didn't handle the return value correctly. This bug make qla2x00 always fail to setup MSI if MSI-X fail, so fix it. BTW, improve the log message of return value in qla2x00_request_irqs() to avoid confusion. Fixes: 4fa1834 ("scsi: qla2xxx: Utilize pci_alloc_irq_vectors/pci_free_irq_vectors calls.") Cc: Michael Hernandez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Huacai Chen <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c8a3479 commit 45dc8f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3650,21 +3650,21 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
36503650
skip_msix:
36513651

36523652
ql_log(ql_log_info, vha, 0x0037,
3653-
"Falling back-to MSI mode -%d.\n", ret);
3653+
"Falling back-to MSI mode -- ret=%d.\n", ret);
36543654

36553655
if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) &&
36563656
!IS_QLA8001(ha) && !IS_P3P_TYPE(ha) && !IS_QLAFX00(ha) &&
36573657
!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
36583658
goto skip_msi;
36593659

36603660
ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI);
3661-
if (!ret) {
3661+
if (ret > 0) {
36623662
ql_dbg(ql_dbg_init, vha, 0x0038,
36633663
"MSI: Enabled.\n");
36643664
ha->flags.msi_enabled = 1;
36653665
} else
36663666
ql_log(ql_log_warn, vha, 0x0039,
3667-
"Falling back-to INTa mode -- %d.\n", ret);
3667+
"Falling back-to INTa mode -- ret=%d.\n", ret);
36683668
skip_msi:
36693669

36703670
/* Skip INTx on ISP82xx. */

0 commit comments

Comments
 (0)