Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1348592 > unrolled thread

[PATCH v13 4/6] arm64: Move unflatten_device_tree() call earlier.

Started byDavid Daney <ddaney.cavm@gmail.com>
First post2016-03-03 00:00 +0100
Last post2016-03-03 17:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v13 4/6] arm64: Move unflatten_device_tree() call earlier. David Daney <ddaney.cavm@gmail.com> - 2016-03-03 00:00 +0100
    Re: [PATCH v13 4/6] arm64: Move unflatten_device_tree() call earlier. Rob Herring <robh+dt@kernel.org> - 2016-03-03 14:50 +0100
      Re: [PATCH v13 4/6] arm64: Move unflatten_device_tree() call earlier. Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-03 17:40 +0100

#1348592 — [PATCH v13 4/6] arm64: Move unflatten_device_tree() call earlier.

FromDavid Daney <ddaney.cavm@gmail.com>
Date2016-03-03 00:00 +0100
Subject[PATCH v13 4/6] arm64: Move unflatten_device_tree() call earlier.
Message-ID<r8nUn-6fn-23@gated-at.bofh.it>
From: David Daney <david.daney@cavium.com>

In order to extract NUMA information from the device tree, we need to
have the tree in its unflattened form.

Move the call to unflatten_device_tree() into paging_init().  This
puts it before the call to bootmem_init(), which is where the NUMA
information is extracted.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/arm64/kernel/setup.c | 7 +++----
 arch/arm64/mm/mmu.c       | 5 +++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 8119479..feae073 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -328,12 +328,11 @@ void __init setup_arch(char **cmdline_p)
 
 	early_ioremap_reset();
 
-	if (acpi_disabled) {
-		unflatten_device_tree();
+	if (acpi_disabled)
 		psci_dt_init();
-	} else {
+	else
 		psci_acpi_init();
-	}
+
 	xen_early_init();
 
 	cpu_read_bootcpu_ops();
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 58faeaa..ee6e6b0 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -29,6 +29,8 @@
 #include <linux/io.h>
 #include <linux/slab.h>
 #include <linux/stop_machine.h>
+#include <linux/acpi.h>
+#include <linux/of_fdt.h>
 
 #include <asm/cputype.h>
 #include <asm/fixmap.h>
@@ -459,6 +461,9 @@ void __init paging_init(void)
 	map_mem();
 	fixup_executable();
 
+	if (acpi_disabled)
+		unflatten_device_tree();
+
 	/* allocate the zero page. */
 	zero_page = early_alloc(PAGE_SIZE);
 
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1349165

FromRob Herring <robh+dt@kernel.org>
Date2016-03-03 14:50 +0100
Message-ID<r8BND-7MX-5@gated-at.bofh.it>
In reply to#1348592
On Wed, Mar 2, 2016 at 4:56 PM, David Daney <ddaney.cavm@gmail.com> wrote:
> From: David Daney <david.daney@cavium.com>
>
> In order to extract NUMA information from the device tree, we need to
> have the tree in its unflattened form.
>
> Move the call to unflatten_device_tree() into paging_init().  This
> puts it before the call to bootmem_init(), which is where the NUMA
> information is extracted.

Can't you just move up unflatten_device_tree in setup_arch rather than
hiding in paging_init?

> Signed-off-by: David Daney <david.daney@cavium.com>
> ---
>  arch/arm64/kernel/setup.c | 7 +++----
>  arch/arm64/mm/mmu.c       | 5 +++++
>  2 files changed, 8 insertions(+), 4 deletions(-)

[toc] | [prev] | [next] | [standalone]


#1349349

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2016-03-03 17:40 +0100
Message-ID<r8Esa-1q6-15@gated-at.bofh.it>
In reply to#1349165
On 3 March 2016 at 17:33, David Daney <ddaney@caviumnetworks.com> wrote:
> On 03/03/2016 05:47 AM, Rob Herring wrote:
>>
>> On Wed, Mar 2, 2016 at 4:56 PM, David Daney <ddaney.cavm@gmail.com> wrote:
>>>
>>> From: David Daney <david.daney@cavium.com>
>>>
>>> In order to extract NUMA information from the device tree, we need to
>>> have the tree in its unflattened form.
>>>
>>> Move the call to unflatten_device_tree() into paging_init().  This
>>> puts it before the call to bootmem_init(), which is where the NUMA
>>> information is extracted.
>>
>>
>> Can't you just move up unflatten_device_tree in setup_arch rather than
>> hiding in paging_init?
>
>
> No.
>
> It must come *after* map_mem() and *before* bootmem_init(), both of which
> are done within paging_init().
>
> One option would be to split the things in paging_init() into two functions,
> and then do:
>
> .
> .
> .
>    paging_init_first_part();
>    if (acpi_disabled)
>        unflatten_device_tree();
>    paging_init_second_part();
> .

I think it makes more sense to move bootmem_init() to setup_arch() then

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web