edma interrupt may come after channel terminated, so should ignore
interrupts, else kernel crash as below since fsl_chan->edesc set
to NULL when terminate.
606.837306] Unable to handle kernel NULL pointer dereference at virtual address
00000060
[ 606.845411] pgd =
ffff000009295000
[ 606.848814] [
00000060] *pgd=
00000008bfffe003[ 606.852906] , *pud=
00000008bfffd003
, *pmd=
0000000000000000[ 606.858395]
[ 606.859885] Internal error: Oops:
96000006 1 PREEMPT SMP
[ 606.865460] Modules linked in:
[ 606.868522] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.9.11-03371-g9904ea0 #42
[ 606.875832] Hardware name: Freescale i.MX8QXP LPDDR4 ARM2 (DT)
[ 606.881662] task:
ffff000009120680 task.stack:
ffff000009110000
[ 606.887588] PC is at fsl_edma3_tx_handler+0x50/0x150
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Tested-by: Daniel Baluta <daniel.baluta@nxp.com>
writel(1, base_addr + EDMA_CH_INT);
spin_lock(&fsl_chan->vchan.lock);
+
+ /* Ignore this interrupt since channel has been disabled already */
+ if (!fsl_chan->edesc)
+ return IRQ_HANDLED;
+
if (!fsl_chan->edesc->iscyclic) {
fsl_edma3_get_realcnt(fsl_chan);
list_del(&fsl_chan->edesc->vdesc.node);