linux-stable/arch/sh/drivers
Artur Rojek 196f6c7190 sh: dma: Fix DMA channel offset calculation
[ Upstream commit e82e475848 ]

Various SoCs of the SH3, SH4 and SH4A family, which use this driver,
feature a differing number of DMA channels, which can be distributed
between up to two DMAC modules. The existing implementation fails to
correctly accommodate for all those variations, resulting in wrong
channel offset calculations and leading to kernel panics.

Rewrite dma_base_addr() in order to properly calculate channel offsets
in a DMAC module. Fix dmaor_read_reg() and dmaor_write_reg(), so that
the correct DMAC module base is selected for the DMAOR register.

Fixes: 7f47c7189b ("sh: dma: More legacy cpu dma chainsawing.")
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20230527164452.64797-2-contact@artur-rojek.eu
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-23 13:47:30 +02:00
..
dma sh: dma: Fix DMA channel offset calculation 2023-07-23 13:47:30 +02:00
pci dma-mapping: remove the dma_direct_set_offset export 2020-11-18 09:11:38 +01:00
superhyway sh: drivers: convert to SPDX identifiers 2018-12-28 12:11:44 -08:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile drivers: move the early platform device support to arch/sh 2019-10-07 13:50:47 +02:00
heartbeat.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
platform_early.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
push-switch.c sh: drivers: convert to SPDX identifiers 2018-12-28 12:11:44 -08:00