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.c53
1 files changed, 36 insertions, 17 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 2786ee3b605d..9244aa64b3be 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1032,27 +1032,46 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
1032 /* If there is no heart beat outstanding, issue a heartbeat command */ 1032 /* If there is no heart beat outstanding, issue a heartbeat command */
1033 if (phba->cfg_enable_hba_heartbeat) { 1033 if (phba->cfg_enable_hba_heartbeat) {
1034 if (!phba->hb_outstanding) { 1034 if (!phba->hb_outstanding) {
1035 pmboxq = mempool_alloc(phba->mbox_mem_pool,GFP_KERNEL); 1035 if ((!(psli->sli_flag & LPFC_SLI_MBOX_ACTIVE)) &&
1036 if (!pmboxq) { 1036 (list_empty(&psli->mboxq))) {
1037 mod_timer(&phba->hb_tmofunc, 1037 pmboxq = mempool_alloc(phba->mbox_mem_pool,
1038 jiffies + HZ * LPFC_HB_MBOX_INTERVAL); 1038 GFP_KERNEL);
1039 return; 1039 if (!pmboxq) {
1040 } 1040 mod_timer(&phba->hb_tmofunc,
1041 jiffies +
1042 HZ * LPFC_HB_MBOX_INTERVAL);
1043 return;
1044 }
1041 1045
1042 lpfc_heart_beat(phba, pmboxq); 1046 lpfc_heart_beat(phba, pmboxq);
1043 pmboxq->mbox_cmpl = lpfc_hb_mbox_cmpl; 1047 pmboxq->mbox_cmpl = lpfc_hb_mbox_cmpl;
1044 pmboxq->vport = phba->pport; 1048 pmboxq->vport = phba->pport;
1045 retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT); 1049 retval = lpfc_sli_issue_mbox(phba, pmboxq,
1050 MBX_NOWAIT);
1051
1052 if (retval != MBX_BUSY &&
1053 retval != MBX_SUCCESS) {
1054 mempool_free(pmboxq,
1055 phba->mbox_mem_pool);
1056 mod_timer(&phba->hb_tmofunc,
1057 jiffies +
1058 HZ * LPFC_HB_MBOX_INTERVAL);
1059 return;
1060 }
1061 phba->skipped_hb = 0;
1062 phba->hb_outstanding = 1;
1063 } else if (time_before_eq(phba->last_completion_time,
1064 phba->skipped_hb)) {
1065 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1066 "2857 Last completion time not "
1067 " updated in %d ms\n",
1068 jiffies_to_msecs(jiffies
1069 - phba->last_completion_time));
1070 } else
1071 phba->skipped_hb = jiffies;
1046 1072
1047 if (retval != MBX_BUSY && retval != MBX_SUCCESS) {
1048 mempool_free(pmboxq, phba->mbox_mem_pool);
1049 mod_timer(&phba->hb_tmofunc,
1050 jiffies + HZ * LPFC_HB_MBOX_INTERVAL);
1051 return;
1052 }
1053 mod_timer(&phba->hb_tmofunc, 1073 mod_timer(&phba->hb_tmofunc,
1054 jiffies + HZ * LPFC_HB_MBOX_TIMEOUT); 1074 jiffies + HZ * LPFC_HB_MBOX_TIMEOUT);
1055 phba->hb_outstanding = 1;
1056 return; 1075 return;
1057 } else { 1076 } else {
1058 /* 1077 /*