All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] dma: tegra20-apbdma: channel freeing correction
@ 2012-10-28 14:17 ` Dmitry Osipenko
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Osipenko @ 2012-10-28 14:17 UTC (permalink / raw)
  To: digetx-Re5JQEeQqe8AvxtiuMwx3w
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Fixed channel "lock" after free.

Example: Channel 1 was allocated and prepared as slave_sg, used and freed. Now preparation of cyclic dma on channel 1 will fail with err "DMA
configuration conflict" because tdc->isr_handler still selected to handle_once_dma_done.

This happens because tegra_dma_abort_all() won't be called on channel freeing if pending list is empty.

Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/dma/tegra20-apb-dma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 4d816be..00c5dee 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1147,6 +1147,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)
 
 	if (tdc->busy)
 		tegra_dma_terminate_all(dc);
+	tdc->isr_handler = NULL;
 
 	spin_lock_irqsave(&tdc->lock, flags);
 	list_splice_init(&tdc->pending_sg_req, &sg_req_list);
-- 
1.7.12

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

end of thread, other threads:[~2012-10-31 14:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-28 14:17 [PATCH 2/2] dma: tegra20-apbdma: channel freeing correction Dmitry Osipenko
2012-10-28 14:17 ` Dmitry Osipenko
2012-10-29 15:27 ` Stephen Warren
2012-10-29 23:20   ` [PATCH V2] dma: tegra: avoid channel lock up after free Dmitry Osipenko
2012-10-29 23:28     ` Dmitry Osipenko
2012-10-30 18:05     ` Stephen Warren
2012-10-31 14:58     ` Laxman Dewangan
     [not found] ` <1351433873-14082-1-git-send-email-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-10-31 14:48   ` [PATCH 2/2] dma: tegra20-apbdma: channel freeing correction Laxman Dewangan
2012-10-31 14:48     ` Laxman Dewangan
2012-10-31 14:48   ` Laxman Dewangan
2012-10-31 14:48     ` Laxman Dewangan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.