* [RFC patch] MIPS/netlogic: dont setup boot CPU twice
@ 2011-08-04 14:55 Hillf Danton
[not found] ` <CA+7sy7B7-zTr4MojT+7C+AD4+ap4aiiJKX4u+fOPzR52yEJGJA@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Hillf Danton @ 2011-08-04 14:55 UTC (permalink / raw)
To: Ralf Baechle, LKML
When do smp setup, check for boot CPU is added, then it is impossible to be
initialized twice.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
arch/mips/netlogic/xlr/smp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/mips/netlogic/xlr/smp.c b/arch/mips/netlogic/xlr/smp.c
index b495a7f..e6f8c62 100644
--- a/arch/mips/netlogic/xlr/smp.c
+++ b/arch/mips/netlogic/xlr/smp.c
@@ -167,6 +167,8 @@ void __init nlm_smp_setup(void)
num_cpus = 1;
for (i = 0; i < NR_CPUS; i++) {
+ if (i == boot_cpu)
+ continue;
if (nlm_cpu_ready[i]) {
cpu_set(i, phys_cpu_present_map);
__cpu_number_map[i] = num_cpus;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC patch] MIPS/netlogic: dont setup boot CPU twice
[not found] ` <CA+7sy7B7-zTr4MojT+7C+AD4+ap4aiiJKX4u+fOPzR52yEJGJA@mail.gmail.com>
@ 2011-08-04 18:51 ` Jayachandran C.
2011-08-05 13:43 ` Hillf Danton
0 siblings, 1 reply; 4+ messages in thread
From: Jayachandran C. @ 2011-08-04 18:51 UTC (permalink / raw)
To: Hillf Danton; +Cc: Ralf Baechle, LKML, linux-mips
>
> When do smp setup, check for boot CPU is added, then it is impossible to be
> initialized twice.
>
> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> ---
> arch/mips/netlogic/xlr/smp.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/mips/netlogic/xlr/smp.c b/arch/mips/netlogic/xlr/smp.c
> index b495a7f..e6f8c62 100644
> --- a/arch/mips/netlogic/xlr/smp.c
> +++ b/arch/mips/netlogic/xlr/smp.c
> @@ -167,6 +167,8 @@ void __init nlm_smp_setup(void)
>
> num_cpus = 1;
> for (i = 0; i < NR_CPUS; i++) {
> + if (i == boot_cpu)
> + continue;
> if (nlm_cpu_ready[i]) {
> cpu_set(i, phys_cpu_present_map);
> __cpu_number_map[i] = num_cpus;
The nlm_cpu_ready[] entry is not set for the boot_cpu, it is set for only
the secondary cpus in smpboot.S. The code works as it is, but your patch
makes it more explicit.
My only commnet is that it might look better if you combine both the if checks.
JC.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC patch] MIPS/netlogic: dont setup boot CPU twice
2011-08-04 18:51 ` Jayachandran C.
@ 2011-08-05 13:43 ` Hillf Danton
2011-08-20 13:55 ` Ralf Baechle
0 siblings, 1 reply; 4+ messages in thread
From: Hillf Danton @ 2011-08-05 13:43 UTC (permalink / raw)
To: Jayachandran C.; +Cc: Ralf Baechle, LKML, linux-mips
On Fri, Aug 5, 2011 at 2:51 AM, Jayachandran C.
<jayachandranc@netlogicmicro.com> wrote:
> The nlm_cpu_ready[] entry is not set for the boot_cpu, it is set for only
> the secondary cpus in smpboot.S. The code works as it is, but your patch
> makes it more explicit.
>
> My only commnet is that it might look better if you combine both the if checks.
>
Got and thanks. It is recooked as the following.
Hillf
------------------------------------------------------------------------------
Subject: [RFC patch] MIPS/netlogic: add comment for smp setup
It seems that BSP could be setup twice, but the nlm_cpu_ready array is only
set for ASPs in smpboot.S, not including BSP.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
arch/mips/netlogic/xlr/smp.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/mips/netlogic/xlr/smp.c b/arch/mips/netlogic/xlr/smp.c
index b495a7f..b82667c 100644
--- a/arch/mips/netlogic/xlr/smp.c
+++ b/arch/mips/netlogic/xlr/smp.c
@@ -167,6 +167,10 @@ void __init nlm_smp_setup(void)
num_cpus = 1;
for (i = 0; i < NR_CPUS; i++) {
+ /*
+ * BSP is not set in nlm_cpu_ready array, it is only for
+ * ASPs (goto see smpboot.S)
+ */
if (nlm_cpu_ready[i]) {
cpu_set(i, phys_cpu_present_map);
__cpu_number_map[i] = num_cpus;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC patch] MIPS/netlogic: dont setup boot CPU twice
2011-08-05 13:43 ` Hillf Danton
@ 2011-08-20 13:55 ` Ralf Baechle
0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2011-08-20 13:55 UTC (permalink / raw)
To: Hillf Danton; +Cc: Jayachandran C., LKML, linux-mips
Thanks, queued for 3.2.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-20 13:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-04 14:55 [RFC patch] MIPS/netlogic: dont setup boot CPU twice Hillf Danton
[not found] ` <CA+7sy7B7-zTr4MojT+7C+AD4+ap4aiiJKX4u+fOPzR52yEJGJA@mail.gmail.com>
2011-08-04 18:51 ` Jayachandran C.
2011-08-05 13:43 ` Hillf Danton
2011-08-20 13:55 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox