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)
committerVinod Koul <vinod.koul@intel.com>
Wed, 10 Jun 2015 16:48:30 +0000 (22:18 +0530)
commit9136291f1dbc1d4d1cacd2840fb35f4f3ce16c46
treef4ed2951f43167da822efc5f1910f914988614e0
parente5489d5e9031e34d50f03e3d132f392314e74cf1
dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup

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>
Cc: stable@vger.kernel.org
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/mv_xor.c
drivers/dma/mv_xor.h