arm64: smp: Update the topology masks before calling CPU_STARTING notifiers
Subsystems (2)
PATCH 1/1 arm64: smp: Update the topology masks before calling CPU_STARTING notifiers
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.
--- arch/arm/kernel/smp.c | 4 ++-- arch/arm64/kernel/smp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/kernel/smp.c +2 -2
@@ -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
arch/arm64/kernel/smp.c +2 -2
@@ -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
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Quoted 18 lines · Rohit Vaswani
Currently, the
CPU_STARTINGnotifiers 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 <[email protected]>--- arch/arm/kernel/smp.c | 4 ++-- arch/arm64/kernel/smp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)arch/arm/kernel/smp.c +0
-0@@ -363,12 +363,12 @@ asmlinkage void secondary_start_kernel(void)if (smp_ops.smp_secondary_init)
arch/arm/kernel/smp.c asmlinkage void secondary_start_kernel(void) · line 371
Quoted 10 lines
arch/arm/kernel/smp.c +2
-2smp_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
Quoted 25 lines · Will Deacon
Quoted 24 lines · Rohit Vaswani
Currently, the
CPU_STARTINGnotifiers 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 <[email protected]>--- arch/arm/kernel/smp.c | 4 ++-- arch/arm64/kernel/smp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)arch/arm/kernel/smp.c +2
-0@@ -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);
Quoted 6 lines
arch/arm/kernel/smp.c asmlinkage void secondary_start_kernel(void) · line 371
Quoted 4 lines
arch/arm/kernel/smp.c +0
-2calibrate_delay (); -smp_store_cpu_info (cpu); -Hmm,
smp_store_cpu_infotakes a copy ofloops_per_jiffy. Are you sure it's safe to move the call beforecalibrate_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
Quoted 1 line
Will
Thanks,
Rohit Vaswani
Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation