Skip to contentSkip to conversation

powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops

PATCH New Kumar Gala 1 participant 1 message Sep 9, 2009

Subsystems (2)
lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH v2 1/1 powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops

The following commit introduced a compile error since it removed the implementation of smp_85xx_basic_setup:

commit 77c0a700c1c292edafa11c1e52821ce4636f81b0

Author: Benjamin Herrenschmidt <[email protected]>
Date:   Fri Aug 28 14:25:04 2009 +1000

powerpc: Properly start decrementer on BookE secondary CPUs

Make it so that smp_ops probe() and setup_cpu() can be set to NULL.

---
* Removed explicit setting of NULL in structure

 arch/powerpc/kernel/smp.c         |   10 +++++++---
 arch/powerpc/platforms/85xx/smp.c |   10 ----------
 2 files changed, 7 insertions(+), 13 deletions(-)
arch/powerpc/kernel/smp.c +7 -3
index 96f107c..d387b39 100644
@@ -269,7 +269,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 	cpu_callin_map[boot_cpuid] = 1;
 
 	if (smp_ops)
-		max_cpus = smp_ops->probe();
+		if (smp_ops->probe)
+			max_cpus = smp_ops->probe();
+		else
+			max_cpus = NR_CPUS;
 	else
 		max_cpus = 1;
  
@@ -493,7 +496,8 @@ int __devinit start_secondary(void *unused)
 	preempt_disable();
 	cpu_callin_map[cpu] = 1;
 
-	smp_ops->setup_cpu(cpu);
+	if (smp_ops->setup_cpu)
+		smp_ops->setup_cpu(cpu);
 	if (smp_ops->take_timebase)
 		smp_ops->take_timebase();
 
@@ -556,7 +560,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
 	old_mask = current->cpus_allowed;
 	set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid));
 	
-	if (smp_ops)
+	if (smp_ops && smp_ops->setup_cpu)
 		smp_ops->setup_cpu(boot_cpuid);
 
 	set_cpus_allowed(current, old_mask);
arch/powerpc/platforms/85xx/smp.c +0 -10
index 94f901d..04160a4 100644
@@ -88,25 +88,15 @@ struct smp_ops_t smp_85xx_ops = {
 	.kick_cpu = smp_85xx_kick_cpu,
 };
 
-static int __init smp_dummy_probe(void)
-{
-	return NR_CPUS;
-}
-
 void __init mpc85xx_smp_init(void)
 {
 	struct device_node *np;
 
-	smp_85xx_ops.message_pass = NULL;
-
 	np = of_find_node_by_type(NULL, "open-pic");
 	if (np) {
 		smp_85xx_ops.probe = smp_mpic_probe;
 		smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu;
 		smp_85xx_ops.message_pass = smp_mpic_message_pass;
-	} else {
-		smp_85xx_ops.probe = smp_dummy_probe;
-		smp_85xx_ops.setup_cpu = smp_85xx_basic_setup;
 	}
 
 	if (cpu_has_feature(CPU_FTR_DBELL))
Signature · 1 line
1.6.0.6