[Skiboot] [PATCH v2 21/23] cpu: Make init_hid() local to cpu.c

Michael Neuling mikey at neuling.org
Sun Jun 25 05:17:26 AEST 2017


From: Benjamin Herrenschmidt <benh at kernel.crashing.org>

No point doing that from init on the main CPU while it's
done already inside cpu.c for secondaries.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 core/cpu.c    | 4 +++-
 core/init.c   | 2 --
 include/cpu.h | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/core/cpu.c b/core/cpu.c
index 8448dfd6db..a083ed7e0d 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -657,7 +657,7 @@ void trigger_attn(void)
 	__trigger_attn();
 }
 
-void init_hid(void)
+static void init_hid(void)
 {
 	/* attn is enabled even when HV=0, so make sure it's off */
 	disable_attn();
@@ -929,6 +929,8 @@ void cpu_callin(struct cpu_thread *cpu)
 {
 	cpu->state = cpu_state_active;
 	cpu->job_has_no_return = false;
+
+	init_hid();
 }
 
 static void opal_start_thread_job(void *data)
diff --git a/core/init.c b/core/init.c
index 206b1ab676..244a78f4ca 100644
--- a/core/init.c
+++ b/core/init.c
@@ -1055,8 +1055,6 @@ void __noreturn __secondary_cpu_entry(void)
 	/* Secondary CPU called in */
 	cpu_callin(cpu);
 
-	init_hid();
-
 	/* Some XIVE setup */
 	xive_cpu_callin(cpu);
 
diff --git a/include/cpu.h b/include/cpu.h
index 2d69699480..0cb6389ac0 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -129,7 +129,6 @@ static inline void __nomcount cpu_relax(void)
 void pre_init_boot_cpu(void);
 void init_boot_cpu(void);
 void init_all_cpus(void);
-void init_hid(void);
 
 /* This brings up our secondaries */
 extern void cpu_bringup(void);
-- 
2.11.0



More information about the Skiboot mailing list