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)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:09:24 +0000 (13:09 +0000)
commitbb7ae207758a1d51c3bbf00d8b967b7387291afe
tree9828ddd90593989d967a723e516e53061156fcd4
parent60c15a381f31c02d60b6aa0dcc47130d2bb1aded
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