Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stefan Agner and committed by
Vinod Koul
0fe25d61 b206d9a2

+5 -4
+5 -4
drivers/dma/fsl-edma.c
··· 881 881 882 882 } 883 883 884 - ret = fsl_edma_irq_init(pdev, fsl_edma); 885 - if (ret) 886 - return ret; 887 - 888 884 fsl_edma->big_endian = of_property_read_bool(np, "big-endian"); 889 885 890 886 INIT_LIST_HEAD(&fsl_edma->dma_dev.channels); ··· 895 899 edma_writew(fsl_edma, 0x0, fsl_edma->membase + EDMA_TCD_CSR(i)); 896 900 fsl_edma_chan_mux(fsl_chan, 0, false); 897 901 } 902 + 903 + edma_writel(fsl_edma, ~0, fsl_edma->membase + EDMA_INTR); 904 + ret = fsl_edma_irq_init(pdev, fsl_edma); 905 + if (ret) 906 + return ret; 898 907 899 908 dma_cap_set(DMA_PRIVATE, fsl_edma->dma_dev.cap_mask); 900 909 dma_cap_set(DMA_SLAVE, fsl_edma->dma_dev.cap_mask);