summaryrefslogtreecommitdiff
path: root/drivers/dma/fsl-edma.c
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2015-06-07 22:46:10 +0300
committerVinod Koul <vinod.koul@intel.com>2015-06-25 06:52:32 +0300
commit0fe25d61102d44c5541b10e2bb8e6633665bc944 (patch)
tree14620f5b5021896ac96fdbd073274dbb75a990f4 /drivers/dma/fsl-edma.c
parentb206d9a23ac71cb905f5fb6e0cd813406f89b678 (diff)
downloadlinux-0fe25d61102d44c5541b10e2bb8e6633665bc944.tar.xz
dmaengine: fsl-edma: clear pending interrupts on initialization
Clear pending interrupts before requesting interrupts and move interrupt initialization after channels have been initialized. This avoids a NULL pointer dereference panic when using kexec while DMA requests were running. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/fsl-edma.c')
-rw-r--r--drivers/dma/fsl-edma.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
index 09e2842d15ec..915eec3cc279 100644
--- a/drivers/dma/fsl-edma.c
+++ b/drivers/dma/fsl-edma.c
@@ -881,10 +881,6 @@ static int fsl_edma_probe(struct platform_device *pdev)
}
- ret = fsl_edma_irq_init(pdev, fsl_edma);
- if (ret)
- return ret;
-
fsl_edma->big_endian = of_property_read_bool(np, "big-endian");
INIT_LIST_HEAD(&fsl_edma->dma_dev.channels);
@@ -900,6 +896,11 @@ static int fsl_edma_probe(struct platform_device *pdev)
fsl_edma_chan_mux(fsl_chan, 0, false);
}
+ edma_writel(fsl_edma, ~0, fsl_edma->membase + EDMA_INTR);
+ ret = fsl_edma_irq_init(pdev, fsl_edma);
+ if (ret)
+ return ret;
+
dma_cap_set(DMA_PRIVATE, fsl_edma->dma_dev.cap_mask);
dma_cap_set(DMA_SLAVE, fsl_edma->dma_dev.cap_mask);
dma_cap_set(DMA_CYCLIC, fsl_edma->dma_dev.cap_mask);