aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-06-08 18:31:21 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:01:35 -0400
commit75baf69657ea2107f2c202cd29dada206ae4b7c4 (patch)
tree76f48393730c19e0a0286ceaa5132d8e500f127f /drivers/scsi/lpfc/lpfc_sli.c
parentc20c426732a5a5d21e99b36286f79c2024115341 (diff)
[SCSI] lpfc 8.3.14: PCI fixes and enhancements
- Allow enabling MSI-X intterupts with fewer vectors than requested by looking at the return value from pci_enable_msix. - Implemented driver PCI AER error handling routines for supporting AER error recovering on SLI4 devices. - Remove redundant SLI_ACTIVE checks Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index ae3cb0ab0ae4..9c609546b4ef 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -3593,13 +3593,16 @@ static int
3593lpfc_sli_brdrestart_s4(struct lpfc_hba *phba) 3593lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
3594{ 3594{
3595 struct lpfc_sli *psli = &phba->sli; 3595 struct lpfc_sli *psli = &phba->sli;
3596 3596 uint32_t hba_aer_enabled;
3597 3597
3598 /* Restart HBA */ 3598 /* Restart HBA */
3599 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 3599 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
3600 "0296 Restart HBA Data: x%x x%x\n", 3600 "0296 Restart HBA Data: x%x x%x\n",
3601 phba->pport->port_state, psli->sli_flag); 3601 phba->pport->port_state, psli->sli_flag);
3602 3602
3603 /* Take PCIe device Advanced Error Reporting (AER) state */
3604 hba_aer_enabled = phba->hba_flag & HBA_AER_ENABLED;
3605
3603 lpfc_sli4_brdreset(phba); 3606 lpfc_sli4_brdreset(phba);
3604 3607
3605 spin_lock_irq(&phba->hbalock); 3608 spin_lock_irq(&phba->hbalock);
@@ -3611,6 +3614,10 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
3611 memset(&psli->lnk_stat_offsets, 0, sizeof(psli->lnk_stat_offsets)); 3614 memset(&psli->lnk_stat_offsets, 0, sizeof(psli->lnk_stat_offsets));
3612 psli->stats_start = get_seconds(); 3615 psli->stats_start = get_seconds();
3613 3616
3617 /* Reset HBA AER if it was enabled, note hba_flag was reset above */
3618 if (hba_aer_enabled)
3619 pci_disable_pcie_error_reporting(phba->pcidev);
3620
3614 lpfc_hba_down_post(phba); 3621 lpfc_hba_down_post(phba);
3615 3622
3616 return 0; 3623 return 0;
@@ -4554,6 +4561,24 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
4554 /* Start error attention (ERATT) polling timer */ 4561 /* Start error attention (ERATT) polling timer */
4555 mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL); 4562 mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL);
4556 4563
4564 /* Enable PCIe device Advanced Error Reporting (AER) if configured */
4565 if (phba->cfg_aer_support == 1 && !(phba->hba_flag & HBA_AER_ENABLED)) {
4566 rc = pci_enable_pcie_error_reporting(phba->pcidev);
4567 if (!rc) {
4568 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
4569 "2829 This device supports "
4570 "Advanced Error Reporting (AER)\n");
4571 spin_lock_irq(&phba->hbalock);
4572 phba->hba_flag |= HBA_AER_ENABLED;
4573 spin_unlock_irq(&phba->hbalock);
4574 } else {
4575 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
4576 "2830 This device does not support "
4577 "Advanced Error Reporting (AER)\n");
4578 phba->cfg_aer_support = 0;
4579 }
4580 }
4581
4557 /* 4582 /*
4558 * The port is ready, set the host's link state to LINK_DOWN 4583 * The port is ready, set the host's link state to LINK_DOWN
4559 * in preparation for link interrupts. 4584 * in preparation for link interrupts.
@@ -9089,9 +9114,10 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe)
9089 } 9114 }
9090 } 9115 }
9091 if (unlikely(!cq)) { 9116 if (unlikely(!cq)) {
9092 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 9117 if (phba->sli.sli_flag & LPFC_SLI_ACTIVE)
9093 "0365 Slow-path CQ identifier (%d) does " 9118 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
9094 "not exist\n", cqid); 9119 "0365 Slow-path CQ identifier "
9120 "(%d) does not exist\n", cqid);
9095 return; 9121 return;
9096 } 9122 }
9097 9123
@@ -9321,9 +9347,10 @@ lpfc_sli4_fp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
9321 9347
9322 cq = phba->sli4_hba.fcp_cq[fcp_cqidx]; 9348 cq = phba->sli4_hba.fcp_cq[fcp_cqidx];
9323 if (unlikely(!cq)) { 9349 if (unlikely(!cq)) {
9324 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 9350 if (phba->sli.sli_flag & LPFC_SLI_ACTIVE)
9325 "0367 Fast-path completion queue does not " 9351 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
9326 "exist\n"); 9352 "0367 Fast-path completion queue "
9353 "does not exist\n");
9327 return; 9354 return;
9328 } 9355 }
9329 9356