linux-stable/arch/sh
Artur Rojek 8fb11fa480 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-19 16:22:07 +02:00
..
boards mmc: sh_mmcif: move platform_data header to proper location 2022-04-26 14:05:21 +02:00
boot mmc: sh_mmcif: move platform_data header to proper location 2022-04-26 14:05:21 +02:00
cchips treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
configs - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
drivers sh: dma: Fix DMA channel offset calculation 2023-07-19 16:22:07 +02:00
include sh: Avoid using IRQ0 on SH3 and SH4 2023-07-19 16:21:54 +02:00
kernel sh: Avoid using IRQ0 on SH3 and SH4 2023-07-19 16:21:54 +02:00
lib sh: propage the calling conventions change down to csum_partial_copy_generic() 2020-08-20 15:45:18 -04:00
math-emu sh: math-emu: fix macro redefined warning 2023-05-17 11:53:44 +02:00
mm mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
tools sh: Remove SH5-based Cayman platform 2020-08-14 22:05:06 -04:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
Kconfig.cpu docs: sh: convert register-banks.txt to ReST 2020-06-19 14:10:13 -06:00
Kconfig.debug sh: mcount.S: fix build error when PRINTK is not enabled 2023-05-17 11:53:44 +02:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00