Skip to content

[qcom-next] lib: lmb: return -EFAULT for partial bank-boundary overlap - #137

Open
balajiselvanathan wants to merge 1 commit into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:lmb-correct
Open

balajiselvanathan wants to merge 1 commit into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:lmb-correct

Conversation

@balajiselvanathan

@balajiselvanathan balajiselvanathan commented Sep 7, 2026

Copy link
Copy Markdown

_lmb_alloc_addr() currently returns -EINVAL when a reservation overlaps
an available memory bank but extends beyond the bank boundary. It
returns -EFAULT when the reservation does not overlap any available
memory bank.

From LMB's perspective, neither request can be satisfied because the
requested reservation is not fully contained within an available region.
Callers therefore cannot make practical use of the distinction.

boot_fdt_handle_region() treats -EFAULT as a non-fatal condition and
silently skips the reservation, while -EINVAL causes a boot-time error
message to be printed. For bank-boundary overlap cases this message is
misleading because no internal LMB error has occurred; the reservation
simply does not fit within available memory.

Return -EFAULT for the partial-overlap case as well and update the
corresponding unit tests.

Upstream link: https://lore.kernel.org/u-boot/20260912-lmb-alloc-addr-efault-v2-1-0a796adfd99d@oss.qualcomm.com/

_lmb_alloc_addr() currently returns -EINVAL when a reservation overlaps
an available memory bank but extends beyond the bank boundary. It
returns -EFAULT when the reservation does not overlap any available
memory bank.

From LMB's perspective, neither request can be satisfied because the
requested reservation is not fully contained within an available region.
Callers therefore cannot make practical use of the distinction.

boot_fdt_handle_region() treats -EFAULT as a non-fatal condition and
silently skips the reservation, while -EINVAL causes a boot-time error
message to be printed. For bank-boundary overlap cases this message is
misleading because no internal LMB error has occurred; the reservation
simply does not fit within available memory.

Return -EFAULT for the partial-overlap case as well and update the
corresponding unit tests.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant