]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] bnx2fc: Fixed a SCSI CMD cmpl race condition between ABTS and CLEANUP
authorEddie Wai <eddie.wai@broadcom.com>
Wed, 18 Sep 2013 05:33:10 +0000 (22:33 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 25 Oct 2013 08:58:02 +0000 (09:58 +0100)
commit8bd8da25546990a6be74923fb47aed73b02e14ed
tree9e85376452bfe06a11990e07d0055ccb818c7212
parente72d2471f9810eb903c096d662cf3ead9a7fad97
[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>
drivers/scsi/bnx2fc/bnx2fc_io.c