lmb: notify when adjacent regions are added

lmb_add_region() returns a positive integer if the added regions causes
existing regions to be coalesced. We still want to notify the EFI
subsystem about these added regions though, so adjust lmb_add() to only
bail on errors.

This fixes EFI memory allocation on boards with adjacent memory banks as is the
case on several Qualcomm boards like the RB3 Gen 2.

Fixes: 2f6191526a (lmb: notify of any changes to the LMB memory map)
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Caleb Connolly
2024-10-18 15:51:07 +02:00
committed by Tom Rini
parent 8ab2178de0
commit 491195769d

View File

@@ -487,7 +487,7 @@ long lmb_add(phys_addr_t base, phys_size_t size)
struct alist *lmb_rgn_lst = &lmb.free_mem;
ret = lmb_add_region(lmb_rgn_lst, base, size);
if (ret)
if (ret < 0)
return ret;
if (lmb_should_notify(LMB_NONE))