diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2018-03-20 17:36:14 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-04-09 21:04:36 -0400 |
commit | e74e7d95878d7993cf56c801d55d78f16ea58d1d (patch) | |
tree | 67ee854ff12dd8a2f4d6b24c84312902fa86ea4d | |
parent | 3a9910d7b686546dcc9986e790af17e148f1c888 (diff) |
scsi: qla2xxx: Fix race condition between iocb timeout and initialisation
qla2x00_init_timer() calls add_timer() on the iocb timeout timer, which
means the timeout function pointer and any data that the function depends on
must be initialised beforehand.
Move this initialisation before each call to qla2x00_init_timer(). In some
cases qla2x00_init_timer() initialises a completion structure needed by the
timeout function, so move the call to add_timer() after that.
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gs.c | 12 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 37 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_inline.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mr.c | 5 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 2 |
8 files changed, 45 insertions, 31 deletions
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 2288757b5c9e..9e914f9c3ffb 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c | |||
@@ -3794,6 +3794,7 @@ int qla24xx_async_gffid(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
3794 | sp->gen1 = fcport->rscn_gen; | 3794 | sp->gen1 = fcport->rscn_gen; |
3795 | sp->gen2 = fcport->login_gen; | 3795 | sp->gen2 = fcport->login_gen; |
3796 | 3796 | ||
3797 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
3797 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 3798 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
3798 | 3799 | ||
3799 | /* CT_IU preamble */ | 3800 | /* CT_IU preamble */ |
@@ -3812,7 +3813,6 @@ int qla24xx_async_gffid(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
3812 | sp->u.iocb_cmd.u.ctarg.rsp_size = GFF_ID_RSP_SIZE; | 3813 | sp->u.iocb_cmd.u.ctarg.rsp_size = GFF_ID_RSP_SIZE; |
3813 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; | 3814 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; |
3814 | 3815 | ||
3815 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
3816 | sp->done = qla24xx_async_gffid_sp_done; | 3816 | sp->done = qla24xx_async_gffid_sp_done; |
3817 | 3817 | ||
3818 | rval = qla2x00_start_sp(sp); | 3818 | rval = qla2x00_start_sp(sp); |
@@ -4230,6 +4230,8 @@ static int qla24xx_async_gnnft(scsi_qla_host_t *vha, struct srb *sp, | |||
4230 | sp->name = "gnnft"; | 4230 | sp->name = "gnnft"; |
4231 | sp->gen1 = vha->hw->base_qpair->chip_reset; | 4231 | sp->gen1 = vha->hw->base_qpair->chip_reset; |
4232 | sp->gen2 = fc4_type; | 4232 | sp->gen2 = fc4_type; |
4233 | |||
4234 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4233 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 4235 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
4234 | 4236 | ||
4235 | memset(sp->u.iocb_cmd.u.ctarg.rsp, 0, sp->u.iocb_cmd.u.ctarg.rsp_size); | 4237 | memset(sp->u.iocb_cmd.u.ctarg.rsp, 0, sp->u.iocb_cmd.u.ctarg.rsp_size); |
@@ -4246,7 +4248,6 @@ static int qla24xx_async_gnnft(scsi_qla_host_t *vha, struct srb *sp, | |||
4246 | sp->u.iocb_cmd.u.ctarg.req_size = GNN_FT_REQ_SIZE; | 4248 | sp->u.iocb_cmd.u.ctarg.req_size = GNN_FT_REQ_SIZE; |
4247 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; | 4249 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; |
4248 | 4250 | ||
4249 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4250 | sp->done = qla2x00_async_gpnft_gnnft_sp_done; | 4251 | sp->done = qla2x00_async_gpnft_gnnft_sp_done; |
4251 | 4252 | ||
4252 | rval = qla2x00_start_sp(sp); | 4253 | rval = qla2x00_start_sp(sp); |
@@ -4370,6 +4371,8 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp) | |||
4370 | sp->name = "gpnft"; | 4371 | sp->name = "gpnft"; |
4371 | sp->gen1 = vha->hw->base_qpair->chip_reset; | 4372 | sp->gen1 = vha->hw->base_qpair->chip_reset; |
4372 | sp->gen2 = fc4_type; | 4373 | sp->gen2 = fc4_type; |
4374 | |||
4375 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4373 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 4376 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
4374 | 4377 | ||
4375 | rspsz = sizeof(struct ct_sns_gpnft_rsp) + | 4378 | rspsz = sizeof(struct ct_sns_gpnft_rsp) + |
@@ -4385,7 +4388,6 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp) | |||
4385 | 4388 | ||
4386 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; | 4389 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; |
4387 | 4390 | ||
4388 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4389 | sp->done = qla2x00_async_gpnft_gnnft_sp_done; | 4391 | sp->done = qla2x00_async_gpnft_gnnft_sp_done; |
4390 | 4392 | ||
4391 | rval = qla2x00_start_sp(sp); | 4393 | rval = qla2x00_start_sp(sp); |
@@ -4495,6 +4497,7 @@ int qla24xx_async_gnnid(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
4495 | sp->gen1 = fcport->rscn_gen; | 4497 | sp->gen1 = fcport->rscn_gen; |
4496 | sp->gen2 = fcport->login_gen; | 4498 | sp->gen2 = fcport->login_gen; |
4497 | 4499 | ||
4500 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4498 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 4501 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
4499 | 4502 | ||
4500 | /* CT_IU preamble */ | 4503 | /* CT_IU preamble */ |
@@ -4516,7 +4519,6 @@ int qla24xx_async_gnnid(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
4516 | sp->u.iocb_cmd.u.ctarg.rsp_size = GNN_ID_RSP_SIZE; | 4519 | sp->u.iocb_cmd.u.ctarg.rsp_size = GNN_ID_RSP_SIZE; |
4517 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; | 4520 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; |
4518 | 4521 | ||
4519 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4520 | sp->done = qla2x00_async_gnnid_sp_done; | 4522 | sp->done = qla2x00_async_gnnid_sp_done; |
4521 | 4523 | ||
4522 | rval = qla2x00_start_sp(sp); | 4524 | rval = qla2x00_start_sp(sp); |
@@ -4632,6 +4634,7 @@ int qla24xx_async_gfpnid(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
4632 | sp->gen1 = fcport->rscn_gen; | 4634 | sp->gen1 = fcport->rscn_gen; |
4633 | sp->gen2 = fcport->login_gen; | 4635 | sp->gen2 = fcport->login_gen; |
4634 | 4636 | ||
4637 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4635 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 4638 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
4636 | 4639 | ||
4637 | /* CT_IU preamble */ | 4640 | /* CT_IU preamble */ |
@@ -4653,7 +4656,6 @@ int qla24xx_async_gfpnid(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
4653 | sp->u.iocb_cmd.u.ctarg.rsp_size = GFPN_ID_RSP_SIZE; | 4656 | sp->u.iocb_cmd.u.ctarg.rsp_size = GFPN_ID_RSP_SIZE; |
4654 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; | 4657 | sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; |
4655 | 4658 | ||
4656 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
4657 | sp->done = qla2x00_async_gfpnid_sp_done; | 4659 | sp->done = qla2x00_async_gfpnid_sp_done; |
4658 | 4660 | ||
4659 | rval = qla2x00_start_sp(sp); | 4661 | rval = qla2x00_start_sp(sp); |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a568266a44bf..8f55dd44adae 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -183,10 +183,11 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
183 | sp->name = "login"; | 183 | sp->name = "login"; |
184 | sp->gen1 = fcport->rscn_gen; | 184 | sp->gen1 = fcport->rscn_gen; |
185 | sp->gen2 = fcport->login_gen; | 185 | sp->gen2 = fcport->login_gen; |
186 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
187 | 186 | ||
188 | lio = &sp->u.iocb_cmd; | 187 | lio = &sp->u.iocb_cmd; |
189 | lio->timeout = qla2x00_async_iocb_timeout; | 188 | lio->timeout = qla2x00_async_iocb_timeout; |
189 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
190 | |||
190 | sp->done = qla2x00_async_login_sp_done; | 191 | sp->done = qla2x00_async_login_sp_done; |
191 | lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; | 192 | lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; |
192 | 193 | ||
@@ -245,10 +246,11 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
245 | 246 | ||
246 | sp->type = SRB_LOGOUT_CMD; | 247 | sp->type = SRB_LOGOUT_CMD; |
247 | sp->name = "logout"; | 248 | sp->name = "logout"; |
248 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
249 | 249 | ||
250 | lio = &sp->u.iocb_cmd; | 250 | lio = &sp->u.iocb_cmd; |
251 | lio->timeout = qla2x00_async_iocb_timeout; | 251 | lio->timeout = qla2x00_async_iocb_timeout; |
252 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
253 | |||
252 | sp->done = qla2x00_async_logout_sp_done; | 254 | sp->done = qla2x00_async_logout_sp_done; |
253 | rval = qla2x00_start_sp(sp); | 255 | rval = qla2x00_start_sp(sp); |
254 | if (rval != QLA_SUCCESS) | 256 | if (rval != QLA_SUCCESS) |
@@ -307,10 +309,11 @@ qla2x00_async_prlo(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
307 | 309 | ||
308 | sp->type = SRB_PRLO_CMD; | 310 | sp->type = SRB_PRLO_CMD; |
309 | sp->name = "prlo"; | 311 | sp->name = "prlo"; |
310 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
311 | 312 | ||
312 | lio = &sp->u.iocb_cmd; | 313 | lio = &sp->u.iocb_cmd; |
313 | lio->timeout = qla2x00_async_iocb_timeout; | 314 | lio->timeout = qla2x00_async_iocb_timeout; |
315 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
316 | |||
314 | sp->done = qla2x00_async_prlo_sp_done; | 317 | sp->done = qla2x00_async_prlo_sp_done; |
315 | rval = qla2x00_start_sp(sp); | 318 | rval = qla2x00_start_sp(sp); |
316 | if (rval != QLA_SUCCESS) | 319 | if (rval != QLA_SUCCESS) |
@@ -412,10 +415,11 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
412 | 415 | ||
413 | sp->type = SRB_ADISC_CMD; | 416 | sp->type = SRB_ADISC_CMD; |
414 | sp->name = "adisc"; | 417 | sp->name = "adisc"; |
415 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
416 | 418 | ||
417 | lio = &sp->u.iocb_cmd; | 419 | lio = &sp->u.iocb_cmd; |
418 | lio->timeout = qla2x00_async_iocb_timeout; | 420 | lio->timeout = qla2x00_async_iocb_timeout; |
421 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
422 | |||
419 | sp->done = qla2x00_async_adisc_sp_done; | 423 | sp->done = qla2x00_async_adisc_sp_done; |
420 | if (data[1] & QLA_LOGIO_LOGIN_RETRIED) | 424 | if (data[1] & QLA_LOGIO_LOGIN_RETRIED) |
421 | lio->u.logio.flags |= SRB_LOGIN_RETRIED; | 425 | lio->u.logio.flags |= SRB_LOGIN_RETRIED; |
@@ -745,6 +749,8 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
745 | sp->gen1 = fcport->rscn_gen; | 749 | sp->gen1 = fcport->rscn_gen; |
746 | sp->gen2 = fcport->login_gen; | 750 | sp->gen2 = fcport->login_gen; |
747 | 751 | ||
752 | mbx = &sp->u.iocb_cmd; | ||
753 | mbx->timeout = qla2x00_async_iocb_timeout; | ||
748 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)+2); | 754 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)+2); |
749 | 755 | ||
750 | mb = sp->u.iocb_cmd.u.mbx.out_mb; | 756 | mb = sp->u.iocb_cmd.u.mbx.out_mb; |
@@ -757,9 +763,6 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
757 | mb[8] = vha->gnl.size; | 763 | mb[8] = vha->gnl.size; |
758 | mb[9] = vha->vp_idx; | 764 | mb[9] = vha->vp_idx; |
759 | 765 | ||
760 | mbx = &sp->u.iocb_cmd; | ||
761 | mbx->timeout = qla2x00_async_iocb_timeout; | ||
762 | |||
763 | sp->done = qla24xx_async_gnl_sp_done; | 766 | sp->done = qla24xx_async_gnl_sp_done; |
764 | 767 | ||
765 | rval = qla2x00_start_sp(sp); | 768 | rval = qla2x00_start_sp(sp); |
@@ -887,10 +890,11 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
887 | 890 | ||
888 | sp->type = SRB_PRLI_CMD; | 891 | sp->type = SRB_PRLI_CMD; |
889 | sp->name = "prli"; | 892 | sp->name = "prli"; |
890 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
891 | 893 | ||
892 | lio = &sp->u.iocb_cmd; | 894 | lio = &sp->u.iocb_cmd; |
893 | lio->timeout = qla2x00_async_iocb_timeout; | 895 | lio->timeout = qla2x00_async_iocb_timeout; |
896 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
897 | |||
894 | sp->done = qla2x00_async_prli_sp_done; | 898 | sp->done = qla2x00_async_prli_sp_done; |
895 | lio->u.logio.flags = 0; | 899 | lio->u.logio.flags = 0; |
896 | 900 | ||
@@ -955,6 +959,9 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) | |||
955 | sp->name = "gpdb"; | 959 | sp->name = "gpdb"; |
956 | sp->gen1 = fcport->rscn_gen; | 960 | sp->gen1 = fcport->rscn_gen; |
957 | sp->gen2 = fcport->login_gen; | 961 | sp->gen2 = fcport->login_gen; |
962 | |||
963 | mbx = &sp->u.iocb_cmd; | ||
964 | mbx->timeout = qla2x00_async_iocb_timeout; | ||
958 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 965 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
959 | 966 | ||
960 | pd = dma_pool_zalloc(ha->s_dma_pool, GFP_KERNEL, &pd_dma); | 967 | pd = dma_pool_zalloc(ha->s_dma_pool, GFP_KERNEL, &pd_dma); |
@@ -974,8 +981,6 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) | |||
974 | mb[9] = vha->vp_idx; | 981 | mb[9] = vha->vp_idx; |
975 | mb[10] = opt; | 982 | mb[10] = opt; |
976 | 983 | ||
977 | mbx = &sp->u.iocb_cmd; | ||
978 | mbx->timeout = qla2x00_async_iocb_timeout; | ||
979 | mbx->u.mbx.in = (void *)pd; | 984 | mbx->u.mbx.in = (void *)pd; |
980 | mbx->u.mbx.in_dma = pd_dma; | 985 | mbx->u.mbx.in_dma = pd_dma; |
981 | 986 | ||
@@ -1490,13 +1495,15 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, | |||
1490 | tm_iocb = &sp->u.iocb_cmd; | 1495 | tm_iocb = &sp->u.iocb_cmd; |
1491 | sp->type = SRB_TM_CMD; | 1496 | sp->type = SRB_TM_CMD; |
1492 | sp->name = "tmf"; | 1497 | sp->name = "tmf"; |
1498 | |||
1499 | tm_iocb->timeout = qla2x00_tmf_iocb_timeout; | ||
1500 | init_completion(&tm_iocb->u.tmf.comp); | ||
1493 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); | 1501 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); |
1502 | |||
1494 | tm_iocb->u.tmf.flags = flags; | 1503 | tm_iocb->u.tmf.flags = flags; |
1495 | tm_iocb->u.tmf.lun = lun; | 1504 | tm_iocb->u.tmf.lun = lun; |
1496 | tm_iocb->u.tmf.data = tag; | 1505 | tm_iocb->u.tmf.data = tag; |
1497 | sp->done = qla2x00_tmf_sp_done; | 1506 | sp->done = qla2x00_tmf_sp_done; |
1498 | tm_iocb->timeout = qla2x00_tmf_iocb_timeout; | ||
1499 | init_completion(&tm_iocb->u.tmf.comp); | ||
1500 | 1507 | ||
1501 | rval = qla2x00_start_sp(sp); | 1508 | rval = qla2x00_start_sp(sp); |
1502 | if (rval != QLA_SUCCESS) | 1509 | if (rval != QLA_SUCCESS) |
@@ -1570,7 +1577,11 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp) | |||
1570 | abt_iocb = &sp->u.iocb_cmd; | 1577 | abt_iocb = &sp->u.iocb_cmd; |
1571 | sp->type = SRB_ABT_CMD; | 1578 | sp->type = SRB_ABT_CMD; |
1572 | sp->name = "abort"; | 1579 | sp->name = "abort"; |
1580 | |||
1581 | abt_iocb->timeout = qla24xx_abort_iocb_timeout; | ||
1582 | init_completion(&abt_iocb->u.abt.comp); | ||
1573 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); | 1583 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); |
1584 | |||
1574 | abt_iocb->u.abt.cmd_hndl = cmd_sp->handle; | 1585 | abt_iocb->u.abt.cmd_hndl = cmd_sp->handle; |
1575 | 1586 | ||
1576 | if (vha->flags.qpairs_available && cmd_sp->qpair) | 1587 | if (vha->flags.qpairs_available && cmd_sp->qpair) |
@@ -1580,8 +1591,6 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp) | |||
1580 | abt_iocb->u.abt.req_que_no = cpu_to_le16(vha->req->id); | 1591 | abt_iocb->u.abt.req_que_no = cpu_to_le16(vha->req->id); |
1581 | 1592 | ||
1582 | sp->done = qla24xx_abort_sp_done; | 1593 | sp->done = qla24xx_abort_sp_done; |
1583 | abt_iocb->timeout = qla24xx_abort_iocb_timeout; | ||
1584 | init_completion(&abt_iocb->u.abt.comp); | ||
1585 | 1594 | ||
1586 | rval = qla2x00_start_sp(sp); | 1595 | rval = qla2x00_start_sp(sp); |
1587 | if (rval != QLA_SUCCESS) | 1596 | if (rval != QLA_SUCCESS) |
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index b7a05aebf065..37ae0f6d8ae5 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h | |||
@@ -272,13 +272,13 @@ qla2x00_init_timer(srb_t *sp, unsigned long tmo) | |||
272 | { | 272 | { |
273 | timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0); | 273 | timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0); |
274 | sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ; | 274 | sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ; |
275 | add_timer(&sp->u.iocb_cmd.timer); | ||
276 | sp->free = qla2x00_sp_free; | 275 | sp->free = qla2x00_sp_free; |
277 | init_completion(&sp->comp); | 276 | init_completion(&sp->comp); |
278 | if (IS_QLAFX00(sp->vha->hw) && (sp->type == SRB_FXIOCB_DCMD)) | 277 | if (IS_QLAFX00(sp->vha->hw) && (sp->type == SRB_FXIOCB_DCMD)) |
279 | init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp); | 278 | init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp); |
280 | if (sp->type == SRB_ELS_DCMD) | 279 | if (sp->type == SRB_ELS_DCMD) |
281 | init_completion(&sp->u.iocb_cmd.u.els_logo.comp); | 280 | init_completion(&sp->u.iocb_cmd.u.els_logo.comp); |
281 | add_timer(&sp->u.iocb_cmd.timer); | ||
282 | } | 282 | } |
283 | 283 | ||
284 | static inline int | 284 | static inline int |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index f74ff7b550b6..a91cca52b5d5 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -2460,8 +2460,8 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, | |||
2460 | sp->type = SRB_ELS_DCMD; | 2460 | sp->type = SRB_ELS_DCMD; |
2461 | sp->name = "ELS_DCMD"; | 2461 | sp->name = "ELS_DCMD"; |
2462 | sp->fcport = fcport; | 2462 | sp->fcport = fcport; |
2463 | qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); | ||
2464 | elsio->timeout = qla2x00_els_dcmd_iocb_timeout; | 2463 | elsio->timeout = qla2x00_els_dcmd_iocb_timeout; |
2464 | qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); | ||
2465 | sp->done = qla2x00_els_dcmd_sp_done; | 2465 | sp->done = qla2x00_els_dcmd_sp_done; |
2466 | sp->free = qla2x00_els_dcmd_sp_free; | 2466 | sp->free = qla2x00_els_dcmd_sp_free; |
2467 | 2467 | ||
@@ -2658,8 +2658,11 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, | |||
2658 | sp->type = SRB_ELS_DCMD; | 2658 | sp->type = SRB_ELS_DCMD; |
2659 | sp->name = "ELS_DCMD"; | 2659 | sp->name = "ELS_DCMD"; |
2660 | sp->fcport = fcport; | 2660 | sp->fcport = fcport; |
2661 | qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); | 2661 | |
2662 | elsio->timeout = qla2x00_els_dcmd2_iocb_timeout; | 2662 | elsio->timeout = qla2x00_els_dcmd2_iocb_timeout; |
2663 | init_completion(&elsio->u.els_plogi.comp); | ||
2664 | qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); | ||
2665 | |||
2663 | sp->done = qla2x00_els_dcmd2_sp_done; | 2666 | sp->done = qla2x00_els_dcmd2_sp_done; |
2664 | sp->free = qla2x00_els_dcmd2_sp_free; | 2667 | sp->free = qla2x00_els_dcmd2_sp_free; |
2665 | 2668 | ||
@@ -2696,7 +2699,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, | |||
2696 | ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x0109, | 2699 | ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x0109, |
2697 | (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, 0x70); | 2700 | (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, 0x70); |
2698 | 2701 | ||
2699 | init_completion(&elsio->u.els_plogi.comp); | ||
2700 | rval = qla2x00_start_sp(sp); | 2702 | rval = qla2x00_start_sp(sp); |
2701 | if (rval != QLA_SUCCESS) { | 2703 | if (rval != QLA_SUCCESS) { |
2702 | rval = QLA_FUNCTION_FAILED; | 2704 | rval = QLA_FUNCTION_FAILED; |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 5db0262d5c94..d8a36c13aeda 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -6023,14 +6023,14 @@ int qla24xx_send_mb_cmd(struct scsi_qla_host *vha, mbx_cmd_t *mcp) | |||
6023 | sp->type = SRB_MB_IOCB; | 6023 | sp->type = SRB_MB_IOCB; |
6024 | sp->name = mb_to_str(mcp->mb[0]); | 6024 | sp->name = mb_to_str(mcp->mb[0]); |
6025 | 6025 | ||
6026 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
6027 | |||
6028 | memcpy(sp->u.iocb_cmd.u.mbx.out_mb, mcp->mb, SIZEOF_IOCB_MB_REG); | ||
6029 | |||
6030 | c = &sp->u.iocb_cmd; | 6026 | c = &sp->u.iocb_cmd; |
6031 | c->timeout = qla2x00_async_iocb_timeout; | 6027 | c->timeout = qla2x00_async_iocb_timeout; |
6032 | init_completion(&c->u.mbx.comp); | 6028 | init_completion(&c->u.mbx.comp); |
6033 | 6029 | ||
6030 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
6031 | |||
6032 | memcpy(sp->u.iocb_cmd.u.mbx.out_mb, mcp->mb, SIZEOF_IOCB_MB_REG); | ||
6033 | |||
6034 | sp->done = qla2x00_async_mb_sp_done; | 6034 | sp->done = qla2x00_async_mb_sp_done; |
6035 | 6035 | ||
6036 | rval = qla2x00_start_sp(sp); | 6036 | rval = qla2x00_start_sp(sp); |
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index da85cd89639f..f6f0a759a7c2 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -929,8 +929,8 @@ int qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) | |||
929 | sp->type = SRB_CTRL_VP; | 929 | sp->type = SRB_CTRL_VP; |
930 | sp->name = "ctrl_vp"; | 930 | sp->name = "ctrl_vp"; |
931 | sp->done = qla_ctrlvp_sp_done; | 931 | sp->done = qla_ctrlvp_sp_done; |
932 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
933 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | 932 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; |
933 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | ||
934 | sp->u.iocb_cmd.u.ctrlvp.cmd = cmd; | 934 | sp->u.iocb_cmd.u.ctrlvp.cmd = cmd; |
935 | sp->u.iocb_cmd.u.ctrlvp.vp_index = vp_index; | 935 | sp->u.iocb_cmd.u.ctrlvp.vp_index = vp_index; |
936 | 936 | ||
diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index 7113acf42ff3..521a51370554 100644 --- a/drivers/scsi/qla2xxx/qla_mr.c +++ b/drivers/scsi/qla2xxx/qla_mr.c | |||
@@ -1821,9 +1821,11 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type) | |||
1821 | 1821 | ||
1822 | sp->type = SRB_FXIOCB_DCMD; | 1822 | sp->type = SRB_FXIOCB_DCMD; |
1823 | sp->name = "fxdisc"; | 1823 | sp->name = "fxdisc"; |
1824 | qla2x00_init_timer(sp, FXDISC_TIMEOUT); | ||
1825 | 1824 | ||
1826 | fdisc = &sp->u.iocb_cmd; | 1825 | fdisc = &sp->u.iocb_cmd; |
1826 | fdisc->timeout = qla2x00_fxdisc_iocb_timeout; | ||
1827 | qla2x00_init_timer(sp, FXDISC_TIMEOUT); | ||
1828 | |||
1827 | switch (fx_type) { | 1829 | switch (fx_type) { |
1828 | case FXDISC_GET_CONFIG_INFO: | 1830 | case FXDISC_GET_CONFIG_INFO: |
1829 | fdisc->u.fxiocb.flags = | 1831 | fdisc->u.fxiocb.flags = |
@@ -1924,7 +1926,6 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type) | |||
1924 | goto done_unmap_req; | 1926 | goto done_unmap_req; |
1925 | } | 1927 | } |
1926 | 1928 | ||
1927 | fdisc->timeout = qla2x00_fxdisc_iocb_timeout; | ||
1928 | fdisc->u.fxiocb.req_func_type = cpu_to_le16(fx_type); | 1929 | fdisc->u.fxiocb.req_func_type = cpu_to_le16(fx_type); |
1929 | sp->done = qla2x00_fxdisc_sp_done; | 1930 | sp->done = qla2x00_fxdisc_sp_done; |
1930 | 1931 | ||
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 5546ac9c3d9d..025dc2d3f3de 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -664,10 +664,10 @@ int qla24xx_async_notify_ack(scsi_qla_host_t *vha, fc_port_t *fcport, | |||
664 | sp->type = type; | 664 | sp->type = type; |
665 | sp->name = "nack"; | 665 | sp->name = "nack"; |
666 | 666 | ||
667 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
667 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)+2); | 668 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)+2); |
668 | 669 | ||
669 | sp->u.iocb_cmd.u.nack.ntfy = ntfy; | 670 | sp->u.iocb_cmd.u.nack.ntfy = ntfy; |
670 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | ||
671 | sp->done = qla2x00_async_nack_sp_done; | 671 | sp->done = qla2x00_async_nack_sp_done; |
672 | 672 | ||
673 | rval = qla2x00_start_sp(sp); | 673 | rval = qla2x00_start_sp(sp); |