dmaengine: fsl-edma: fix for missing dmamux module
authorAngelo Dureghello <angelo.dureghello@timesys.com>
Wed, 1 Sep 2021 21:16:10 +0000 (23:16 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 25 Oct 2021 06:39:14 +0000 (12:09 +0530)
commit5b5b5aa50d1b90392f13afd15089e191d57316f5
treef31f7ecd41a012d4e5cf46e1b9da8e24ba597f32
parentee5c6f0ca219b65f5085043d481d9b6f045693d5
dmaengine: fsl-edma: fix for missing dmamux module

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>
Link: https://lore.kernel.org/r/20210901211610.662077-1-angelo.dureghello@timesys.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/fsl-edma-common.c