summary refs log tree commit diff
path: root/drivers/dma/mv_xor.h
diff options
context:
space:
mode:
authorLior Amsalem <alior@marvell.com>2015-05-26 15:07:32 +0200
committerVinod Koul <vinod.koul@intel.com>2015-06-10 22:18:30 +0530
commit9136291f1dbc1d4d1cacd2840fb35f4f3ce16c46 (patch)
treef4ed2951f43167da822efc5f1910f914988614e0 /drivers/dma/mv_xor.h
parente5489d5e9031e34d50f03e3d132f392314e74cf1 (diff)
downloadlinux-9136291f1dbc1d4d1cacd2840fb35f4f3ce16c46.tar.gz
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>
Diffstat (limited to 'drivers/dma/mv_xor.h')
-rw-r--r--drivers/dma/mv_xor.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h
index 91958dba39a2..0e302b3a33ad 100644
--- a/drivers/dma/mv_xor.h
+++ b/drivers/dma/mv_xor.h
@@ -31,6 +31,7 @@
 #define XOR_OPERATION_MODE_XOR		0
 #define XOR_OPERATION_MODE_MEMCPY	2
 #define XOR_DESCRIPTOR_SWAP		BIT(14)
+#define XOR_DESC_SUCCESS		0x40000000
 
 #define XOR_DESC_DMA_OWNED		BIT(31)
 #define XOR_DESC_EOD_INT_EN		BIT(31)