aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2014-08-03 13:13:03 -0400
committerVinod Koul <vinod.koul@intel.com>2014-08-04 04:00:31 -0400
commit67b166847009b009cd9fbcdef6b71558f49e1bd6 (patch)
treebfa91b9cb4d786d94b4ef76b5a6e04e895b08eb5 /drivers/dma
parentb45b262cefd5b8eb2ba88d20e5bd295881293894 (diff)
dmaengine: nbpfaxi: fix a theoretical race
A race possibility exists if a DMA slave driver tries to free channel resources witout waiting for all transfers to complete and without explicitly terminating all requests. In such a case the IRQ processing thread can race with .device_free_chan_resources(). To fix this race empty all descriptor lists before freeing descriptor cache. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/nbpfaxi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
index 77c5a890a30a..5b40ac8d82d1 100644
--- a/drivers/dma/nbpfaxi.c
+++ b/drivers/dma/nbpfaxi.c
@@ -1054,6 +1054,7 @@ static void nbpf_free_chan_resources(struct dma_chan *dchan)
1054 dev_dbg(dchan->device->dev, "Entry %s()\n", __func__); 1054 dev_dbg(dchan->device->dev, "Entry %s()\n", __func__);
1055 1055
1056 nbpf_chan_halt(chan); 1056 nbpf_chan_halt(chan);
1057 nbpf_chan_idle(chan);
1057 /* Clean up for if a channel is re-used for MEMCPY after slave DMA */ 1058 /* Clean up for if a channel is re-used for MEMCPY after slave DMA */
1058 nbpf_chan_prepare_default(chan); 1059 nbpf_chan_prepare_default(chan);
1059 1060