From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hanjun Guo Subject: Re: [PATCH 09/19] ARM64 / ACPI: Move the initialization of cpu_logical_map(0) before acpi_boot_init() Date: Fri, 25 Jul 2014 18:39:08 +0800 Message-ID: <53D233CC.1070006@linaro.org> References: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> <1406206825-15590-10-git-send-email-hanjun.guo@linaro.org> <20140724152103.GB26190@leverpostej> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pd0-f177.google.com ([209.85.192.177]:43272 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751773AbaGYKkV (ORCPT ); Fri, 25 Jul 2014 06:40:21 -0400 Received: by mail-pd0-f177.google.com with SMTP id p10so5410862pdj.8 for ; Fri, 25 Jul 2014 03:40:20 -0700 (PDT) In-Reply-To: <20140724152103.GB26190@leverpostej> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Mark Rutland Cc: Catalin Marinas , "Rafael J. Wysocki" , "graeme.gregory@linaro.org" , Arnd Bergmann , "grant.likely@linaro.org" , Sudeep Holla , Will Deacon , Jason Cooper , Marc Zyngier , Bjorn Helgaas , Daniel Lezcano , Mark Brown , Robert Richter , Lv Zheng , Robert Moore , Lorenzo Pieralisi , Liviu Dudau , Randy Dunlap , Charles Garcia-Tobin , "linux-acpi@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" On 2014-7-24 23:21, Mark Rutland wrote: > On Thu, Jul 24, 2014 at 02:00:15PM +0100, Hanjun Guo wrote: >> Move the initialization of cpu_logical_map(0) before acpi_boot_init() >> to remove the duplicated initialization of cpu_logical_map(0). > > It always make sense to initialise CPU0's logical map entry from the > hardware values, so you could do this earlier in the series, before you > introduce any ACPI code. Then you don't have the churn in acpi.c ok, I will prepare a separate patch to do this before ACPI code, does it make sense to you? > >> >> Signed-off-by: Hanjun Guo >> --- >> arch/arm64/kernel/acpi.c | 3 --- >> arch/arm64/kernel/setup.c | 3 ++- >> 2 files changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c >> index 801e268..ff0f6a0 100644 >> --- a/arch/arm64/kernel/acpi.c >> +++ b/arch/arm64/kernel/acpi.c >> @@ -244,9 +244,6 @@ int __init acpi_boot_init(void) >> if (err) >> pr_err("Can't find FADT\n"); >> >> - /* Get the boot CPU's MPIDR before MADT parsing */ >> - cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; >> - >> err = acpi_parse_madt_gic_cpu_interface_entries(); >> >> return err; >> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c >> index e00d40c..17ab98e 100644 >> --- a/arch/arm64/kernel/setup.c >> +++ b/arch/arm64/kernel/setup.c >> @@ -394,13 +394,14 @@ void __init setup_arch(char **cmdline_p) >> >> efi_idmap_init(); >> >> + /* Get the boot CPU's MPIDR before cpu logical map is built */ > > That comment's a bit useless; I think it can just be dropped. > > All you need to do is move the initialisation of cpu_logical_map(0) > before unflatten_device_tree(). When you introduce acpi_boot_init(), > place it after the initialisation. ok, I agree with you, will update it. Thanks Hanjun From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760153AbaGYKkX (ORCPT ); Fri, 25 Jul 2014 06:40:23 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:45062 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759914AbaGYKkV (ORCPT ); Fri, 25 Jul 2014 06:40:21 -0400 Message-ID: <53D233CC.1070006@linaro.org> Date: Fri, 25 Jul 2014 18:39:08 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Mark Rutland CC: Catalin Marinas , "Rafael J. Wysocki" , "graeme.gregory@linaro.org" , Arnd Bergmann , "grant.likely@linaro.org" , Sudeep Holla , Will Deacon , Jason Cooper , Marc Zyngier , Bjorn Helgaas , Daniel Lezcano , Mark Brown , Robert Richter , Lv Zheng , Robert Moore , Lorenzo Pieralisi , Liviu Dudau , Randy Dunlap , Charles Garcia-Tobin , "linux-acpi@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 09/19] ARM64 / ACPI: Move the initialization of cpu_logical_map(0) before acpi_boot_init() References: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> <1406206825-15590-10-git-send-email-hanjun.guo@linaro.org> <20140724152103.GB26190@leverpostej> In-Reply-To: <20140724152103.GB26190@leverpostej> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2014-7-24 23:21, Mark Rutland wrote: > On Thu, Jul 24, 2014 at 02:00:15PM +0100, Hanjun Guo wrote: >> Move the initialization of cpu_logical_map(0) before acpi_boot_init() >> to remove the duplicated initialization of cpu_logical_map(0). > > It always make sense to initialise CPU0's logical map entry from the > hardware values, so you could do this earlier in the series, before you > introduce any ACPI code. Then you don't have the churn in acpi.c ok, I will prepare a separate patch to do this before ACPI code, does it make sense to you? > >> >> Signed-off-by: Hanjun Guo >> --- >> arch/arm64/kernel/acpi.c | 3 --- >> arch/arm64/kernel/setup.c | 3 ++- >> 2 files changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c >> index 801e268..ff0f6a0 100644 >> --- a/arch/arm64/kernel/acpi.c >> +++ b/arch/arm64/kernel/acpi.c >> @@ -244,9 +244,6 @@ int __init acpi_boot_init(void) >> if (err) >> pr_err("Can't find FADT\n"); >> >> - /* Get the boot CPU's MPIDR before MADT parsing */ >> - cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; >> - >> err = acpi_parse_madt_gic_cpu_interface_entries(); >> >> return err; >> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c >> index e00d40c..17ab98e 100644 >> --- a/arch/arm64/kernel/setup.c >> +++ b/arch/arm64/kernel/setup.c >> @@ -394,13 +394,14 @@ void __init setup_arch(char **cmdline_p) >> >> efi_idmap_init(); >> >> + /* Get the boot CPU's MPIDR before cpu logical map is built */ > > That comment's a bit useless; I think it can just be dropped. > > All you need to do is move the initialisation of cpu_logical_map(0) > before unflatten_device_tree(). When you introduce acpi_boot_init(), > place it after the initialisation. ok, I agree with you, will update it. Thanks Hanjun From mboxrd@z Thu Jan 1 00:00:00 1970 From: hanjun.guo@linaro.org (Hanjun Guo) Date: Fri, 25 Jul 2014 18:39:08 +0800 Subject: [PATCH 09/19] ARM64 / ACPI: Move the initialization of cpu_logical_map(0) before acpi_boot_init() In-Reply-To: <20140724152103.GB26190@leverpostej> References: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> <1406206825-15590-10-git-send-email-hanjun.guo@linaro.org> <20140724152103.GB26190@leverpostej> Message-ID: <53D233CC.1070006@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 2014-7-24 23:21, Mark Rutland wrote: > On Thu, Jul 24, 2014 at 02:00:15PM +0100, Hanjun Guo wrote: >> Move the initialization of cpu_logical_map(0) before acpi_boot_init() >> to remove the duplicated initialization of cpu_logical_map(0). > > It always make sense to initialise CPU0's logical map entry from the > hardware values, so you could do this earlier in the series, before you > introduce any ACPI code. Then you don't have the churn in acpi.c ok, I will prepare a separate patch to do this before ACPI code, does it make sense to you? > >> >> Signed-off-by: Hanjun Guo >> --- >> arch/arm64/kernel/acpi.c | 3 --- >> arch/arm64/kernel/setup.c | 3 ++- >> 2 files changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c >> index 801e268..ff0f6a0 100644 >> --- a/arch/arm64/kernel/acpi.c >> +++ b/arch/arm64/kernel/acpi.c >> @@ -244,9 +244,6 @@ int __init acpi_boot_init(void) >> if (err) >> pr_err("Can't find FADT\n"); >> >> - /* Get the boot CPU's MPIDR before MADT parsing */ >> - cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; >> - >> err = acpi_parse_madt_gic_cpu_interface_entries(); >> >> return err; >> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c >> index e00d40c..17ab98e 100644 >> --- a/arch/arm64/kernel/setup.c >> +++ b/arch/arm64/kernel/setup.c >> @@ -394,13 +394,14 @@ void __init setup_arch(char **cmdline_p) >> >> efi_idmap_init(); >> >> + /* Get the boot CPU's MPIDR before cpu logical map is built */ > > That comment's a bit useless; I think it can just be dropped. > > All you need to do is move the initialisation of cpu_logical_map(0) > before unflatten_device_tree(). When you introduce acpi_boot_init(), > place it after the initialisation. ok, I agree with you, will update it. Thanks Hanjun