Commit c1c16bd51a29eea8843f20161ddd32cddc524142

Authored by Bhanu Prakash Gollapudi
Committed by James Bottomley
1 parent 8a5badf1ea

[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>

Showing 2 changed files with 18 additions and 14 deletions Side-by-side Diff

drivers/scsi/bnx2fc/bnx2fc_els.c
... ... @@ -391,18 +391,6 @@
391 391 BNX2FC_IO_DBG(rec_req, "rec_compl: orig xid = 0x%x", orig_io_req->xid);
392 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 394 /* Handle REC timeout case */
407 395 if (test_and_clear_bit(BNX2FC_FLAG_ELS_TIMEOUT, &rec_req->req_flags)) {
408 396 BNX2FC_IO_DBG(rec_req, "timed out, abort "
... ... @@ -433,6 +421,20 @@
433 421 }
434 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 438 mp_req = &(rec_req->mp_req);
437 439 fc_hdr = &(mp_req->resp_fc_hdr);
438 440 resp_len = mp_req->resp_len;
drivers/scsi/bnx2fc/bnx2fc_hwi.c
... ... @@ -1743,11 +1743,13 @@
1743 1743 /* Init state to NORMAL */
1744 1744 task->txwr_rxrd.const_ctx.init_flags |= task_type <<
1745 1745 FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT;
1746   - if (dev_type == TYPE_TAPE)
  1746 + if (dev_type == TYPE_TAPE) {
1747 1747 task->txwr_rxrd.const_ctx.init_flags |=
1748 1748 FCOE_TASK_DEV_TYPE_TAPE <<
1749 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 1753 task->txwr_rxrd.const_ctx.init_flags |=
1752 1754 FCOE_TASK_DEV_TYPE_DISK <<
1753 1755 FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT;