Re: [PATCH v2 1/2] kho: skip bootmem setup in kho_init() if bootmem was inherited
From: Chris Down
Date: Wed Dec 02 2026 - 21:58:30 EST
Hi Pratyush,
Pratyush Yadav writes:
>Nit: I don't understand what "even if handover is dropped later" means.
>Doesn't the handover get dropped _before_ kho_init()?
>
>Also, perhaps "even if the handover fails" is better?
Yeah, it does, so "later" is wrong there. I'll change it to "even if the
handover failed" in v3.
>kho_memory_init_early() clears kho_in.bootmem_phys on failure. So this
>doesn't work. It clears it because kho_memory_init() uses to check if it
>should even try to retrieve preserved memory.
>
>Perhaps it should only clear fdt_phys and kho_memory_init() should check
>fdt_phys instead?
Good catch, thanks. I'll do that in v3. kho_memory_init() will also have
to skip kho_reserve_bootmem() in that case, otherwise it reserves new
areas that kho_init() then never releases.
While looking at that I noticed that kho_account_incoming_bootmem() and
kho_init()'s error path still check is_kho_boot() as well, so v3 will
switch those over too.
Thanks!
Chris