aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <[email protected]>2021-10-18 15:15:45 -0700
committerLinus Torvalds <[email protected]>2021-10-18 20:22:03 -1000
commit5173ed72bcfcddda21ff274ee31c6472fa150f29 (patch)
treed93b6b01805b04628a733f811165fdf274cad25a
parentb15fa9224e6e1239414525d8d556d824701849fc (diff)
memblock: check memory total_size
mem=[X][G|M] is broken on ARM64 platform, there are cases that even type.cnt is 1, but total_size is not 0 because regions are merged into 1. So only check 'cnt' is not enough, total_size should be used, othersize bootargs 'mem=[X][G|B]' not work anymore. Link: https://lkml.kernel.org/r/[email protected] Fixes: e888fa7bb882 ("memblock: Check memory add/cap ordering") Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Mike Rapoport <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: David Hildenbrand <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memblock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 5c3503c98b2f..b91df5cf54d3 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1692,7 +1692,7 @@ void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size)
if (!size)
return;
- if (memblock.memory.cnt <= 1) {
+ if (!memblock_memory->total_size) {
pr_warn("%s: No memory registered yet\n", __func__);
return;
}