summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2018-12-17 22:34:13 +0800
committerRobin Gong <yibin.gong@nxp.com>2020-04-10 01:03:26 +0800
commit9f014e919be67febe6a878a154063d1155f0d30f (patch)
tree2cf8d6a7bb2b5837c9f9cd9ffccb777568f23b5c /drivers
parent18e5faa34d6b4f64191d3893642868bf6bd34fc1 (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> (cherry picked from commit 80b0e31cdd38d77ea5b0a116fe9f2b2dec23dd2b)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/imx-sdma.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 32261fd73fa9..b8ae49ee69b2 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -958,6 +958,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() */
@@ -987,6 +990,9 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id)
__clear_bit(channel, &stat);
}
+ clk_disable(sdma->clk_ipg);
+ clk_disable(sdma->clk_ahb);
+
return IRQ_HANDLED;
}