linux-stable/arch
Artur Rojek e9e33faea1 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:36:49 +02:00
..
alpha mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-19 16:36:19 +02:00
arm ARM: dts: lan966x: kontron-d10: fix SPI CS 2023-07-19 16:36:08 +02:00
arm64 arm64: sme: Use STR P to clear FFR context field in streaming SVE mode 2023-07-19 16:36:25 +02:00
csky csky: fix up lock_mm_and_find_vma() conversion 2023-07-01 13:12:41 +02:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
ia64 mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
loongarch mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
m68k mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
mips Input: ads7846 - Convert to use software nodes 2023-07-19 16:35:47 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
parisc parisc: fix expand_stack() conversion 2023-07-01 13:12:41 +02:00
powerpc powerpc: dts: turris1x.dts: Fix PCIe MEM size for pci2 node 2023-07-19 16:36:46 +02:00
riscv risc-v: Fix order of IPI enablement vs RCU startup 2023-07-19 16:36:49 +02:00
s390 KVM: s390/diag: fix racy access of physical cpu number in diag 9c handler 2023-07-19 16:36:38 +02:00
sh sh: dma: Fix DMA channel offset calculation 2023-07-19 16:36:49 +02:00
sparc watchdog/hardlockup: rename some "NMI watchdog" constants/function 2023-07-19 16:35:32 +02:00
um mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
x86 x86/efi: Make efi_set_virtual_address_map IBT safe 2023-07-19 16:36:25 +02:00
xtensa mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
.gitignore
Kconfig