Re: [PATCH] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory
From: Florian Fainelli
Date: Fri Oct 16 2026 - 17:17:31 EST
On 10/16/26 12:45, Matthew Wilcox wrote:
On Fri, Oct 16, 2026 at 10:31:55AM -0700, Florian Fainelli wrote:
Alchemy keeps pointers into the firmware environment and looks up ethaddr
when initializing the Ethernet devices. By that point, memory allocation
can have overwritten the environment, causing prom_getenv() to pass an
invalid pointer to strchr() and panic during boot.
On the MTX-1, the struct page layout change in 9ddb3c14afba reduces struct
page from 40 to 32 bytes and exposes this unreserved firmware memory.
Bisection and boot tests confirmed that the parent boots while the change
reproduces the panic.
Parse the Ethernet address during prom_init(), before registering RAM
with memblock, and keep the six bytes in kernel-owned init data. Return
the saved address during device initialization, preserving the existing
YAMON formats and command-line fallback without reserving a fixed
low-memory region.
Fixes: 9ddb3c14afba ("mm: fix struct page layout on 32-bit systems")
This is an inappropriate Fixes line. That may have exposed the problem
(... 5 years ago; how often is this being tested?) but it's merely
restoring the layout to that which existed two years before that.
The correct Fixes line wuld be something related to this driver.
Fair enough, because this landed as a the first bad commit, I used it as is, but you have a good point about this being a pre-existing issue that just became apparent with 9ddb3c14afba.
As for how often the platform was tested, not very often clearly, but that's about to change since I have it restored in my test rack.
Thanks
--
Florian