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)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 12 Aug 2015 14:33:15 +0000 (16:33 +0200)
commit26aa1c6949dfef77d3aa77e4cb504ccfd8394ce9
tree26f42d0f193f9312b9c57dc956c95303f5640783
parent8ea2235157a0c8452fc884f21dd486c7eb972204
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>
drivers/dma/mv_xor.c
drivers/dma/mv_xor.h