aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2013-04-17 20:14:58 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 15:39:54 -0400
commit256ec0d05f8050339a9cc4e92bdc96cec1ce82bd (patch)
tree41efc3e2b178401629b9a201011d06c3e4133d9a /drivers/scsi/lpfc/lpfc_init.c
parent737d42483ed843b93b67bae9a166bc9fdbc6070b (diff)
[SCSI] lpfc 8.3.39: Remove driver dependency on HZ
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c45
1 files changed, 29 insertions, 16 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 8edef6c4d57a..ac210d7fc96a 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -541,13 +541,16 @@ lpfc_config_port_post(struct lpfc_hba *phba)
541 541
542 /* Set up ring-0 (ELS) timer */ 542 /* Set up ring-0 (ELS) timer */
543 timeout = phba->fc_ratov * 2; 543 timeout = phba->fc_ratov * 2;
544 mod_timer(&vport->els_tmofunc, jiffies + HZ * timeout); 544 mod_timer(&vport->els_tmofunc,
545 jiffies + msecs_to_jiffies(1000 * timeout));
545 /* Set up heart beat (HB) timer */ 546 /* Set up heart beat (HB) timer */
546 mod_timer(&phba->hb_tmofunc, jiffies + HZ * LPFC_HB_MBOX_INTERVAL); 547 mod_timer(&phba->hb_tmofunc,
548 jiffies + msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL));
547 phba->hb_outstanding = 0; 549 phba->hb_outstanding = 0;
548 phba->last_completion_time = jiffies; 550 phba->last_completion_time = jiffies;
549 /* Set up error attention (ERATT) polling timer */ 551 /* Set up error attention (ERATT) polling timer */
550 mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL); 552 mod_timer(&phba->eratt_poll,
553 jiffies + msecs_to_jiffies(1000 * LPFC_ERATT_POLL_INTERVAL));
551 554
552 if (phba->hba_flag & LINK_DISABLED) { 555 if (phba->hba_flag & LINK_DISABLED) {
553 lpfc_printf_log(phba, 556 lpfc_printf_log(phba,
@@ -1021,7 +1024,8 @@ lpfc_hb_mbox_cmpl(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq)
1021 !(phba->link_state == LPFC_HBA_ERROR) && 1024 !(phba->link_state == LPFC_HBA_ERROR) &&
1022 !(phba->pport->load_flag & FC_UNLOADING)) 1025 !(phba->pport->load_flag & FC_UNLOADING))
1023 mod_timer(&phba->hb_tmofunc, 1026 mod_timer(&phba->hb_tmofunc,
1024 jiffies + HZ * LPFC_HB_MBOX_INTERVAL); 1027 jiffies +
1028 msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL));
1025 return; 1029 return;
1026} 1030}
1027 1031
@@ -1064,15 +1068,18 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
1064 1068
1065 spin_lock_irq(&phba->pport->work_port_lock); 1069 spin_lock_irq(&phba->pport->work_port_lock);
1066 1070
1067 if (time_after(phba->last_completion_time + LPFC_HB_MBOX_INTERVAL * HZ, 1071 if (time_after(phba->last_completion_time +
1068 jiffies)) { 1072 msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL),
1073 jiffies)) {
1069 spin_unlock_irq(&phba->pport->work_port_lock); 1074 spin_unlock_irq(&phba->pport->work_port_lock);
1070 if (!phba->hb_outstanding) 1075 if (!phba->hb_outstanding)
1071 mod_timer(&phba->hb_tmofunc, 1076 mod_timer(&phba->hb_tmofunc,
1072 jiffies + HZ * LPFC_HB_MBOX_INTERVAL); 1077 jiffies +
1078 msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL));
1073 else 1079 else
1074 mod_timer(&phba->hb_tmofunc, 1080 mod_timer(&phba->hb_tmofunc,
1075 jiffies + HZ * LPFC_HB_MBOX_TIMEOUT); 1081 jiffies +
1082 msecs_to_jiffies(1000 * LPFC_HB_MBOX_TIMEOUT));
1076 return; 1083 return;
1077 } 1084 }
1078 spin_unlock_irq(&phba->pport->work_port_lock); 1085 spin_unlock_irq(&phba->pport->work_port_lock);
@@ -1104,7 +1111,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
1104 if (!pmboxq) { 1111 if (!pmboxq) {
1105 mod_timer(&phba->hb_tmofunc, 1112 mod_timer(&phba->hb_tmofunc,
1106 jiffies + 1113 jiffies +
1107 HZ * LPFC_HB_MBOX_INTERVAL); 1114 msecs_to_jiffies(1000 *
1115 LPFC_HB_MBOX_INTERVAL));
1108 return; 1116 return;
1109 } 1117 }
1110 1118
@@ -1120,7 +1128,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
1120 phba->mbox_mem_pool); 1128 phba->mbox_mem_pool);
1121 mod_timer(&phba->hb_tmofunc, 1129 mod_timer(&phba->hb_tmofunc,
1122 jiffies + 1130 jiffies +
1123 HZ * LPFC_HB_MBOX_INTERVAL); 1131 msecs_to_jiffies(1000 *
1132 LPFC_HB_MBOX_INTERVAL));
1124 return; 1133 return;
1125 } 1134 }
1126 phba->skipped_hb = 0; 1135 phba->skipped_hb = 0;
@@ -1136,7 +1145,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
1136 phba->skipped_hb = jiffies; 1145 phba->skipped_hb = jiffies;
1137 1146
1138 mod_timer(&phba->hb_tmofunc, 1147 mod_timer(&phba->hb_tmofunc,
1139 jiffies + HZ * LPFC_HB_MBOX_TIMEOUT); 1148 jiffies +
1149 msecs_to_jiffies(1000 * LPFC_HB_MBOX_TIMEOUT));
1140 return; 1150 return;
1141 } else { 1151 } else {
1142 /* 1152 /*
@@ -1150,7 +1160,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
1150 jiffies_to_msecs(jiffies 1160 jiffies_to_msecs(jiffies
1151 - phba->last_completion_time)); 1161 - phba->last_completion_time));
1152 mod_timer(&phba->hb_tmofunc, 1162 mod_timer(&phba->hb_tmofunc,
1153 jiffies + HZ * LPFC_HB_MBOX_TIMEOUT); 1163 jiffies +
1164 msecs_to_jiffies(1000 * LPFC_HB_MBOX_TIMEOUT));
1154 } 1165 }
1155 } 1166 }
1156} 1167}
@@ -3207,14 +3218,15 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
3207 stat = 1; 3218 stat = 1;
3208 goto finished; 3219 goto finished;
3209 } 3220 }
3210 if (time >= 30 * HZ) { 3221 if (time >= msecs_to_jiffies(30 * 1000)) {
3211 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 3222 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
3212 "0461 Scanning longer than 30 " 3223 "0461 Scanning longer than 30 "
3213 "seconds. Continuing initialization\n"); 3224 "seconds. Continuing initialization\n");
3214 stat = 1; 3225 stat = 1;
3215 goto finished; 3226 goto finished;
3216 } 3227 }
3217 if (time >= 15 * HZ && phba->link_state <= LPFC_LINK_DOWN) { 3228 if (time >= msecs_to_jiffies(15 * 1000) &&
3229 phba->link_state <= LPFC_LINK_DOWN) {
3218 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 3230 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
3219 "0465 Link down longer than 15 " 3231 "0465 Link down longer than 15 "
3220 "seconds. Continuing initialization\n"); 3232 "seconds. Continuing initialization\n");
@@ -3226,7 +3238,7 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
3226 goto finished; 3238 goto finished;
3227 if (vport->num_disc_nodes || vport->fc_prli_sent) 3239 if (vport->num_disc_nodes || vport->fc_prli_sent)
3228 goto finished; 3240 goto finished;
3229 if (vport->fc_map_cnt == 0 && time < 2 * HZ) 3241 if (vport->fc_map_cnt == 0 && time < msecs_to_jiffies(2 * 1000))
3230 goto finished; 3242 goto finished;
3231 if ((phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE) != 0) 3243 if ((phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE) != 0)
3232 goto finished; 3244 goto finished;
@@ -4225,7 +4237,8 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba,
4225 * If there are other active VLinks present, 4237 * If there are other active VLinks present,
4226 * re-instantiate the Vlink using FDISC. 4238 * re-instantiate the Vlink using FDISC.
4227 */ 4239 */
4228 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ); 4240 mod_timer(&ndlp->nlp_delayfunc,
4241 jiffies + msecs_to_jiffies(1000));
4229 shost = lpfc_shost_from_vport(vport); 4242 shost = lpfc_shost_from_vport(vport);
4230 spin_lock_irq(shost->host_lock); 4243 spin_lock_irq(shost->host_lock);
4231 ndlp->nlp_flag |= NLP_DELAY_TMO; 4244 ndlp->nlp_flag |= NLP_DELAY_TMO;