diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2010-05-28 18:08:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:01:28 -0400 |
commit | 5b91490e457a88080b4dbc68f4bc2eadd65e30ea (patch) | |
tree | 89dc6f1a9d735dea076ff00102a315d4e3c1e756 /drivers/scsi/qla2xxx/qla_init.c | |
parent | 6c7ccf7bb96a0ae16d2bcc6155e1d1fc3e728b39 (diff) |
[SCSI] qla2xxx: For ISP 23xx, select user specified login timeout value if greater than minuimum value(4 secs).
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 4c6caccc6ad5..d0b993c8a189 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -121,7 +121,23 @@ done: | |||
121 | 121 | ||
122 | /* Asynchronous Login/Logout Routines -------------------------------------- */ | 122 | /* Asynchronous Login/Logout Routines -------------------------------------- */ |
123 | 123 | ||
124 | #define ELS_TMO_2_RATOV(ha) ((ha)->r_a_tov / 10 * 2) | 124 | static inline unsigned long |
125 | qla2x00_get_async_timeout(struct scsi_qla_host *vha) | ||
126 | { | ||
127 | unsigned long tmo; | ||
128 | struct qla_hw_data *ha = vha->hw; | ||
129 | |||
130 | /* Firmware should use switch negotiated r_a_tov for timeout. */ | ||
131 | tmo = ha->r_a_tov / 10 * 2; | ||
132 | if (!IS_FWI2_CAPABLE(ha)) { | ||
133 | /* | ||
134 | * Except for earlier ISPs where the timeout is seeded from the | ||
135 | * initialization control block. | ||
136 | */ | ||
137 | tmo = ha->login_timeout; | ||
138 | } | ||
139 | return tmo; | ||
140 | } | ||
125 | 141 | ||
126 | static void | 142 | static void |
127 | qla2x00_async_iocb_timeout(srb_t *sp) | 143 | qla2x00_async_iocb_timeout(srb_t *sp) |
@@ -163,7 +179,6 @@ int | |||
163 | qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, | 179 | qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, |
164 | uint16_t *data) | 180 | uint16_t *data) |
165 | { | 181 | { |
166 | struct qla_hw_data *ha = vha->hw; | ||
167 | srb_t *sp; | 182 | srb_t *sp; |
168 | struct srb_ctx *ctx; | 183 | struct srb_ctx *ctx; |
169 | struct srb_iocb *lio; | 184 | struct srb_iocb *lio; |
@@ -171,7 +186,7 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
171 | 186 | ||
172 | rval = QLA_FUNCTION_FAILED; | 187 | rval = QLA_FUNCTION_FAILED; |
173 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), | 188 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), |
174 | ELS_TMO_2_RATOV(ha) + 2); | 189 | qla2x00_get_async_timeout(vha) + 2); |
175 | if (!sp) | 190 | if (!sp) |
176 | goto done; | 191 | goto done; |
177 | 192 | ||
@@ -215,7 +230,6 @@ qla2x00_async_logout_ctx_done(srb_t *sp) | |||
215 | int | 230 | int |
216 | qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) | 231 | qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) |
217 | { | 232 | { |
218 | struct qla_hw_data *ha = vha->hw; | ||
219 | srb_t *sp; | 233 | srb_t *sp; |
220 | struct srb_ctx *ctx; | 234 | struct srb_ctx *ctx; |
221 | struct srb_iocb *lio; | 235 | struct srb_iocb *lio; |
@@ -223,7 +237,7 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
223 | 237 | ||
224 | rval = QLA_FUNCTION_FAILED; | 238 | rval = QLA_FUNCTION_FAILED; |
225 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), | 239 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), |
226 | ELS_TMO_2_RATOV(ha) + 2); | 240 | qla2x00_get_async_timeout(vha) + 2); |
227 | if (!sp) | 241 | if (!sp) |
228 | goto done; | 242 | goto done; |
229 | 243 | ||
@@ -264,7 +278,6 @@ int | |||
264 | qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, | 278 | qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, |
265 | uint16_t *data) | 279 | uint16_t *data) |
266 | { | 280 | { |
267 | struct qla_hw_data *ha = vha->hw; | ||
268 | srb_t *sp; | 281 | srb_t *sp; |
269 | struct srb_ctx *ctx; | 282 | struct srb_ctx *ctx; |
270 | struct srb_iocb *lio; | 283 | struct srb_iocb *lio; |
@@ -272,7 +285,7 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
272 | 285 | ||
273 | rval = QLA_FUNCTION_FAILED; | 286 | rval = QLA_FUNCTION_FAILED; |
274 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), | 287 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), |
275 | ELS_TMO_2_RATOV(ha) + 2); | 288 | qla2x00_get_async_timeout(vha) + 2); |
276 | if (!sp) | 289 | if (!sp) |
277 | goto done; | 290 | goto done; |
278 | 291 | ||
@@ -316,7 +329,6 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, | |||
316 | uint32_t tag) | 329 | uint32_t tag) |
317 | { | 330 | { |
318 | struct scsi_qla_host *vha = fcport->vha; | 331 | struct scsi_qla_host *vha = fcport->vha; |
319 | struct qla_hw_data *ha = vha->hw; | ||
320 | srb_t *sp; | 332 | srb_t *sp; |
321 | struct srb_ctx *ctx; | 333 | struct srb_ctx *ctx; |
322 | struct srb_iocb *tcf; | 334 | struct srb_iocb *tcf; |
@@ -324,7 +336,7 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, | |||
324 | 336 | ||
325 | rval = QLA_FUNCTION_FAILED; | 337 | rval = QLA_FUNCTION_FAILED; |
326 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), | 338 | sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), |
327 | ELS_TMO_2_RATOV(ha) + 2); | 339 | qla2x00_get_async_timeout(vha) + 2); |
328 | if (!sp) | 340 | if (!sp) |
329 | goto done; | 341 | goto done; |
330 | 342 | ||
@@ -2409,7 +2421,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha) | |||
2409 | ha->retry_count = nv->retry_count; | 2421 | ha->retry_count = nv->retry_count; |
2410 | 2422 | ||
2411 | /* Set minimum login_timeout to 4 seconds. */ | 2423 | /* Set minimum login_timeout to 4 seconds. */ |
2412 | if (nv->login_timeout < ql2xlogintimeout) | 2424 | if (nv->login_timeout != ql2xlogintimeout) |
2413 | nv->login_timeout = ql2xlogintimeout; | 2425 | nv->login_timeout = ql2xlogintimeout; |
2414 | if (nv->login_timeout < 4) | 2426 | if (nv->login_timeout < 4) |
2415 | nv->login_timeout = 4; | 2427 | nv->login_timeout = 4; |