devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dmaengine: nbpfaxi: fix a theoretical race
@ 2014-08-03 17:13 Guennadi Liakhovetski
       [not found] ` <Pine.LNX.4.64.1408031909420.13820-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2014-08-03 17:13 UTC (permalink / raw)
  To: dmaengine-u79uwXL29TY76Z2rM5mHXA
  Cc: Vinod Koul, Shevchenko, Andriy, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Grant Likely, Rob Herring, Phil Edworthy, Arnd Bergmann

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/dma/nbpfaxi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
index 77c5a89..5b40ac8 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)
 	dev_dbg(dchan->device->dev, "Entry %s()\n", __func__);
 
 	nbpf_chan_halt(chan);
+	nbpf_chan_idle(chan);
 	/* Clean up for if a channel is re-used for MEMCPY after slave DMA */
 	nbpf_chan_prepare_default(chan);
 
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-03 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-03 17:13 [PATCH 1/2] dmaengine: nbpfaxi: fix a theoretical race Guennadi Liakhovetski
     [not found] ` <Pine.LNX.4.64.1408031909420.13820-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2014-08-03 17:13   ` [PATCH 2/2] dmaengine: nbpfaxi: convert to tasklet Guennadi Liakhovetski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).