From 1b69a6a2e82ff3efe1381556606567382db897a9 Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Wed, 20 Sep 2017 16:12:21 +0800 Subject: [PATCH] dmaengine: pl330: pl330_tasklet init power_down by pch->active To fix issue like this: dma-pl330 ff6d0000.dma-controller: pl330_update:1733 Unexpected! dma-pl330 ff6d0000.dma-controller: DMAC halted! The root cause is DMA clk is closed when DMA interrupt is in service. This may happen, as follow: 1. When pl330_terminate_all is called, and set pch->active false, power_down is true, call pm_runtime_put_autosuspend. 2. Then pl330_tasklet is called, if power_down is also true, call pm_runtime_put_autosuspend again. 3. DMA is opened again, because the autosuspend is asyn, it may close the DMA clk. If DMA interrupt is coming, it causes the issue. Change-Id: Ib1feb508c16afb4bc9ced0c3660f2b6b4a19c068 Signed-off-by: Huibin Hong --- drivers/dma/pl330.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 009ff09c20b1..dfca623f42fd 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2187,7 +2187,7 @@ static void pl330_tasklet(unsigned long data) spin_lock(&pch->thread->dmac->lock); _stop(pch->thread); spin_unlock(&pch->thread->dmac->lock); - power_down = true; + power_down = pch->active; pch->active = false; } else { /* Make sure the PL330 Channel thread is active */