From af7573350e642c7a2e62babb3f5cc47f25e57f09 Mon Sep 17 00:00:00 2001 From: James Smart Date: Mon, 7 Apr 2008 10:16:00 -0400 Subject: [PATCH] --- yaml --- r: 89763 b: refs/heads/master c: 9b37960523afb1b519b406dec4c4f3155b82b2ba h: refs/heads/master i: 89761: 7e31231f685ea79249aff31f0a801ca36e5d0508 89759: 7c0b573c0b82cd80a40910d9a03dc03d4388155e v: v3 --- [refs] | 2 +- trunk/drivers/scsi/lpfc/lpfc_init.c | 31 +++++++++++++++++++++++++++++ trunk/drivers/scsi/lpfc/lpfc_sli.c | 3 +-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index d20c2a75f494..0780737088c4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 58da1ffb2b1234e9c6c75013a649c659cc38ebd4 +refs/heads/master: 9b37960523afb1b519b406dec4c4f3155b82b2ba diff --git a/trunk/drivers/scsi/lpfc/lpfc_init.c b/trunk/drivers/scsi/lpfc/lpfc_init.c index 26c67c866d1f..dba6770b506b 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_init.c +++ b/trunk/drivers/scsi/lpfc/lpfc_init.c @@ -2371,6 +2371,7 @@ static pci_ers_result_t lpfc_io_slot_reset(struct pci_dev *pdev) struct Scsi_Host *shost = pci_get_drvdata(pdev); struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; struct lpfc_sli *psli = &phba->sli; + int error, retval; dev_printk(KERN_INFO, &pdev->dev, "recovering from a slot reset.\n"); if (pci_enable_device_mem(pdev)) { @@ -2385,6 +2386,36 @@ static pci_ers_result_t lpfc_io_slot_reset(struct pci_dev *pdev) psli->sli_flag &= ~LPFC_SLI2_ACTIVE; spin_unlock_irq(&phba->hbalock); + /* Enable configured interrupt method */ + phba->intr_type = NONE; + if (phba->cfg_use_msi == 2) { + error = lpfc_enable_msix(phba); + if (!error) + phba->intr_type = MSIX; + } + + /* Fallback to MSI if MSI-X initialization failed */ + if (phba->cfg_use_msi >= 1 && phba->intr_type == NONE) { + retval = pci_enable_msi(phba->pcidev); + if (!retval) + phba->intr_type = MSI; + else + lpfc_printf_log(phba, KERN_INFO, LOG_INIT, + "0470 Enable MSI failed, continuing " + "with IRQ\n"); + } + + /* MSI-X is the only case the doesn't need to call request_irq */ + if (phba->intr_type != MSIX) { + retval = request_irq(phba->pcidev->irq, lpfc_intr_handler, + IRQF_SHARED, LPFC_DRIVER_NAME, phba); + if (retval) { + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0471 Enable interrupt handler " + "failed\n"); + } else if (phba->intr_type != MSI) + phba->intr_type = INTx; + } /* Take device offline; this will perform cleanup */ lpfc_offline(phba); diff --git a/trunk/drivers/scsi/lpfc/lpfc_sli.c b/trunk/drivers/scsi/lpfc/lpfc_sli.c index c71b9a577770..741e94af4793 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_sli.c +++ b/trunk/drivers/scsi/lpfc/lpfc_sli.c @@ -3634,8 +3634,7 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, * If the iocb is not found in Firmware queue the iocb * might have completed already. Do not free it again. */ - if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && - (irsp->un.ulpWord[4] == IOERR_NO_XRI)) { + if (irsp->ulpStatus == IOSTAT_LOCAL_REJECT) { spin_unlock_irq(&phba->hbalock); lpfc_sli_release_iocbq(phba, cmdiocb); return;