summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/setup.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-10-05 22:37:23 +0200
committerDavid S. Miller <davem@davemloft.net>2019-10-05 22:37:23 +0200
commit6f4c930e02355664d89c976eccea5d999a90de16 (patch)
treebc08932fbf43b9560ba5bde3284674054e3b56eb /arch/mips/kernel/setup.c
parentnet: dsa: sja1105: Make function sja1105_xfer_long_buf static (diff)
parentMerge tag 'kbuild-fixes-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
downloadlinux-6f4c930e02355664d89c976eccea5d999a90de16.tar.xz
linux-6f4c930e02355664d89c976eccea5d999a90de16.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'arch/mips/kernel/setup.c')
-rw-r--r--arch/mips/kernel/setup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index b8249c233754..5eec13b8d222 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -108,6 +108,9 @@ void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type)
return;
}
+ if (start < PHYS_OFFSET)
+ return;
+
memblock_add(start, size);
/* Reserve any memory except the ordinary RAM ranges. */
switch (type) {
@@ -321,7 +324,7 @@ static void __init bootmem_init(void)
* Reserve any memory between the start of RAM and PHYS_OFFSET
*/
if (ramstart > PHYS_OFFSET)
- memblock_reserve(PHYS_OFFSET, PFN_UP(ramstart) - PHYS_OFFSET);
+ memblock_reserve(PHYS_OFFSET, ramstart - PHYS_OFFSET);
if (PFN_UP(ramstart) > ARCH_PFN_OFFSET) {
pr_info("Wasting %lu bytes for tracking %lu unused pages\n",