1 From 89885c09160b04ae2eec82cf9b35117ff6aa4c5d Mon Sep 17 00:00:00 2001
2 From: Robin Gong <yibin.gong@nxp.com>
3 Date: Wed, 8 May 2019 00:13:40 +0800
4 Subject: [PATCH] MLK-22284-2 dmaengine: fsl-edma-v3: check dma description
7 Check dma desscription firstly to ignore any unexpected interrupt
8 after channel terminate, otherwise, still have chance to touch channel
9 register whose power has been already off.
11 Signed-off-by: Robin Gong <yibin.gong@nxp.com>
12 Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
13 (cherry picked from commit fd073e017e317006a4c254ca5ae3ea17b6f32502)
15 drivers/dma/fsl-edma-v3.c | 14 +++++++-------
16 1 file changed, 7 insertions(+), 7 deletions(-)
18 --- a/drivers/dma/fsl-edma-v3.c
19 +++ b/drivers/dma/fsl-edma-v3.c
20 @@ -708,20 +708,20 @@ static irqreturn_t fsl_edma3_tx_handler(
22 void __iomem *base_addr;
24 + spin_lock(&fsl_chan->vchan.lock);
26 + /* Ignore this interrupt since channel has been disabled already */
27 + if (!fsl_chan->edesc)
30 base_addr = fsl_chan->membase;
32 intr = readl(base_addr + EDMA_CH_INT);
37 writel(1, base_addr + EDMA_CH_INT);
39 - spin_lock(&fsl_chan->vchan.lock);
41 - /* Ignore this interrupt since channel has been disabled already */
42 - if (!fsl_chan->edesc)
45 if (!fsl_chan->edesc->iscyclic) {
46 fsl_edma3_get_realcnt(fsl_chan);
47 list_del(&fsl_chan->edesc->vdesc.node);