Skip to content

Commit

Permalink
dmaengine: fsl-edma: clear pending interrupts on initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Agner authored and Vinod Koul committed Jun 25, 2015
1 parent b206d9a commit 0fe25d6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/dma/fsl-edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 0fe25d6

Please sign in to comment.