diff options
author | Robin Gong <yibin.gong@nxp.com> | 2018-12-17 22:34:13 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:35:40 +0800 |
commit | 80b0e31cdd38d77ea5b0a116fe9f2b2dec23dd2b (patch) | |
tree | 06e9464864350ae44a7be8e937616b423de304e7 /drivers/dma | |
parent | ba219a09df8a2dfdb96094e40e56b8c911b7711e (diff) |
MLK-20598 dmaengine: imx-sdma: fix potential system hang
In multi audio play/stop case,sdma_alloc_chan_resources/
sdma_free_chan_resources will be called quickly, especially,dma done
interrupt comes after sdma_free_chan_resources, thus, system will be
hang in interrupt since it'll check sdma register but clocks have
already been disabled in sdma_free_chan_resources. To avoid it, enable
clock in isr.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/imx-sdma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index dffc54f7ebba..39b59b7c50a4 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -870,6 +870,9 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id) struct sdma_engine *sdma = dev_id; unsigned long stat; + clk_enable(sdma->clk_ipg); + clk_enable(sdma->clk_ahb); + stat = readl_relaxed(sdma->regs + SDMA_H_INTR); writel_relaxed(stat, sdma->regs + SDMA_H_INTR); /* channel 0 is special and not handled here, see run_channel0() */ @@ -900,6 +903,9 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id) spin_unlock(&sdmac->vc.lock); } + clk_disable(sdma->clk_ipg); + clk_disable(sdma->clk_ahb); + return IRQ_HANDLED; } |