ipr: wait for aborted command responses
authorBrian King <brking@linux.vnet.ibm.com>
Thu, 30 Oct 2014 22:27:10 +0000 (17:27 -0500)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 Jan 2015 14:44:59 +0000 (15:44 +0100)
commitc47613fde69549c125f2b20663004ce118c8e3d7
tree185e169cdf78ee1bef8fd3fac75647b62182998d
parent346750ccd61ac59d3c70267f007ea901e62a8a99
ipr: wait for aborted command responses

commit 6cdb08172bc89f0a39e1643c5e7eab362692fd1b upstream.

Fixes a race condition in abort handling that was injected
when multiple interrupt support was added. When only a single
interrupt is present, the adapter guarantees it will send
responses for aborted commands prior to the response for the
abort command itself. With multiple interrupts, these responses
generally come back on different interrupts, so we need to
ensure the abort thread waits until the aborted command is
complete so we don't perform a double completion. This race
condition was being hit frequently in environments which
were triggering command timeouts, which was resulting in
a double completion causing a kernel oops.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Wendy Xiong <wenxiong@linux.vnet.ibm.com>
Tested-by: Wendy Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/scsi/ipr.c
drivers/scsi/ipr.h