[qcom-next] boot: image-fdt: Restore suppression of irrelevant ERROR message - #114
Merged
Gopinath Sekar (g-sekar) merged 3 commits intoAug 14, 2026
Conversation
lmb_alloc_addr() is documented to return -EINVAL when the requested memory region is not part of the LMB memory map. However, -EINVAL is also used to e.g. indicate that a NULL pointer is passed as the addr parameter or when the requested memory region partially overlaps an existing region. Change lmb_alloc_addr() to return -EFAULT when the requested memory region is not part of the LMB memory map to make the type of error known to callers. Also extend unit tests to validate that the return code has stay the same when the requested memory region partially overlaps. No caller of lmb_alloc_addr() is checking what type of error code is returned, so this change has no intended behavior change. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Randolph Sapp <rs@ti.com> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Make lmb_free() return -EFAULT when the requested memory region is not allocated, instead of the generic -1 error value. Document the updated error code in the public API comment and change the LMB unit test to check for the new -EFAULT errno value. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Randolph Sapp <rs@ti.com> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
The commit 623f6c5 ("boot: image-fdt: free old dtb reservations") removed the suppression of ERROR messages when -EINVAL was returned due to the memory region not being part of the LMB memory map. This causes an irrelevant ERROR message during boot, e.g.: Model: Radxa ROCK 3B [...] ERROR: reserving fdt memory region failed (addr=10f000 size=100 flags=2): -22 or Model: Rockchip RK3288 Asus Tinker Board S [...] ERROR: reserving fdt memory region failed (addr=fe000000 size=1000000 flags=4): -22 FDT correctly contains reserved-memory for 10f000 or fe000000 and U-Boot correctly does not make these regions available in the LMB memory map: memory[0] [0x200000-0xefffffff], 0xefe00000 bytes, flags: none memory[1] [0x100000000-0x1ffffffff], 0x100000000 bytes, flags: none or memory[0] [0x0-0x7fffffff], 0x80000000 bytes, flags: none With lmb_alloc_mem() and lmb_free() both returning -EFAULT when the requested memory region is not part of the LMB memory map it should be safe to ignore these errors when FDT memreserve and reserved-memory is being processed. Print -EFAULT errors using a debug message to restore suppression of this irrelevant ERROR message when memory region is not part of the LMB memory map. Fixes: 623f6c5 ("boot: image-fdt: free old dtb reservations") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Randolph Sapp <rs@ti.com> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
varada-qcom
approved these changes
Aug 13, 2026
Gopinath Sekar (g-sekar)
merged commit Aug 14, 2026
004bd0e
into
qualcomm-linux:qcom-next
2 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series changes the returned error code for lmb_alloc_mem() and
lmb_free() may return to help restore suppression of the verbose ERROR
messages when FDT memreserve and reserved-memory is being processed.
Upstream link: https://lore.kernel.org/u-boot/20260811231650.3150771-1-jonas@kwiboo.se/