linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: fsl-edma: clear pending interrupts on initialization
@ 2015-06-07 19:46 Stefan Agner
  2015-06-12 13:01 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Agner @ 2015-06-07 19:46 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 drivers/dma/fsl-edma.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
index 09e2842..915eec3 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);
-- 
2.4.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] dmaengine: fsl-edma: clear pending interrupts on initialization
  2015-06-07 19:46 [PATCH] dmaengine: fsl-edma: clear pending interrupts on initialization Stefan Agner
@ 2015-06-12 13:01 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2015-06-12 13:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jun 07, 2015 at 09:46:10PM +0200, Stefan Agner wrote:
> 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.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-12 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-07 19:46 [PATCH] dmaengine: fsl-edma: clear pending interrupts on initialization Stefan Agner
2015-06-12 13:01 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).