From: Serge Semin <fancer.lancer@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>,
Paul Burton <paul.burton@mips.com>,
James Hogan <jhogan@kernel.org>,
Mike Rapoport <rppt@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Bogendoerfer <tbogendoerfer@suse.de>,
Huacai Chen <chenhc@lemote.com>, Stefan Agner <stefan@agner.ch>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Juergen Gross <jgross@suse.com>
Cc: Serge Semin <Sergey.Semin@t-platforms.ru>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/5] mips: Manually call fdt_init_reserved_mem() method
Date: Fri, 3 May 2019 20:50:41 +0300 [thread overview]
Message-ID: <20190503175041.7949-6-fancer.lancer@gmail.com> (raw)
In-Reply-To: <20190503175041.7949-1-fancer.lancer@gmail.com>
Since memblock-patchset was introduced the reserved-memory nodes are
supported being declared in dt-files. So these nodes are actually parsed
during the arch setup procedure when the early_init_fdt_scan_reserved_mem()
method is called. But due to the arch-specific boot mem_map container
utilization we need to manually call the fdt_init_reserved_mem() method
after all the available and reserved memory has been moved to memblock.
The first function call performed before bootmem_init() by the
early_init_fdt_scan_reserved_mem() routine fails due to the lack of any
memblock memory regions to allocate from at that stage.
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
---
Changelog v2
- Discard forcible selection of OF_RESERVED_MEM config
---
arch/mips/kernel/setup.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index fbd216b4e929..ab349d2381c3 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -27,6 +27,7 @@
#include <linux/dma-contiguous.h>
#include <linux/decompress/generic.h>
#include <linux/of_fdt.h>
+#include <linux/of_reserved_mem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
@@ -825,6 +826,8 @@ static void __init arch_mem_init(char **cmdline_p)
memblock_reserve(__pa_symbol(&__nosave_begin),
__pa_symbol(&__nosave_end) - __pa_symbol(&__nosave_begin));
+ fdt_init_reserved_mem();
+
memblock_dump_all();
early_memtest(PFN_PHYS(min_low_pfn), PFN_PHYS(max_low_pfn));
--
2.21.0
next prev parent reply other threads:[~2019-05-03 17:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 17:50 [PATCH v2 0/5] mips: Post-bootmem-memblock transition fixes Serge Semin
2019-05-03 17:50 ` [PATCH v2 1/5] mips: Dump memblock regions for debugging Serge Semin
2019-05-06 19:11 ` Paul Burton
2019-05-03 17:50 ` [PATCH v2 2/5] mips: Perform early low memory test Serge Semin
2019-05-06 19:11 ` Paul Burton
2019-05-03 17:50 ` [PATCH v2 3/5] mips: Print the kernel virtual mem layout on debugging Serge Semin
2019-05-06 19:14 ` Paul Burton
2019-05-07 22:36 ` Serge Semin
2019-05-07 22:41 ` Paul Burton
2019-05-07 23:38 ` Serge Semin
2019-06-17 13:39 ` Serge Semin
2019-05-07 23:03 ` [PATCH v3] " Serge Semin
2019-05-03 17:50 ` [PATCH v2 4/5] mips: Make sure dt memory regions are valid Serge Semin
2019-05-06 19:12 ` Paul Burton
2019-05-03 17:50 ` Serge Semin [this message]
2019-05-06 19:12 ` [PATCH v2 5/5] mips: Manually call fdt_init_reserved_mem() method Paul Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190503175041.7949-6-fancer.lancer@gmail.com \
--to=fancer.lancer@gmail.com \
--cc=Sergey.Semin@t-platforms.ru \
--cc=akpm@linux-foundation.org \
--cc=alexandre.belloni@bootlin.com \
--cc=chenhc@lemote.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgross@suse.com \
--cc=jhogan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=paul.burton@mips.com \
--cc=ralf@linux-mips.org \
--cc=rppt@linux.ibm.com \
--cc=sfr@canb.auug.org.au \
--cc=stefan@agner.ch \
--cc=tbogendoerfer@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).