mtip32xx: mtip_async_complete() bug fixes
authorSam Bradshaw <sbradshaw@micron.com>
Thu, 13 Mar 2014 21:33:30 +0000 (14:33 -0700)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:51 +0000 (12:54 -0600)
commit534ba4da58e1a8f925eb02362ebc33edda40b28e
tree15691732f8888da2a4d6bd96c22db2e8945a230f
parentc39893adce732cfa55ad849770af7a2902f9a12f
mtip32xx: mtip_async_complete() bug fixes

This patch fixes 2 issues in the fast completion path:
1) Possible double completions / double dma_unmap_sg() calls due to lack
of atomicity in the check and subsequent dereference of the upper layer
callback function. Fixed with cmpxchg before unmap and callback.
2) Regression in unaligned IO constraining workaround for p420m devices.
Fixed by checking if IO is unaligned and using proper semaphore if so.

Signed-off-by: Sam Bradshaw <sbradshaw@micron.com>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/mtip32xx/mtip32xx.c
drivers/block/mtip32xx/mtip32xx.h