HIGHMEM freeing patch breaks Realtek RTL930x builds
Subsystems (2)
Hi Mike,
Quoted 4 lines
Von: Mike Rapoport <[email protected]>
Gesendet: Sonntag, 28. Dezember 2025 10:54
Betreff: Re: HIGHMEM freeing patch breaks Realtek RTL930x builds
Quoted 18 lines
Hi Markus,
Quoted 15 lines · On Sat, Dec 20, 2025 at 09:57:40AM +0100, [email protected] wrote:
Hi,
sorry for being late on this topic but downstream OpenWrt just started kernel
conversion from 6.12 to 6.18 these days. During preparation of the PR
https://github.com/openwrt/openwrt/pull/21181 we noticed that Realtek RTL930x soc based devices with more than 256MB (highmem) do not boot any longer.These are MIPS 34k 32bit multithreaded SoC with layout <
0x000000000x10000000>, /* 256 MiB lowmem */ <0x200000000x10000000>; /* 256 MiB highmem */Bisecting the issue gave " arch, mm: streamline HIGHMEM freeing"
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
Quoted 11 lines
Quoted 11 lines
?h=v6.15-rc1&id=6faea3422e3b4e8de44a55aa3e6e843320da66d2 as the first bad commit. This is back from the 6.15 times.
I have no real idea why removing
mem_init_free_highmem()and letting__free_memory_core()work on the whole memory range gives issues.We are aligning to upstream very slowly and are still in need of downstream patches so here some additional info.
- Until now we never cared about FLATMEM/SPARSEMEM configs
Quoted 8 lines
Quoted 5 lines
- We are still using dedicated
prom.c/setup.cfor the devices
https://git.openwrt.org/?p=openwrt/openwrt.git;a=tree;f=target/linux/
realtek/files-6.12/arch/mips/rtl838x;hb=HEADAny idea or hint is appreciated.
Can you please send logs from a working kernel and a failing kernel with "memblock=debug" added to the kernel command line?
Good hint. I've done that and collected all information in
https://github.com/openwrt/openwrt/issues/21323
Quoted 1 line
Another thing I think worth checking is will the system boot with a
partial
Quoted 1 line
revert of
6faea3422e3b("arch, mm: streamline HIGHMEM freeing") for mips:
Will try this out next, update the issue and inform you here.
Thank you
Markus
Quoted 40 lines · On Mon, Dec 29, 2025 at 07:36:52PM +0100, [email protected] wrote:
Hi Mike,
Quoted 4 lines
Von: Mike Rapoport <[email protected]>
Gesendet: Sonntag, 28. Dezember 2025 10:54
Betreff: Re: HIGHMEM freeing patch breaks Realtek RTL930x buildsQuoted 18 lines
Hi Markus,
Quoted 15 lines · On Sat, Dec 20, 2025 at 09:57:40AM +0100, [email protected] wrote:
Hi,
sorry for being late on this topic but downstream OpenWrt just started kernel
conversion from 6.12 to 6.18 these days. During preparation of the PR
https://github.com/openwrt/openwrt/pull/21181 we noticed that Realtek RTL930x soc based devices with more than 256MB (highmem) do not boot any longer.These are MIPS 34k 32bit multithreaded SoC with layout <
0x000000000x10000000>, /* 256 MiB lowmem */ <0x200000000x10000000>; /* 256 MiB highmem */Bisecting the issue gave " arch, mm: streamline HIGHMEM freeing"
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
Quoted 15 lines
Quoted 15 lines
?h=v6.15-rc1&id=6faea3422e3b4e8de44a55aa3e6e843320da66d2 as the first bad commit. This is back from the 6.15 times.
I have no real idea why removing
mem_init_free_highmem()and letting__free_memory_core()work on the whole memory range gives issues.We are aligning to upstream very slowly and are still in need of downstream patches so here some additional info.
- Until now we never cared about FLATMEM/SPARSEMEM configs
- We are still using dedicated
prom.c/setup.cfor the devices
https://git.openwrt.org/?p=openwrt/openwrt.git;a=tree;f=target/linux/
realtek/files-6.12/arch/mips/rtl838x;hb=HEAD
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Any idea or hint is appreciated.
Can you please send logs from a working kernel and a failing kernel with "memblock=debug" added to the kernel command line?
Good hint. I've done that and collected all information in
https://github.com/openwrt/openwrt/issues/21323
The successful boot disables highmem:
[ 0.332305] Memory: 495640K/524288K available (8188K kernel code, 647K rwdata, 1504K rodata, 9620K init, 244K bss, 27528K reserved, 0K cma-reserved, 0K highmem)
And the failing boot actually enables it:
[ 0.332285] Memory: 495640K/524288K available (8188K kernel code, 647K rwdata, 1504K rodata, 9620K init, 244K bss, 27528K reserved, 0K cma-reserved, 262144K highmem)
so I believe that the partial revert should help.
Anther option is to simply disable CONFIG_HIGHMEM for that platform if it anyway can't support highmem.
Quoted 9 lines
Quoted 1 line
Another thing I think worth checking is will the system boot with a
partial
Quoted 1 line
revert of
6faea3422e3b("arch, mm: streamline HIGHMEM freeing") for mips:Will try this out next, update the issue and inform you here.
Thank you
Markus
Signature · 2 lines
Sincerely yours, Mike.
Hi Mike,
Quoted 2 lines
The successful boot disables highmem:
[ 0.332305] Memory: 495640K/524288K available (8188K kernel code, 647K
rwdata, 1504K rodata, 9620K init, 244K bss, 27528K reserved, 0K cma-reserved, 0K highmem)
Quoted 3 lines
And the failing boot actually enables it:
[ 0.332285] Memory: 495640K/524288K available (8188K kernel code, 647K
rwdata, 1504K rodata, 9620K init, 244K bss, 27528K reserved, 0K cma-reserved, 262144K highmem)
Quoted 2 lines
so I believe that the partial revert should help.
Interesting find. That is strange. On 6.12 (where everything works) the 256MB highmem are detected properly.
[ 0.242252] Memory: 493784K/524288K available (8373K kernel code, 725K
rwdata, 1820K rodata, 10896K init, 248K bss, 29384K reserved, 0K cma-reserved, 262144K highmem)
Additionally I identified some spooky highmem
initialization in vendors SDK prom.c. We never
used that before. I added bootlog+code snippet
to the github issue [1].
Just to be sure. Do you expect highmem to be still detected/advertised with 6.15+? If yes I will bisect where the highmem detection breaks prior to the "suspicous" commit.
Markus
Hi Mike,
Quoted 4 lines
Additionally I identified some spooky highmem initialization in vendors SDK
prom.c. We never used that before. I added bootlog+code snippet to the github issue [1].
After checking and testing the vendor prom coding I finally found a solution to the highmem issue. A special mapping register needs to be setup prior to memory initialization. Fixed with [1].
Thanks for helping out here.
Markus
[1]
https://github.com/openwrt/openwrt/pull/21327/commits/02117c1e971b86244178437400ab8b2f6a81d2e8