[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <57f7439888a99002285da8114d4a99baa676e865.1577694824.git.greentime.hu@sifive.com>
Date: Fri, 10 Jan 2020 18:46:25 +0800
From: Greentime Hu <greentime.hu@...ive.com>
To: greentime.hu@...ive.com, greentime@...nel.org, anup@...infault.org,
palmer@...belt.com, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org, rppt@...ux.ibm.com,
gkulkarni@...vell.com, will@...nel.org, catalin.marinas@....com,
mark.rutland@....com, paul.walmsley@...ive.com, hch@....de
Subject: [RFC PATCH v2 2/4] riscv: Move unflatten_device_tree() to paging_init() because riscv_numa_init() needs the dt information.
It is moved to paging_init() is because that of_numa_init() will use
of_numa_parse_cpu_nodes() and of_numa_parse_memory_nodes(). We have to
unflatten_device_tree() first then we can call riscv_numa_init(), but
riscv_numa_init() shall be called before memblocks_present() because the
node information will be used in memblocks_present().
So the calling order will be looked like this.
unflatten_device_tree(); //To get dt information for memory and nodes
riscv_numa_init(); //It can use of_numa_parse_* and set the nodes information
memblocks_present(); //The node information can be used now
Signed-off-by: Greentime Hu <greentime.hu@...ive.com>
---
arch/riscv/kernel/setup.c | 1 -
arch/riscv/mm/init.c | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 365ff8420bfe..bcd85f502fb2 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -67,7 +67,6 @@ void __init setup_arch(char **cmdline_p)
setup_bootmem();
paging_init();
- unflatten_device_tree();
clint_init_boot_cpu();
#ifdef CONFIG_SWIOTLB
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 69f6678db7f3..fbe69fe47806 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -491,6 +491,7 @@ static inline void setup_vm_final(void)
void __init paging_init(void)
{
setup_vm_final();
+ unflatten_device_tree();
memblocks_present();
sparse_init();
setup_zero_page();
--
2.17.1
Powered by blists - more mailing lists