aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c78
1 files changed, 41 insertions, 37 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index f32cd9acd3f6..c6b30a8617bc 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -594,49 +594,50 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
594 } 594 }
595 phba->elsbuf_prev_cnt = phba->elsbuf_cnt; 595 phba->elsbuf_prev_cnt = phba->elsbuf_cnt;
596 596
597
598 /* If there is no heart beat outstanding, issue a heartbeat command */ 597 /* If there is no heart beat outstanding, issue a heartbeat command */
599 if (!phba->hb_outstanding) { 598 if (phba->cfg_enable_hba_heartbeat) {
600 pmboxq = mempool_alloc(phba->mbox_mem_pool,GFP_KERNEL); 599 if (!phba->hb_outstanding) {
601 if (!pmboxq) { 600 pmboxq = mempool_alloc(phba->mbox_mem_pool,GFP_KERNEL);
602 mod_timer(&phba->hb_tmofunc, 601 if (!pmboxq) {
603 jiffies + HZ * LPFC_HB_MBOX_INTERVAL); 602 mod_timer(&phba->hb_tmofunc,
604 return; 603 jiffies + HZ * LPFC_HB_MBOX_INTERVAL);
605 } 604 return;
605 }
606 606
607 lpfc_heart_beat(phba, pmboxq); 607 lpfc_heart_beat(phba, pmboxq);
608 pmboxq->mbox_cmpl = lpfc_hb_mbox_cmpl; 608 pmboxq->mbox_cmpl = lpfc_hb_mbox_cmpl;
609 pmboxq->vport = phba->pport; 609 pmboxq->vport = phba->pport;
610 retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT); 610 retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT);
611 611
612 if (retval != MBX_BUSY && retval != MBX_SUCCESS) { 612 if (retval != MBX_BUSY && retval != MBX_SUCCESS) {
613 mempool_free(pmboxq, phba->mbox_mem_pool); 613 mempool_free(pmboxq, phba->mbox_mem_pool);
614 mod_timer(&phba->hb_tmofunc,
615 jiffies + HZ * LPFC_HB_MBOX_INTERVAL);
616 return;
617 }
614 mod_timer(&phba->hb_tmofunc, 618 mod_timer(&phba->hb_tmofunc,
615 jiffies + HZ * LPFC_HB_MBOX_INTERVAL); 619 jiffies + HZ * LPFC_HB_MBOX_TIMEOUT);
620 phba->hb_outstanding = 1;
616 return; 621 return;
622 } else {
623 /*
624 * If heart beat timeout called with hb_outstanding set
625 * we need to take the HBA offline.
626 */
627 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
628 "0459 Adapter heartbeat failure, "
629 "taking this port offline.\n");
630
631 spin_lock_irq(&phba->hbalock);
632 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
633 spin_unlock_irq(&phba->hbalock);
634
635 lpfc_offline_prep(phba);
636 lpfc_offline(phba);
637 lpfc_unblock_mgmt_io(phba);
638 phba->link_state = LPFC_HBA_ERROR;
639 lpfc_hba_down_post(phba);
617 } 640 }
618 mod_timer(&phba->hb_tmofunc,
619 jiffies + HZ * LPFC_HB_MBOX_TIMEOUT);
620 phba->hb_outstanding = 1;
621 return;
622 } else {
623 /*
624 * If heart beat timeout called with hb_outstanding set we
625 * need to take the HBA offline.
626 */
627 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
628 "0459 Adapter heartbeat failure, taking "
629 "this port offline.\n");
630
631 spin_lock_irq(&phba->hbalock);
632 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
633 spin_unlock_irq(&phba->hbalock);
634
635 lpfc_offline_prep(phba);
636 lpfc_offline(phba);
637 lpfc_unblock_mgmt_io(phba);
638 phba->link_state = LPFC_HBA_ERROR;
639 lpfc_hba_down_post(phba);
640 } 641 }
641} 642}
642 643
@@ -665,6 +666,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
665 * since we cannot communicate with the pci card anyway. */ 666 * since we cannot communicate with the pci card anyway. */
666 if (pci_channel_offline(phba->pcidev)) 667 if (pci_channel_offline(phba->pcidev))
667 return; 668 return;
669 /* If resets are disabled then leave the HBA alone and return */
670 if (!phba->cfg_enable_hba_reset)
671 return;
668 672
669 if (phba->work_hs & HS_FFER6 || 673 if (phba->work_hs & HS_FFER6 ||
670 phba->work_hs & HS_FFER5) { 674 phba->work_hs & HS_FFER5) {