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 <huibin.hong@rock-chips.com>
This commit is contained in:
Huibin Hong
2017-09-20 16:12:21 +08:00
committed by Tao Huang
parent 6b420297ef
commit 1b69a6a2e8

View File

@@ -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 */