lmb: handle scenario of encompassing overlap
authorSughosh Ganu <sughosh.ganu@linaro.org>
Mon, 3 Mar 2025 13:32:27 +0000 (19:02 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 18 Mar 2025 01:39:27 +0000 (19:39 -0600)
commite0a7ea3725d8931a2c31f29ed665ec1f22e37172
tree3171e10102a3044abde7ca1449aaa57ee75e15a4
parent56f186a68b35e8b45136fd44b69c554a0bb0ce35
lmb: handle scenario of encompassing overlap

The lmb_fix_over_lap_regions() function is called if the added region
overlaps with an existing region. The function then fixes the overlap
and removes the redundant region. However, it makes certain
assumptions. One assumption is that the overlap would not encompass
the existing region. Another assumption is that the overlap only
occurs between two regions -- the scenario of the added region
overlapping multiple existing regions is not being handled. Handle
these cases by instead calling lmb_resize_regions(). Also remove the
now superfluous lmb_fix_over_lap_regions().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/lmb.c