ibmvfc: Fix command completion handling
commit248b0ac85057d9267d5be6bb511eff6dfd13624e
authorBrian King <brking@linux.vnet.ibm.com>
Tue, 20 Apr 2010 19:21:33 +0000 (20 14:21 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Aug 2010 20:27:37 +0000 (13 13:27 -0700)
tree592fa973e588af6824c43d19bddb815bd19f0a04
parentbce2d0a8ec0e4160fa84a054838d334e82fd6cc3
ibmvfc: Fix command completion handling

commit f5832fa2f8dc39adcf3ae348d2d6383163235e79 upstream.

Commands which are completed by the VIOS are placed on a CRQ
in kernel memory for the ibmvfc driver to process. Each CRQ
entry is 16 bytes. The ibmvfc driver reads the first 8 bytes
to check if the entry is valid, then reads the next 8 bytes to get
the handle, which is a pointer the completed command. This fixes
an issue seen on Power 7 where the processor reordered the
loads from memory, resulting in processing command completion
with a stale handle. This could result in command timeouts,
and also early completion of commands.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/ibmvscsi/ibmvfc.c