dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup
authorLior Amsalem <alior@marvell.com>
Tue, 26 May 2015 13:07:32 +0000 (15:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:46 +0000 (09:29 -0700)
commit42f77f15b1fdab86d7d968232776eba3e9b4e135
tree3fbebaff6afb9733238d032cd43fb86e7102e59f
parentf1bb13070802869da9e5c993a86d905c41f1ec28
dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup

commit 9136291f1dbc1d4d1cacd2840fb35f4f3ce16c46 upstream.

This patch fixes a bug in the XOR driver where the cleanup function can be
called and free descriptors that never been processed by the engine (which
result in data errors).

The cleanup function will free descriptors based on the ownership bit in
the descriptors.

Fixes: ff7b04796d98 ("dmaengine: DMA engine driver for Marvell XOR engine")
Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Ofer Heifetz <oferh@marvell.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/mv_xor.c
drivers/dma/mv_xor.h