Hi Benjamin, On Fri, Nov 28, 2025 at 10:53:17PM +0100, Benjamin Drung wrote: > On Wed, 2025-11-26 at 08:52 +0100, Salvatore Bonaccorso wrote: > > Control: tags -1 + moreinfo > > > > Hi, > > > > On Sat, Nov 22, 2025 at 04:27:53PM +0100, Benjamin Drung wrote: > > > Hi Uwe, > > > > > > On Fri, 2025-11-21 at 09:52 +0100, Uwe Kleine-König wrote: > > > > Hello Benjamin, > > > > > > > > On Thu, Nov 20, 2025 at 11:11:07AM +0100, Benjamin Drung wrote: > > > > > On Thu, 2025-11-20 at 08:58 +0100, Uwe Kleine-König wrote: > > > > > > On Mon, Nov 17, 2025 at 02:05:41AM +0100, Benjamin Drung wrote: > > > > > > > On Wed, 2025-11-05 at 20:14 +0100, Uwe Kleine-König wrote: > > > > > > > > Can you try adding > > > > > > > > > > > > > > > > earlyprintk=serial,0x7e215040 > > > > > > > > > > > > > > > > to the kernel commandline. Not sure this activates the right > > > > > > > > procedures, > > > > > > > > maybe try it with the working kernel first. > > > > > > > > > > > > > > I tried with the working kernel 6.12.43+deb13-rpi but these were > > > > > > > the > > > > > > > earliest lines: > > > > > > > > > > > > > > [ 4.116565] printk: legacy console [ttyS1] enabled > > > > > > > [ 4.129635] printk: legacy bootconsole [earlycon0] disabled > > > > > > > [ 4.147050] bcm2835-power bcm2835-power: Broadcom BCM2835 > > > > > > > power domains driver > > > > > > > [ 4.160972] mousedev: PS/2 mouse device common for all mice > > > > > > > [ 4.172622] i2c-bcm2835 20805000.i2c: Could not read > > > > > > > clock-frequency property > > > > > > > [ 4.186585] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog > > > > > > > timer > > > > > > > > > > > > > > I tried with 6.12.57+deb13-rpi but that failed to boot and the > > > > > > > earlyprintk line did not give any additional logs. > > > > > > > > > > > > Can you please provide a full kernel log of the working kernel? > > > > > > > > > > dmesg log is attached. > > > > > > > > > > > Also please provide the output of: > > > > > > > > > > > > for f in /proc/tty/driver/*; do echo $f; sed 's/^/ /' < $f; > > > > > > done > > > > > > > > > > /proc/tty/driver/serial > > > > > serinfo:1.0 driver revision: > > > > > 0: uart:unknown port:00000000 irq:0 > > > > > 1: uart:16550 mmio:0x20215040 irq:53 tx:15629 rx:0 RTS|CTS|DTR > > > > > 2: uart:unknown port:00000000 irq:0 > > > > > 3: uart:unknown port:00000000 irq:0 > > > > > /proc/tty/driver/ttyAMA > > > > > serinfo:1.0 driver revision: > > > > > 0: uart:PL011 rev2 mmio:0x20201000 irq:81 tx:452 rx:980 RTS|CTS|DTR > > > > > > > > OK, is > > > > > > > > earlyprintk=serial,0x20215040 > > > > > > > > more communicative then? > > > > > > Nope, but I found > > > https://www.raspberrypi.com/documentation/computers/configuration.html#enabling-early-console-for-linux > > > and setting earlycon=uart8250,mmio32,0x20215040 worked. The kernel > > > 6.12.43+deb13-rpi booted with printing the early lines as well (see > > > dmesg of previous mail). > > > > > > With all other experiments cleaned, I tried the latest kernel: > > > > > > ``` > > > $ cat /etc/default/raspi-extra-cmdline > > > earlycon=uart8250,mmio32,0x20215040 > > > $ update-initramfs -u > > > ``` > > > > > > I got following logs before it got stuck: > > > > > > ``` > > > [ 0.000000] Booting Linux on physical CPU 0x0 > > > [ 0.000000] Linux version 6.12.57+deb13-rpi > > > ([email protected]) (arm-linux-gnueabi-gcc-14 (Debian > > > 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44) #1 Debian > > > 6.12.57-1 (2025-11-05) > > > [ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 > > > (ARMv7), cr=00c5387d > > > [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing > > > instruction cache > > > [ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero W Rev 1.1 > > > [ 0.000000] random: crng init done > > > [ 0.000000] earlycon: uart8250 at MMIO32 0x20215040 (options '') > > > [ 0.000000] printk: legacy bootconsole [uart8250] enabled > > > [ 0.000000] Memory policy: Data cache writeback > > > [ 0.000000] Reserved memory: bypass linux,cma node, using cmdline CMA > > > params instead > > > [ 0.000000] OF: reserved mem: node linux,cma compatible matching fail > > > [ 0.000000] cma: Reserved 64 MiB at 0x17000000 on node -1 > > > ``` > > > > > > It looks like being cma related and I found a cma boot option in > > > /etc/default/raspi-firmware. So I modified /boot/firmware/cmdline.txt > > > and changed cma=64M to cma=0. Then the system booted without problems: > > > > > > ``` > > > [...] > > > [ 0.000000] Reserved memory: bypass linux,cma node, using cmdline CMA > > > params instead > > > [ 0.000000] OF: reserved mem: node linux,cma compatible matching fail > > > [ 0.000000] Zone ranges: > > > [ 0.000000] Normal [mem 0x0000000000000000-0x000000001bffffff] > > > [ 0.000000] Movable zone start for each node > > > [ 0.000000] Early memory node ranges > > > [ 0.000000] node 0: [mem 0x0000000000000000-0x000000001bffffff] > > > [ 0.000000] Initmem setup node 0 [mem > > > 0x0000000000000000-0x000000001bffffff] > > > [ 0.000000] Kernel command line: dma.dmachans=0x7ff5 > > > bcm2708.boardrev=0x9000c1 bcm2708.serial=0x8bb1238 > > > bcm2708.uart_clock=48000000 bcm2708.disk_led_gpio=47 > > > smsc95xx.macaddr=B8:27:EB:BB:12:38 vc_mem.mem_base=0x1ec00000 > > > vc_mem.mem_size=0x20000000 console=tty0 console=ttyS1,115200 > > > root=/dev/mmcblk0p2 rw fsck.repair=yes net.ifnames=0 cma=0 rootwait > > > earlycon=uart8250,mmio32,0x20215040 > > > [...] > > > ``` > > > > > > Then I persisted this change by setting CMA=0 in > > > /etc/default/raspi-firmware: > > > > > > ``` > > > $ grep -Ev '^(#|$)' /etc/default/raspi-firmware > > > CMA=0 > > > $ update-initramfs -u > > > ``` > > > > > > This config removes the cma cmdline option completely. The system still > > > boots: > > > > > > ``` > > > [...] > > > [ 0.000000] Memory policy: Data cache writeback > > > [ 0.000000] Reserved memory: created CMA memory pool at 0x17000000, > > > size 64 MiB > > > [ 0.000000] OF: reserved mem: initialized node linux,cma, compatible > > > id shared-dma-pool > > > [ 0.000000] OF: reserved mem: 0x17000000..0x1affffff (65536 KiB) map > > > reusable linux,cma > > > [ 0.000000] Zone ranges: > > > [ 0.000000] Normal [mem 0x0000000000000000-0x000000001bffffff] > > > [ 0.000000] Movable zone start for each node > > > [ 0.000000] Early memory node ranges > > > [ 0.000000] node 0: [mem 0x0000000000000000-0x000000001bffffff] > > > [ 0.000000] Initmem setup node 0 [mem > > > 0x0000000000000000-0x000000001bffffff] > > > [ 0.000000] Kernel command line: dma.dmachans=0x7ff5 > > > bcm2708.boardrev=0x9000c1 bcm2708.serial=0x8bb1238 > > > bcm2708.uart_clock=48000000 bcm2708.disk_led_gpio=47 > > > smsc95xx.macaddr=B8:27:EB:BB:12:38 vc_mem.mem_base=0x1ec00000 > > > vc_mem.mem_size=0x20000000 console=tty0 console=ttyS1,115200 > > > root=/dev/mmcblk0p2 rw fsck.repair=yes net.ifnames=0 rootwait > > > earlycon=uart8250,mmio32,0x20215040 > > > [...] > > > ``` > > > > > > That should hopefully narrow down the issue space. > > > > If I'm not wrong the only cma related change between 6.12.43 and > > 6.12.48 was the backport of 2c223f7239f3 ("of: reserved_mem: > > Restructure call site for dma_contiguous_early_fixup()"): > > > > commit 46efab01648a04082266115a8e917c3b26b97fa8 > > Author: Oreoluwa Babatunde <[email protected]> > > Date: Wed Aug 6 10:24:21 2025 -0700 > > > > of: reserved_mem: Restructure call site for > > dma_contiguous_early_fixup() > > > > [ Upstream commit 2c223f7239f376a90d71903ec474ba887cf21d94 ] > > > > Restructure the call site for dma_contiguous_early_fixup() to > > where the reserved_mem nodes are being parsed from the DT so that > > dma_mmu_remap[] is populated before dma_contiguous_remap() is > > called. > > > > Fixes: 8a6e02d0c00e ("of: reserved_mem: Restructure how the > > reserved memory regions are processed") > > Signed-off-by: Oreoluwa Babatunde > > <[email protected]> > > Tested-by: William Zhang <[email protected]> > > Signed-off-by: Marek Szyprowski <[email protected]> > > Link: > > https://lore.kernel.org/r/[email protected] > > Signed-off-by: Sasha Levin <[email protected]> > > > > Uwe, would that make sense? Benjamin can you try to make a build with > > that commit reverted, does it fix the problem? > > Building the kernel on the Pi Zero would probably take ages. I have a > Raspberry Pi 5 running arm64. That should be able to build the kernel in > a armel schroot, shouldn't it? Is there documentation for building the > kernel?
I hope it is fine for Uwe that i respond here, he might have another more efficient way to reach our goal. But we have the simple-patching guideline here: https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#id-1.6.6.4 That should work within an armel schroot work well, e.g. on a porterbox amdahl.d.o i would first setup a schroot via: schroot -b -c chroot:trixie_armel-dchroot -n linux dd-schroot-cmd -c linux apt-get update dd-schroot-cmd -c linux apt-get dist-upgrade dd-schroot-cmd -c linux apt-get build-dep linux schroot -r -c linux (see https://dsa.debian.org/doc/schroot/) Then download the linux/6.12.57-1 source and make the revert patch available. apt-get source linux cd linux-* ./debian/bin/test-patches -f rpi ../0001-Revert-of-reserved_mem-Restructure-call-site-for-dma.patch Regards, Salvatore
>From a7b62fb55c57552177ea12188c61cd501fa3e055 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso <[email protected]> Date: Fri, 28 Nov 2025 23:41:59 +0100 Subject: [PATCH] Revert "of: reserved_mem: Restructure call site for dma_contiguous_early_fixup()" This reverts commit 46efab01648a04082266115a8e917c3b26b97fa8. --- drivers/of/of_reserved_mem.c | 16 ++++------------ include/linux/dma-map-ops.h | 3 --- kernel/dma/contiguous.c | 2 ++ 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 7b5d6562fe4a..45445a1600a9 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -24,7 +24,6 @@ #include <linux/memblock.h> #include <linux/kmemleak.h> #include <linux/cma.h> -#include <linux/dma-map-ops.h> #include "of_private.h" @@ -129,17 +128,13 @@ static int __init __reserved_mem_reserve_reg(unsigned long node, base = dt_mem_next_cell(dt_root_addr_cells, &prop); size = dt_mem_next_cell(dt_root_size_cells, &prop); - if (size && early_init_dt_reserve_memory(base, size, nomap) == 0) { - /* Architecture specific contiguous memory fixup. */ - if (of_flat_dt_is_compatible(node, "shared-dma-pool") && - of_get_flat_dt_prop(node, "reusable", NULL)) - dma_contiguous_early_fixup(base, size); + if (size && + early_init_dt_reserve_memory(base, size, nomap) == 0) pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %lu MiB\n", uname, &base, (unsigned long)(size / SZ_1M)); - } else { + else pr_err("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n", uname, &base, (unsigned long)(size / SZ_1M)); - } len -= t_len; } @@ -422,10 +417,7 @@ static int __init __reserved_mem_alloc_size(unsigned long node, const char *unam uname, (unsigned long)(size / SZ_1M)); return -ENOMEM; } - /* Architecture specific contiguous memory fixup. */ - if (of_flat_dt_is_compatible(node, "shared-dma-pool") && - of_get_flat_dt_prop(node, "reusable", NULL)) - dma_contiguous_early_fixup(base, size); + /* Save region in the reserved_mem array */ fdt_reserved_mem_save_node(node, uname, base, size); return 0; diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index b42408a24ad1..b7773201414c 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -153,9 +153,6 @@ static inline void dma_free_contiguous(struct device *dev, struct page *page, { __free_pages(page, get_order(size)); } -static inline void dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) -{ -} #endif /* CONFIG_DMA_CMA*/ #ifdef CONFIG_DMA_DECLARE_COHERENT diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 9e5d63efe7c5..8df0dfaaca18 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -480,6 +480,8 @@ static int __init rmem_cma_setup(struct reserved_mem *rmem) pr_err("Reserved memory: unable to setup CMA region\n"); return err; } + /* Architecture specific contiguous memory fixup. */ + dma_contiguous_early_fixup(rmem->base, rmem->size); if (default_cma) dma_contiguous_default_area = cma; -- 2.51.0

