diff mbox

[v5,01/18] ARM64: Move the init of cpu_logical_map(0) before unflatten_device_tree()

Message ID 1413553034-20956-2-git-send-email-hanjun.guo@linaro.org
State New
Headers show

Commit Message

Hanjun Guo Oct. 17, 2014, 1:36 p.m. UTC
It always make sense to initialize CPU0's logical map entry from the
hardware values, so move the initialization of cpu_logical_map(0)
before unflatten_device_tree() which is needed by ACPI code later.

Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 arch/arm64/kernel/setup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hanjun Guo Nov. 18, 2014, 1:45 p.m. UTC | #1
Hi Catalin,

On 2014年10月17日 21:36, Hanjun Guo wrote:
> It always make sense to initialize CPU0's logical map entry from the
> hardware values, so move the initialization of cpu_logical_map(0)
> before unflatten_device_tree() which is needed by ACPI code later.
>
> Acked-by: Olof Johansson <olof@lixom.net>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>

Could you merge this patch first in 3.19? It was acked by Olof and
Mark, and it will make sense without ACPI too.

Thanks
Hanjun

> ---
>   arch/arm64/kernel/setup.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index edb146d..8f33f72 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -393,11 +393,11 @@ void __init setup_arch(char **cmdline_p)
>
>   	efi_idmap_init();
>
> +	cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
>   	unflatten_device_tree();
>
>   	psci_init();
>
> -	cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
>   	cpu_read_bootcpu_ops();
>   #ifdef CONFIG_SMP
>   	smp_init_cpus();
>
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Catalin Marinas Nov. 18, 2014, 4:43 p.m. UTC | #2
On Tue, Nov 18, 2014 at 01:45:49PM +0000, Hanjun Guo wrote:
> On 2014年10月17日 21:36, Hanjun Guo wrote:
> > It always make sense to initialize CPU0's logical map entry from the
> > hardware values, so move the initialization of cpu_logical_map(0)
> > before unflatten_device_tree() which is needed by ACPI code later.
> >
> > Acked-by: Olof Johansson <olof@lixom.net>
> > Acked-by: Mark Rutland <mark.rutland@arm.com>
> > Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> 
> Could you merge this patch first in 3.19? It was acked by Olof and
> Mark, and it will make sense without ACPI too.

I think it can go in for 3.19 (it's Will's turn this time ;)).

FWIW:

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Will Deacon Nov. 18, 2014, 4:57 p.m. UTC | #3
On Tue, Nov 18, 2014 at 04:43:13PM +0000, Catalin Marinas wrote:
> On Tue, Nov 18, 2014 at 01:45:49PM +0000, Hanjun Guo wrote:
> > On 2014年10月17日 21:36, Hanjun Guo wrote:
> > > It always make sense to initialize CPU0's logical map entry from the
> > > hardware values, so move the initialization of cpu_logical_map(0)
> > > before unflatten_device_tree() which is needed by ACPI code later.
> > >
> > > Acked-by: Olof Johansson <olof@lixom.net>
> > > Acked-by: Mark Rutland <mark.rutland@arm.com>
> > > Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> > 
> > Could you merge this patch first in 3.19? It was acked by Olof and
> > Mark, and it will make sense without ACPI too.
> 
> I think it can go in for 3.19 (it's Will's turn this time ;)).

This patch doesn't apply on for-next/core, as it conflicts with some of
Rutland's rework ("arm64: log physical ID of boot CPU").

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sudeep Holla Nov. 18, 2014, 5:02 p.m. UTC | #4
Hi Will,

I was writing to reply to Catalin's mail :)

On 18/11/14 16:57, Will Deacon wrote:
> On Tue, Nov 18, 2014 at 04:43:13PM +0000, Catalin Marinas wrote:
>> On Tue, Nov 18, 2014 at 01:45:49PM +0000, Hanjun Guo wrote:
>>> On 2014年10月17日 21:36, Hanjun Guo wrote:
>>>> It always make sense to initialize CPU0's logical map entry from the
>>>> hardware values, so move the initialization of cpu_logical_map(0)
>>>> before unflatten_device_tree() which is needed by ACPI code later.
>>>>
>>>> Acked-by: Olof Johansson <olof@lixom.net>
>>>> Acked-by: Mark Rutland <mark.rutland@arm.com>
>>>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>
>>> Could you merge this patch first in 3.19? It was acked by Olof and
>>> Mark, and it will make sense without ACPI too.
>>
>> I think it can go in for 3.19 (it's Will's turn this time ;)).
>
> This patch doesn't apply on for-next/core, as it conflicts with some of
> Rutland's rework ("arm64: log physical ID of boot CPU").
>

It's actually not required anymore, as "arm64: log physical ID of boot
CPU" move it quite early in the sequence from setup_arch to
smp_setup_processor_id while this patch just moves it up in setup_arch.

Regards,
Sudeep


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Will Deacon Nov. 18, 2014, 5:03 p.m. UTC | #5
On Tue, Nov 18, 2014 at 05:02:05PM +0000, Sudeep Holla wrote:
> On 18/11/14 16:57, Will Deacon wrote:
> > On Tue, Nov 18, 2014 at 04:43:13PM +0000, Catalin Marinas wrote:
> >> On Tue, Nov 18, 2014 at 01:45:49PM +0000, Hanjun Guo wrote:
> >>> On 2014年10月17日 21:36, Hanjun Guo wrote:
> >>>> It always make sense to initialize CPU0's logical map entry from the
> >>>> hardware values, so move the initialization of cpu_logical_map(0)
> >>>> before unflatten_device_tree() which is needed by ACPI code later.
> >>>>
> >>>> Acked-by: Olof Johansson <olof@lixom.net>
> >>>> Acked-by: Mark Rutland <mark.rutland@arm.com>
> >>>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> >>>
> >>> Could you merge this patch first in 3.19? It was acked by Olof and
> >>> Mark, and it will make sense without ACPI too.
> >>
> >> I think it can go in for 3.19 (it's Will's turn this time ;)).
> >
> > This patch doesn't apply on for-next/core, as it conflicts with some of
> > Rutland's rework ("arm64: log physical ID of boot CPU").
> >
> 
> It's actually not required anymore, as "arm64: log physical ID of boot
> CPU" move it quite early in the sequence from setup_arch to
> smp_setup_processor_id while this patch just moves it up in setup_arch.

Thanks Sudeep, I'd guessed as much :)

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hanjun Guo Nov. 19, 2014, 12:29 a.m. UTC | #6
On 2014-11-19 1:03, Will Deacon wrote:
> On Tue, Nov 18, 2014 at 05:02:05PM +0000, Sudeep Holla wrote:
>> On 18/11/14 16:57, Will Deacon wrote:
>>> On Tue, Nov 18, 2014 at 04:43:13PM +0000, Catalin Marinas wrote:
>>>> On Tue, Nov 18, 2014 at 01:45:49PM +0000, Hanjun Guo wrote:
>>>>> On 2014年10月17日 21:36, Hanjun Guo wrote:
>>>>>> It always make sense to initialize CPU0's logical map entry from the
>>>>>> hardware values, so move the initialization of cpu_logical_map(0)
>>>>>> before unflatten_device_tree() which is needed by ACPI code later.
>>>>>>
>>>>>> Acked-by: Olof Johansson <olof@lixom.net>
>>>>>> Acked-by: Mark Rutland <mark.rutland@arm.com>
>>>>>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>
>>>>> Could you merge this patch first in 3.19? It was acked by Olof and
>>>>> Mark, and it will make sense without ACPI too.
>>>>
>>>> I think it can go in for 3.19 (it's Will's turn this time ;)).
>>>
>>> This patch doesn't apply on for-next/core, as it conflicts with some of
>>> Rutland's rework ("arm64: log physical ID of boot CPU").
>>>
>>
>> It's actually not required anymore, as "arm64: log physical ID of boot
>> CPU" move it quite early in the sequence from setup_arch to
>> smp_setup_processor_id while this patch just moves it up in setup_arch.
> 
> Thanks Sudeep, I'd guessed as much :)

That's great, thanks for the reminding, I will drop this one.

Best regards
Hanjun

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index edb146d..8f33f72 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -393,11 +393,11 @@  void __init setup_arch(char **cmdline_p)
 
 	efi_idmap_init();
 
+	cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
 	unflatten_device_tree();
 
 	psci_init();
 
-	cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
 	cpu_read_bootcpu_ops();
 #ifdef CONFIG_SMP
 	smp_init_cpus();