aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2fc
diff options
context:
space:
mode:
authorEddie Wai <eddie.wai@broadcom.com>2013-09-18 01:33:10 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-10-25 04:58:02 -0400
commit21837896097a6d141c7ac581500ee648c5b4bb89 (patch)
tree9e85376452bfe06a11990e07d0055ccb818c7212 /drivers/scsi/bnx2fc
parent97c2730cb8f039705b17ef12b5a5ed9af6eeb460 (diff)
[SCSI] bnx2fc: Fixed a SCSI CMD cmpl race condition between ABTS and CLEANUP
In the case when a SCSI_CMD times out, bnx2fc will initiate the sending of the ABTS. However, if the SCSI layer's SCSI command timer also times out, it'll instantiate a task abort of the same xid. The race condition this patch tries to fix is as follows: SCSI_CMD timeout (20s) thread 1 thread 2 send ABTS rx ABTS cmpl task abort_eh explicit LOGO since ABTS was engaged CLEANUP cmpl SCSI_CMD cmpl (ABTS cmpl) instantiate RRQ wait 10s attempt to send RRQ (because of LOGO, it wouldn't continue) Note that there is no call to scsi_done for this SCSI_CMD cmpletion in this path. The patch changes the path of execution to call scsi_done immediately instead of instantiating the RRQ. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2fc')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 575142e92d9c..ed880891cb7c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1246,6 +1246,12 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)
1246 kref_put(&io_req->refcount, 1246 kref_put(&io_req->refcount,
1247 bnx2fc_cmd_release); /* drop timer hold */ 1247 bnx2fc_cmd_release); /* drop timer hold */
1248 rc = bnx2fc_expl_logo(lport, io_req); 1248 rc = bnx2fc_expl_logo(lport, io_req);
1249 /* This only occurs when an task abort was requested while ABTS
1250 is in progress. Setting the IO_CLEANUP flag will skip the
1251 RRQ process in the case when the fw generated SCSI_CMD cmpl
1252 was a result from the ABTS request rather than the CLEANUP
1253 request */
1254 set_bit(BNX2FC_FLAG_IO_CLEANUP, &io_req->req_flags);
1249 goto out; 1255 goto out;
1250 } 1256 }
1251 1257