diff options
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_io.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_io.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 43258c3c90ae..4f7453b9e41e 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c | |||
@@ -810,8 +810,22 @@ retry_tmf: | |||
810 | spin_lock_bh(&tgt->tgt_lock); | 810 | spin_lock_bh(&tgt->tgt_lock); |
811 | 811 | ||
812 | io_req->wait_for_comp = 0; | 812 | io_req->wait_for_comp = 0; |
813 | if (!(test_bit(BNX2FC_FLAG_TM_COMPL, &io_req->req_flags))) | 813 | if (!(test_bit(BNX2FC_FLAG_TM_COMPL, &io_req->req_flags))) { |
814 | set_bit(BNX2FC_FLAG_TM_TIMEOUT, &io_req->req_flags); | 814 | set_bit(BNX2FC_FLAG_TM_TIMEOUT, &io_req->req_flags); |
815 | if (io_req->on_tmf_queue) { | ||
816 | list_del_init(&io_req->link); | ||
817 | io_req->on_tmf_queue = 0; | ||
818 | } | ||
819 | io_req->wait_for_comp = 1; | ||
820 | bnx2fc_initiate_cleanup(io_req); | ||
821 | spin_unlock_bh(&tgt->tgt_lock); | ||
822 | rc = wait_for_completion_timeout(&io_req->tm_done, | ||
823 | BNX2FC_FW_TIMEOUT); | ||
824 | spin_lock_bh(&tgt->tgt_lock); | ||
825 | io_req->wait_for_comp = 0; | ||
826 | if (!rc) | ||
827 | kref_put(&io_req->refcount, bnx2fc_cmd_release); | ||
828 | } | ||
815 | 829 | ||
816 | spin_unlock_bh(&tgt->tgt_lock); | 830 | spin_unlock_bh(&tgt->tgt_lock); |
817 | 831 | ||