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>
Thu, 13 Mar 2014 21:59:09 +0000 (15:59 -0600)
commit5eb9291c36c7d71d7c6c832d5a4f551eb8ac015d
tree4916b96db3ecccf343edc4bb9f181b5ffc89ba00
parent368c89d7ac70f937c93cd6f3b65bcfdfb3ba794f
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