Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204089
b: refs/heads/master
c: 5b91490
h: refs/heads/master
i:
  204087: 8fe56a3
v: v3
  • Loading branch information
Andrew Vasquez authored and James Bottomley committed Jul 27, 2010
1 parent c383aba commit 00a1e6a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c7ccf7bb96a0ae16d2bcc6155e1d1fc3e728b39
refs/heads/master: 5b91490e457a88080b4dbc68f4bc2eadd65e30ea
32 changes: 22 additions & 10 deletions trunk/drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,23 @@ qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size,

/* Asynchronous Login/Logout Routines -------------------------------------- */

#define ELS_TMO_2_RATOV(ha) ((ha)->r_a_tov / 10 * 2)
static inline unsigned long
qla2x00_get_async_timeout(struct scsi_qla_host *vha)
{
unsigned long tmo;
struct qla_hw_data *ha = vha->hw;

/* Firmware should use switch negotiated r_a_tov for timeout. */
tmo = ha->r_a_tov / 10 * 2;
if (!IS_FWI2_CAPABLE(ha)) {
/*
* Except for earlier ISPs where the timeout is seeded from the
* initialization control block.
*/
tmo = ha->login_timeout;
}
return tmo;
}

static void
qla2x00_async_iocb_timeout(srb_t *sp)
Expand Down Expand Up @@ -163,15 +179,14 @@ int
qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,
uint16_t *data)
{
struct qla_hw_data *ha = vha->hw;
srb_t *sp;
struct srb_ctx *ctx;
struct srb_iocb *lio;
int rval;

rval = QLA_FUNCTION_FAILED;
sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
ELS_TMO_2_RATOV(ha) + 2);
qla2x00_get_async_timeout(vha) + 2);
if (!sp)
goto done;

Expand Down Expand Up @@ -215,15 +230,14 @@ qla2x00_async_logout_ctx_done(srb_t *sp)
int
qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport)
{
struct qla_hw_data *ha = vha->hw;
srb_t *sp;
struct srb_ctx *ctx;
struct srb_iocb *lio;
int rval;

rval = QLA_FUNCTION_FAILED;
sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
ELS_TMO_2_RATOV(ha) + 2);
qla2x00_get_async_timeout(vha) + 2);
if (!sp)
goto done;

Expand Down Expand Up @@ -264,15 +278,14 @@ int
qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport,
uint16_t *data)
{
struct qla_hw_data *ha = vha->hw;
srb_t *sp;
struct srb_ctx *ctx;
struct srb_iocb *lio;
int rval;

rval = QLA_FUNCTION_FAILED;
sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
ELS_TMO_2_RATOV(ha) + 2);
qla2x00_get_async_timeout(vha) + 2);
if (!sp)
goto done;

Expand Down Expand Up @@ -316,15 +329,14 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun,
uint32_t tag)
{
struct scsi_qla_host *vha = fcport->vha;
struct qla_hw_data *ha = vha->hw;
srb_t *sp;
struct srb_ctx *ctx;
struct srb_iocb *tcf;
int rval;

rval = QLA_FUNCTION_FAILED;
sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
ELS_TMO_2_RATOV(ha) + 2);
qla2x00_get_async_timeout(vha) + 2);
if (!sp)
goto done;

Expand Down Expand Up @@ -2409,7 +2421,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
ha->retry_count = nv->retry_count;

/* Set minimum login_timeout to 4 seconds. */
if (nv->login_timeout < ql2xlogintimeout)
if (nv->login_timeout != ql2xlogintimeout)
nv->login_timeout = ql2xlogintimeout;
if (nv->login_timeout < 4)
nv->login_timeout = 4;
Expand Down

0 comments on commit 00a1e6a

Please sign in to comment.