aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtish Patra <[email protected]>2020-12-18 16:13:56 -0800
committerPalmer Dabbelt <[email protected]>2020-12-21 21:02:14 -0800
commitde043da0b9e71147ca610ed542d34858aadfc61c (patch)
treedf0bafd5de234744423ec2bacbfca4f459216c49
parente2ae634014d3a8839a99f8897b3f6346a133a33b (diff)
RISC-V: Fix usage of memblock_enforce_memory_limit
memblock_enforce_memory_limit accepts the maximum memory size not the maximum address that can be handled by kernel. Fix the function invocation accordingly. Fixes: 1bd14a66ee52 ("RISC-V: Remove any memblock representing unusable memory area") Cc: [email protected] Reported-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]> Acked-by: Mike Rapoport <[email protected]> Signed-off-by: Atish Patra <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
-rw-r--r--arch/riscv/mm/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 13ba533f462b..bf5379135e39 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -176,7 +176,7 @@ void __init setup_bootmem(void)
* Make sure that any memory beyond mem_start + (-PAGE_OFFSET) is removed
* as it is unusable by kernel.
*/
- memblock_enforce_memory_limit(mem_start - PAGE_OFFSET);
+ memblock_enforce_memory_limit(-PAGE_OFFSET);
/* Reserve from the start of the kernel to the end of the kernel */
memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);