ath79/mikrotik: use routerbootpart partitions
[oweals/openwrt.git] / target / linux / layerscape / patches-5.4 / 806-dma-0023-MLK-22284-2-dmaengine-fsl-edma-v3-check-dma-descript.patch
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
5  before register touch
6
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.
10
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)
14 ---
15  drivers/dma/fsl-edma-v3.c | 14 +++++++-------
16  1 file changed, 7 insertions(+), 7 deletions(-)
17
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(
21         unsigned int intr;
22         void __iomem *base_addr;
23  
24 +       spin_lock(&fsl_chan->vchan.lock);
25 +
26 +       /* Ignore this interrupt since channel has been disabled already */
27 +       if (!fsl_chan->edesc)
28 +               goto irq_handled;
29 +
30         base_addr = fsl_chan->membase;
31  
32         intr = readl(base_addr + EDMA_CH_INT);
33         if (!intr)
34 -               return IRQ_NONE;
35 +               goto irq_handled;
36  
37         writel(1, base_addr + EDMA_CH_INT);
38  
39 -       spin_lock(&fsl_chan->vchan.lock);
40 -
41 -       /* Ignore this interrupt since channel has been disabled already */
42 -       if (!fsl_chan->edesc)
43 -               goto irq_handled;
44 -
45         if (!fsl_chan->edesc->iscyclic) {
46                 fsl_edma3_get_realcnt(fsl_chan);
47                 list_del(&fsl_chan->edesc->vdesc.node);