openwrt/target/linux/layerscape/patches-5.4/806-dma-0010-MLK-16437-dma-fsl-edma-v3-fix-kernel-crash-while-edm.patch
Yangbo Lu cddd459140 layerscape: add patches-5.4
Add patches for linux-5.4. The patches are from NXP LSDK-20.04 release
which was tagged LSDK-20.04-V5.4.
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/

For boards LS1021A-IOT, and Traverse-LS1043 which are not involved in
LSDK, port the dts patches from 4.14.

The patches are sorted into the following categories:
  301-arch-xxxx
  302-dts-xxxx
  303-core-xxxx
  701-net-xxxx
  801-audio-xxxx
  802-can-xxxx
  803-clock-xxxx
  804-crypto-xxxx
  805-display-xxxx
  806-dma-xxxx
  807-gpio-xxxx
  808-i2c-xxxx
  809-jailhouse-xxxx
  810-keys-xxxx
  811-kvm-xxxx
  812-pcie-xxxx
  813-pm-xxxx
  814-qe-xxxx
  815-sata-xxxx
  816-sdhc-xxxx
  817-spi-xxxx
  818-thermal-xxxx
  819-uart-xxxx
  820-usb-xxxx
  821-vfio-xxxx

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2020-05-07 12:53:06 +02:00

43 lines
1.7 KiB
Diff

From e0d0cdff101b2f00ce1fd420522bd22bb6eebd9f Mon Sep 17 00:00:00 2001
From: Robin Gong <yibin.gong@nxp.com>
Date: Wed, 13 Sep 2017 16:39:49 +0800
Subject: [PATCH] MLK-16437: dma: fsl-edma-v3: fix kernel crash while edma
interrupt trigger after channel disabled
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>
(cherry picked from commit 625afad5a0900bc3e3288510f61647b1d891a5a4)
---
drivers/dma/fsl-edma-v3.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/dma/fsl-edma-v3.c
+++ b/drivers/dma/fsl-edma-v3.c
@@ -689,6 +689,11 @@ static irqreturn_t fsl_edma3_tx_handler(
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);