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)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Sep 2015 11:52:10 +0000 (13:52 +0200)
commitb437e292d9ccc55f49377753f57ceac8e90cad40
tree7c5958894ee12d1d921f4abe618c80b80fcdc235
parent8a156fbcb0f05278c765666ef06bb79c5a853500
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>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 26aa1c6949dfef77d3aa77e4cb504ccfd8394ce9)

Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/dma/mv_xor.c
drivers/dma/mv_xor.h