All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: fsl-edma: fix for missing dmamux module
@ 2021-09-01 21:16 ` Angelo Dureghello
  0 siblings, 0 replies; 4+ messages in thread
From: Angelo Dureghello @ 2021-09-01 21:16 UTC (permalink / raw)
  To: vinod.koul; +Cc: dmaengine, linux-arm-kernel, linux-m68k, Angelo Dureghello

Fix following panic on system halt:

Requesting system halt
[   10.600000] spi spi0.1: spi_device 0.1 cleanup
[   10.630000] fsl_edma_chan_mux() fsl_chan->edma->n_chans 64 dmamux_nr 0
[   10.630000] *** ZERO DIVIDE ***   FORMAT=4
[   10.630000] Current process id is 38
[   10.630000] BAD KERNEL TRAP: 00000000
[   10.630000] PC: [<402f09ba>] fsl_edma_chan_mux+0x7c/0x12e
...

Some architecture as mcf5441x (ColdFire) may not have
a dmamux, so dmamux_nr is set to 0. This patch considers this case.

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
---
 drivers/dma/fsl-edma-common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c
index 930ae268c497..009c75ff1320 100644
--- a/drivers/dma/fsl-edma-common.c
+++ b/drivers/dma/fsl-edma-common.c
@@ -638,12 +638,14 @@ EXPORT_SYMBOL_GPL(fsl_edma_alloc_chan_resources);
 void fsl_edma_free_chan_resources(struct dma_chan *chan)
 {
 	struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);
+	struct fsl_edma_engine *edma = fsl_chan->edma;
 	unsigned long flags;
 	LIST_HEAD(head);
 
 	spin_lock_irqsave(&fsl_chan->vchan.lock, flags);
 	fsl_edma_disable_request(fsl_chan);
-	fsl_edma_chan_mux(fsl_chan, 0, false);
+	if (edma->drvdata->dmamuxs)
+		fsl_edma_chan_mux(fsl_chan, 0, false);
 	fsl_chan->edesc = NULL;
 	vchan_get_all_descriptors(&fsl_chan->vchan, &head);
 	fsl_edma_unprep_slave_dma(fsl_chan);
-- 
2.32.0


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

* [PATCH] dmaengine: fsl-edma: fix for missing dmamux module
@ 2021-09-01 21:16 ` Angelo Dureghello
  0 siblings, 0 replies; 4+ messages in thread
From: Angelo Dureghello @ 2021-09-01 21:16 UTC (permalink / raw)
  To: vinod.koul; +Cc: dmaengine, linux-arm-kernel, linux-m68k, Angelo Dureghello

Fix following panic on system halt:

Requesting system halt
[   10.600000] spi spi0.1: spi_device 0.1 cleanup
[   10.630000] fsl_edma_chan_mux() fsl_chan->edma->n_chans 64 dmamux_nr 0
[   10.630000] *** ZERO DIVIDE ***   FORMAT=4
[   10.630000] Current process id is 38
[   10.630000] BAD KERNEL TRAP: 00000000
[   10.630000] PC: [<402f09ba>] fsl_edma_chan_mux+0x7c/0x12e
...

Some architecture as mcf5441x (ColdFire) may not have
a dmamux, so dmamux_nr is set to 0. This patch considers this case.

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
---
 drivers/dma/fsl-edma-common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c
index 930ae268c497..009c75ff1320 100644
--- a/drivers/dma/fsl-edma-common.c
+++ b/drivers/dma/fsl-edma-common.c
@@ -638,12 +638,14 @@ EXPORT_SYMBOL_GPL(fsl_edma_alloc_chan_resources);
 void fsl_edma_free_chan_resources(struct dma_chan *chan)
 {
 	struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);
+	struct fsl_edma_engine *edma = fsl_chan->edma;
 	unsigned long flags;
 	LIST_HEAD(head);
 
 	spin_lock_irqsave(&fsl_chan->vchan.lock, flags);
 	fsl_edma_disable_request(fsl_chan);
-	fsl_edma_chan_mux(fsl_chan, 0, false);
+	if (edma->drvdata->dmamuxs)
+		fsl_edma_chan_mux(fsl_chan, 0, false);
 	fsl_chan->edesc = NULL;
 	vchan_get_all_descriptors(&fsl_chan->vchan, &head);
 	fsl_edma_unprep_slave_dma(fsl_chan);
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] dmaengine: fsl-edma: fix for missing dmamux module
  2021-09-01 21:16 ` Angelo Dureghello
@ 2021-10-25  6:40   ` Vinod Koul
  -1 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2021-10-25  6:40 UTC (permalink / raw)
  To: Angelo Dureghello; +Cc: dmaengine, linux-arm-kernel, linux-m68k

On 01-09-21, 23:16, Angelo Dureghello wrote:
> Fix following panic on system halt:
> 
> Requesting system halt
> [   10.600000] spi spi0.1: spi_device 0.1 cleanup
> [   10.630000] fsl_edma_chan_mux() fsl_chan->edma->n_chans 64 dmamux_nr 0
> [   10.630000] *** ZERO DIVIDE ***   FORMAT=4
> [   10.630000] Current process id is 38
> [   10.630000] BAD KERNEL TRAP: 00000000
> [   10.630000] PC: [<402f09ba>] fsl_edma_chan_mux+0x7c/0x12e
> ...
> 
> Some architecture as mcf5441x (ColdFire) may not have
> a dmamux, so dmamux_nr is set to 0. This patch considers this case.

Applied, thanks

-- 
~Vinod

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

* Re: [PATCH] dmaengine: fsl-edma: fix for missing dmamux module
@ 2021-10-25  6:40   ` Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2021-10-25  6:40 UTC (permalink / raw)
  To: Angelo Dureghello; +Cc: dmaengine, linux-arm-kernel, linux-m68k

On 01-09-21, 23:16, Angelo Dureghello wrote:
> Fix following panic on system halt:
> 
> Requesting system halt
> [   10.600000] spi spi0.1: spi_device 0.1 cleanup
> [   10.630000] fsl_edma_chan_mux() fsl_chan->edma->n_chans 64 dmamux_nr 0
> [   10.630000] *** ZERO DIVIDE ***   FORMAT=4
> [   10.630000] Current process id is 38
> [   10.630000] BAD KERNEL TRAP: 00000000
> [   10.630000] PC: [<402f09ba>] fsl_edma_chan_mux+0x7c/0x12e
> ...
> 
> Some architecture as mcf5441x (ColdFire) may not have
> a dmamux, so dmamux_nr is set to 0. This patch considers this case.

Applied, thanks

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-10-25  6:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 21:16 [PATCH] dmaengine: fsl-edma: fix for missing dmamux module Angelo Dureghello
2021-09-01 21:16 ` Angelo Dureghello
2021-10-25  6:40 ` Vinod Koul
2021-10-25  6:40   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.