[PATCH 06/12] MIPS: smp-cps: fix build when CONFIG_MIPS_MT_SMP=n

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The vpe_id field of struct cpuinfo_mips is only present when one of
CONFIG_MIPS_MT_{SMP,SMTC} is enabled. Use the new cpu_vpe_id macro to
read the vpe_id field if present & avoid the build error if it isn't.
When setting vpe_id, #ifdef on CONFIG_MIPS_MT_SMP since smp-cps.c is
never compiled with CONFIG_MIPS_MT_SMTC.

Signed-off-by: Paul Burton <paul.burton@xxxxxxxxxx>
---
Feel free to apply this as a fixup to "MIPS: Coherent Processing System
SMP implementation", though it relies upon "MIPS: add cpu_vpe_id macro"
being applied first.
---
 arch/mips/kernel/smp-cps.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 2998906..4b812c1 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -120,7 +120,9 @@ static void __init cps_smp_setup(void)
 
 		for (v = 0; v < min_t(int, core_vpes, NR_CPUS - nvpes); v++) {
 			cpu_data[nvpes + v].core = c;
+#ifdef CONFIG_MIPS_MT_SMP
 			cpu_data[nvpes + v].vpe_id = v;
+#endif
 		}
 
 		nvpes += core_vpes;
@@ -239,7 +241,7 @@ static void cps_boot_secondary(int cpu, struct task_struct *idle)
 	int err;
 
 	cfg.core = cpu_data[cpu].core;
-	cfg.vpe = cpu_data[cpu].vpe_id;
+	cfg.vpe = cpu_vpe_id(&cpu_data[cpu]);
 	cfg.pc = (unsigned long)&smp_bootstrap;
 	cfg.sp = __KSTK_TOS(idle);
 	cfg.gp = (unsigned long)task_thread_info(idle);
@@ -276,7 +278,7 @@ static void cps_init_secondary(void)
 	dmt();
 
 	/* TODO: revisit this assumption once hotplug is implemented */
-	if (current_cpu_data.vpe_id == 0)
+	if (cpu_vpe_id(&current_cpu_data) == 0)
 		init_core();
 
 	change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 |
-- 
1.8.5.3



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux