Skip to contentSkip to conversation

MIPS: CPS: Guard mips_mt_set_cpuoptions call

PATCH In review Tony Wu 2 participants 2 messages Jun 18, 2015 MIPS

lore
Share & tools
lore

Tony Wu

author
#0 lore raw

PATCH 1/1 MIPS: CPS: Guard mips_mt_set_cpuoptions call

Guard mips_mt_set_cpuoptions with MT specific options to avoid undefined reference error on multicore platform without multithreading support.

---
 arch/mips/kernel/smp-cps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/mips/kernel/smp-cps.c +2 -1
index 5570bc8..85633d6 100644
@@ -102,7 +102,8 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
 	bool cca_unsuitable;
 	u32 *entry_code;
 
-	mips_mt_set_cpuoptions();
+	if (config_enabled(CONFIG_MIPS_MT_SMP) && cpu_has_mipsmt)
+		mips_mt_set_cpuoptions();
 
 	/* Detect whether the CCA is unsuited to multi-core SMP */
 	cca = read_c0_config() & CONF_CM_CMASK;
Signature · 1 line
1.7.5
#1 lore raw
Quoted 17 lines · Tony Wu

Guard mips_mt_set_cpuoptions with MT specific options to avoid undefined reference error on multicore platform without multithreading support.

---
 arch/mips/kernel/smp-cps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/mips/kernel/smp-cps.c +0 -0
index 5570bc8..85633d6 100644

arch/mips/kernel/smp-cps.c static void __init cps_prepare_cpus(unsigned int max_cpus) · line 109

Quoted 9 lines
arch/mips/kernel/smp-cps.c +2 -1
@@ -102,7 +102,8 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
 	bool cca_unsuitable;
 	u32 *entry_code;
 
-	mips_mt_set_cpuoptions();
+	if (config_enabled(CONFIG_MIPS_MT_SMP) && cpu_has_mipsmt)
+		mips_mt_set_cpuoptions();
 
 	/* Detect whether the CCA is unsuited to multi-core SMP */
 	cca = read_c0_config() & CONF_CM_CMASK;

How come you hit a build problem here? according to arch/mips/include/asm/mips_mt.h the mips_mt_set_cpuoptions() is a NOP when CONFIG_MIPS_MT is not selected so it should work for non-MT multicore CPUs. Am I missing something?

Signature · 1 line
markos