linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: smp: Update the topology masks before calling CPU_STARTING notifiers
@ 2014-08-13  1:11 Rohit Vaswani
  2014-08-15 10:43 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Rohit Vaswani @ 2014-08-13  1:11 UTC (permalink / raw)
  To: linux-arm-kernel

Currently, the CPU_STARTING notifiers would observe an incorrect sibling
mask since the notifier chain is called before the topology masks are updated
for the new cpu.
Update the topology masks before calling the notifier chain to fix this
problem.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
---
 arch/arm/kernel/smp.c   | 4 ++--
 arch/arm64/kernel/smp.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 7c4fada..0e2237c 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -363,12 +363,12 @@ asmlinkage void secondary_start_kernel(void)
 	if (smp_ops.smp_secondary_init)
 		smp_ops.smp_secondary_init(cpu);
 
+	smp_store_cpu_info(cpu);
+
 	notify_cpu_starting(cpu);
 
 	calibrate_delay();
 
-	smp_store_cpu_info(cpu);
-
 	/*
 	 * OK, now it's safe to let the boot CPU continue.  Wait for
 	 * the CPU migration code to notice that the CPU is online
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 3e2f5eb..4ae78fe 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -163,10 +163,10 @@ asmlinkage void secondary_start_kernel(void)
 	/*
 	 * Enable GIC and timers.
 	 */
-	notify_cpu_starting(cpu);
-
 	smp_store_cpu_info(cpu);
 
+	notify_cpu_starting(cpu);
+
 	/*
 	 * OK, now it's safe to let the boot CPU continue.  Wait for
 	 * the CPU migration code to notice that the CPU is online
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] arm64: smp: Update the topology masks before calling CPU_STARTING notifiers
  2014-08-13  1:11 [PATCH] arm64: smp: Update the topology masks before calling CPU_STARTING notifiers Rohit Vaswani
@ 2014-08-15 10:43 ` Will Deacon
  2014-08-15 23:12   ` Rohit Vaswani
  0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2014-08-15 10:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 13, 2014 at 02:11:09AM +0100, Rohit Vaswani wrote:
> Currently, the CPU_STARTING notifiers would observe an incorrect sibling
> mask since the notifier chain is called before the topology masks are updated
> for the new cpu.
> Update the topology masks before calling the notifier chain to fix this
> problem.
> 
> Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
> ---
>  arch/arm/kernel/smp.c   | 4 ++--
>  arch/arm64/kernel/smp.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index 7c4fada..0e2237c 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -363,12 +363,12 @@ asmlinkage void secondary_start_kernel(void)
>  	if (smp_ops.smp_secondary_init)
>  		smp_ops.smp_secondary_init(cpu);
>  
> +	smp_store_cpu_info(cpu);
> +
>  	notify_cpu_starting(cpu);
>  
>  	calibrate_delay();
>  
> -	smp_store_cpu_info(cpu);
> -

Hmm, smp_store_cpu_info takes a copy of loops_per_jiffy. Are you sure it's
safe to move the call before calibrate_delay?

Will

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm64: smp: Update the topology masks before calling CPU_STARTING notifiers
  2014-08-15 10:43 ` Will Deacon
@ 2014-08-15 23:12   ` Rohit Vaswani
  0 siblings, 0 replies; 3+ messages in thread
From: Rohit Vaswani @ 2014-08-15 23:12 UTC (permalink / raw)
  To: linux-arm-kernel

On 8/15/2014 3:43 AM, Will Deacon wrote:
> On Wed, Aug 13, 2014 at 02:11:09AM +0100, Rohit Vaswani wrote:
>> Currently, the CPU_STARTING notifiers would observe an incorrect sibling
>> mask since the notifier chain is called before the topology masks are updated
>> for the new cpu.
>> Update the topology masks before calling the notifier chain to fix this
>> problem.
>>
>> Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
>> ---
>>   arch/arm/kernel/smp.c   | 4 ++--
>>   arch/arm64/kernel/smp.c | 4 ++--
>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
>> index 7c4fada..0e2237c 100644
>> --- a/arch/arm/kernel/smp.c
>> +++ b/arch/arm/kernel/smp.c
>> @@ -363,12 +363,12 @@ asmlinkage void secondary_start_kernel(void)
>>   	if (smp_ops.smp_secondary_init)
>>   		smp_ops.smp_secondary_init(cpu);
>>   
>> +	smp_store_cpu_info(cpu);
>> +
>>   	notify_cpu_starting(cpu);
>>   
>>   	calibrate_delay();
>>   
>> -	smp_store_cpu_info(cpu);
>> -
> Hmm, smp_store_cpu_info takes a copy of loops_per_jiffy. Are you sure it's
> safe to move the call before calibrate_delay?

Right! - I had looked at the arm64 version .  I checked for arm32 now 
and I think we should be
safe to move calibrate_delay before the smp_store_cpu_info and I can 
push a v2 version if
there are no concerns. I did not see calibrate_delay having any 
dependency for cpu_starting notifiers.

-Rohit
> Will


Thanks,
Rohit Vaswani

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-15 23:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-13  1:11 [PATCH] arm64: smp: Update the topology masks before calling CPU_STARTING notifiers Rohit Vaswani
2014-08-15 10:43 ` Will Deacon
2014-08-15 23:12   ` Rohit Vaswani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).