提交 07b1b914 编写于 作者: J James Smart 提交者: Martin K. Petersen

scsi: lpfc: Fix sli4 adapter initialization with MSI

When forcing the use of MSI (vs MSI-X) the driver is crashing in
pci_irq_get_affinity.

The driver was not using the new pci_alloc_irq_vectors interface in the MSI
path.

Fix by using pci_alloc_irq_vectors() with PCI_RQ_MSI in the MSI path.
Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: NJames Smart <jsmart2021@gmail.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 6a224b47
...@@ -11119,10 +11119,10 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba) ...@@ -11119,10 +11119,10 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
* @phba: pointer to lpfc hba data structure. * @phba: pointer to lpfc hba data structure.
* *
* This routine is invoked to enable the MSI interrupt mode to device with * This routine is invoked to enable the MSI interrupt mode to device with
* SLI-4 interface spec. The kernel function pci_enable_msi() is called * SLI-4 interface spec. The kernel function pci_alloc_irq_vectors() is
* to enable the MSI vector. The device driver is responsible for calling * called to enable the MSI vector. The device driver is responsible for
* the request_irq() to register MSI vector with a interrupt the handler, * calling the request_irq() to register MSI vector with a interrupt the
* which is done in this function. * handler, which is done in this function.
* *
* Return codes * Return codes
* 0 - successful * 0 - successful
...@@ -11133,20 +11133,21 @@ lpfc_sli4_enable_msi(struct lpfc_hba *phba) ...@@ -11133,20 +11133,21 @@ lpfc_sli4_enable_msi(struct lpfc_hba *phba)
{ {
int rc, index; int rc, index;
rc = pci_enable_msi(phba->pcidev); rc = pci_alloc_irq_vectors(phba->pcidev, 1, 1,
if (!rc) PCI_IRQ_MSI | PCI_IRQ_AFFINITY);
if (rc > 0)
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"0487 PCI enable MSI mode success.\n"); "0487 PCI enable MSI mode success.\n");
else { else {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"0488 PCI enable MSI mode failed (%d)\n", rc); "0488 PCI enable MSI mode failed (%d)\n", rc);
return rc; return rc ? rc : -1;
} }
rc = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler, rc = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler,
0, LPFC_DRIVER_NAME, phba); 0, LPFC_DRIVER_NAME, phba);
if (rc) { if (rc) {
pci_disable_msi(phba->pcidev); pci_free_irq_vectors(phba->pcidev);
lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
"0490 MSI request_irq failed (%d)\n", rc); "0490 MSI request_irq failed (%d)\n", rc);
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册