summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-12-18 16:13:56 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-30 11:54:13 +0100
commit72b5a6ace8a8183c132f050f177e6d84a3c890e9 (patch)
treea5a7922f6cfbc9e1e166534ec650f7c140ddf78c /arch
parent0b3ade0b86865046ea07173011372cc9c5874773 (diff)
RISC-V: Fix usage of memblock_enforce_memory_limit
commit de043da0b9e71147ca610ed542d34858aadfc61c upstream. 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: stable@vger.kernel.org Reported-by: Bin Meng <bin.meng@windriver.com> Tested-by: Bin Meng <bin.meng@windriver.com> Acked-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-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 8e577f14f120..e4133c20744c 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -174,7 +174,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);