aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>2011-08-30 18:54:49 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-09-17 10:02:27 -0400
commitc1c16bd51a29eea8843f20161ddd32cddc524142 (patch)
tree9e92792aa4b93bb2f7ab4ac1b30ec6403d6f6014
parent8a5badf1ea10c726b9cc04e52f91395b1248e034 (diff)
[SCSI] bnx2fc: No abort issued for REC when it times out
ABTS was not issued for timed out REC, as REC completion handler exits out if the IO completed. Check for timed out REC and issue ABTS before proceeding with further processing in REC completion handler. Also, initialize rec_retry and srr_retry before starting the IO. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_els.c26
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_hwi.c6
2 files changed, 18 insertions, 14 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c
index d66dcbd0df1..fd382fe33f6 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_els.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_els.c
@@ -391,18 +391,6 @@ void bnx2fc_rec_compl(struct bnx2fc_els_cb_arg *cb_arg)
391 BNX2FC_IO_DBG(rec_req, "rec_compl: orig xid = 0x%x", orig_io_req->xid); 391 BNX2FC_IO_DBG(rec_req, "rec_compl: orig xid = 0x%x", orig_io_req->xid);
392 tgt = orig_io_req->tgt; 392 tgt = orig_io_req->tgt;
393 393
394 if (test_bit(BNX2FC_FLAG_IO_COMPL, &orig_io_req->req_flags)) {
395 BNX2FC_IO_DBG(rec_req, "completed"
396 "orig_io - 0x%x\n",
397 orig_io_req->xid);
398 goto rec_compl_done;
399 }
400 if (test_bit(BNX2FC_FLAG_ISSUE_ABTS, &orig_io_req->req_flags)) {
401 BNX2FC_IO_DBG(rec_req, "abts in prog "
402 "orig_io - 0x%x\n",
403 orig_io_req->xid);
404 goto rec_compl_done;
405 }
406 /* Handle REC timeout case */ 394 /* Handle REC timeout case */
407 if (test_and_clear_bit(BNX2FC_FLAG_ELS_TIMEOUT, &rec_req->req_flags)) { 395 if (test_and_clear_bit(BNX2FC_FLAG_ELS_TIMEOUT, &rec_req->req_flags)) {
408 BNX2FC_IO_DBG(rec_req, "timed out, abort " 396 BNX2FC_IO_DBG(rec_req, "timed out, abort "
@@ -433,6 +421,20 @@ void bnx2fc_rec_compl(struct bnx2fc_els_cb_arg *cb_arg)
433 } 421 }
434 goto rec_compl_done; 422 goto rec_compl_done;
435 } 423 }
424
425 if (test_bit(BNX2FC_FLAG_IO_COMPL, &orig_io_req->req_flags)) {
426 BNX2FC_IO_DBG(rec_req, "completed"
427 "orig_io - 0x%x\n",
428 orig_io_req->xid);
429 goto rec_compl_done;
430 }
431 if (test_bit(BNX2FC_FLAG_ISSUE_ABTS, &orig_io_req->req_flags)) {
432 BNX2FC_IO_DBG(rec_req, "abts in prog "
433 "orig_io - 0x%x\n",
434 orig_io_req->xid);
435 goto rec_compl_done;
436 }
437
436 mp_req = &(rec_req->mp_req); 438 mp_req = &(rec_req->mp_req);
437 fc_hdr = &(mp_req->resp_fc_hdr); 439 fc_hdr = &(mp_req->resp_fc_hdr);
438 resp_len = mp_req->resp_len; 440 resp_len = mp_req->resp_len;
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index b241f3d3336..1923a25cb6a 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -1743,11 +1743,13 @@ void bnx2fc_init_task(struct bnx2fc_cmd *io_req,
1743 /* Init state to NORMAL */ 1743 /* Init state to NORMAL */
1744 task->txwr_rxrd.const_ctx.init_flags |= task_type << 1744 task->txwr_rxrd.const_ctx.init_flags |= task_type <<
1745 FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT; 1745 FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT;
1746 if (dev_type == TYPE_TAPE) 1746 if (dev_type == TYPE_TAPE) {
1747 task->txwr_rxrd.const_ctx.init_flags |= 1747 task->txwr_rxrd.const_ctx.init_flags |=
1748 FCOE_TASK_DEV_TYPE_TAPE << 1748 FCOE_TASK_DEV_TYPE_TAPE <<
1749 FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; 1749 FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT;
1750 else 1750 io_req->rec_retry = 0;
1751 io_req->rec_retry = 0;
1752 } else
1751 task->txwr_rxrd.const_ctx.init_flags |= 1753 task->txwr_rxrd.const_ctx.init_flags |=
1752 FCOE_TASK_DEV_TYPE_DISK << 1754 FCOE_TASK_DEV_TYPE_DISK <<
1753 FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; 1755 FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT;