Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Add kconfig for muxed smp ipi support

Compile the new smp ipi mux and demux code only if a platform
will make use of it. The new config is selected as required.

The new cause_ipi smp op is only available conditionally to point out
configs where the select is required; this makes setting the op an
immediate fail instead of a deferred unresolved symbol at link.

This also creates a new config for power surge powermac upgrade support
that can be disabled in expert mode but is default on.

I also removed the depends / default y on CONFIG_XICS since it is selected
by PSERIES.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Milton Miller and committed by
Benjamin Herrenschmidt
1ece355b 23d72bfd

+32 -7
+2
arch/powerpc/include/asm/smp.h
··· 38 38 39 39 struct smp_ops_t { 40 40 void (*message_pass)(int cpu, int msg); 41 + #ifdef CONFIG_PPC_SMP_MUXED_IPI 41 42 void (*cause_ipi)(int cpu, unsigned long data); 43 + #endif 42 44 int (*probe)(void); 43 45 int (*kick_cpu)(int nr); 44 46 void (*setup_cpu)(int nr);
+2
arch/powerpc/kernel/smp.c
··· 178 178 return err; 179 179 } 180 180 181 + #ifdef CONFIG_PPC_SMP_MUXED_IPI 181 182 struct cpu_messages { 182 183 unsigned long messages; /* current messages bits */ 183 184 unsigned long data; /* data for cause ipi */ ··· 231 230 } 232 231 return IRQ_HANDLED; 233 232 } 233 + #endif /* CONFIG_PPC_SMP_MUXED_IPI */ 234 234 235 235 void smp_send_reschedule(int cpu) 236 236 {
+8
arch/powerpc/platforms/Kconfig
··· 57 57 depends on PPC_RTAS 58 58 default n 59 59 60 + config PPC_SMP_MUXED_IPI 61 + bool 62 + help 63 + Select this opton if your platform supports SMP and your 64 + interrupt controller provides less than 4 interrupts to each 65 + cpu. This will enable the generic code to multiplex the 4 66 + messages on to one ipi. 67 + 60 68 config PPC_UDBG_BEAT 61 69 bool "BEAT based debug console" 62 70 depends on PPC_CELLEB
+2
arch/powerpc/platforms/Kconfig.cputype
··· 73 73 config PPC_BOOK3E_64 74 74 bool "Embedded processors" 75 75 select PPC_FPU # Make it a choice ? 76 + select PPC_SMP_MUXED_IPI 76 77 77 78 endchoice 78 79 ··· 179 178 config PPC_FSL_BOOK3E 180 179 bool 181 180 select FSL_EMB_PERFMON 181 + select PPC_SMP_MUXED_IPI 182 182 default y if FSL_BOOKE 183 183 184 184 config PTE_64BIT
+1
arch/powerpc/platforms/iseries/Kconfig
··· 1 1 config PPC_ISERIES 2 2 bool "IBM Legacy iSeries" 3 3 depends on PPC64 && PPC_BOOK3S 4 + select PPC_SMP_MUXED_IPI 4 5 select PPC_INDIRECT_PIO 5 6 select PPC_INDIRECT_MMIO 6 7 select PPC_PCI_CHOICE if EXPERT
+10 -1
arch/powerpc/platforms/powermac/Kconfig
··· 18 18 select PPC_970_NAP 19 19 default y 20 20 21 - 21 + config PPC_PMAC32_PSURGE 22 + bool "Support for powersurge upgrade cards" if EXPERT 23 + depends on SMP && PPC32 && PPC_PMAC 24 + select PPC_SMP_MUXED_IPI 25 + default y 26 + help 27 + The powersurge cpu boards can be used in the generation 28 + of powermacs that have a socket for an upgradeable cpu card, 29 + including the 7500, 8500, 9500, 9600. Support exists for 30 + both dual and quad socket upgrade cards.
+2 -2
arch/powerpc/platforms/powermac/pic.c
··· 239 239 unsigned long bits = 0; 240 240 unsigned long flags; 241 241 242 - #ifdef CONFIG_SMP 242 + #ifdef CONFIG_PPC_PMAC32_PSURGE 243 243 void psurge_smp_message_recv(void); 244 244 245 245 /* IPI's are a hack on the powersurge -- Cort */ ··· 247 247 psurge_smp_message_recv(); 248 248 return NO_IRQ_IGNORE; /* ignore, already handled */ 249 249 } 250 - #endif /* CONFIG_SMP */ 250 + #endif /* CONFIG_PPC_PMAC32_PSURGE */ 251 251 raw_spin_lock_irqsave(&pmac_pic_lock, flags); 252 252 for (irq = max_real_irqs; (irq -= 32) >= 0; ) { 253 253 int i = irq >> 5;
+4 -4
arch/powerpc/platforms/powermac/smp.c
··· 70 70 static u64 timebase; 71 71 static int tb_req; 72 72 73 - #ifdef CONFIG_PPC32 73 + #ifdef CONFIG_PPC_PMAC32_PSURGE 74 74 75 75 /* 76 76 * Powersurge (old powermac SMP) support. ··· 420 420 .give_timebase = smp_psurge_give_timebase, 421 421 .take_timebase = smp_psurge_take_timebase, 422 422 }; 423 - #endif /* CONFIG_PPC32 - actually powersurge support */ 423 + #endif /* CONFIG_PPC_PMAC32_PSURGE */ 424 424 425 425 /* 426 426 * Core 99 and later support ··· 980 980 of_node_put(np); 981 981 smp_ops = &core99_smp_ops; 982 982 } 983 - #ifdef CONFIG_PPC32 983 + #ifdef CONFIG_PPC_PMAC32_PSURGE 984 984 else { 985 985 /* We have to set bits in cpu_possible_mask here since the 986 986 * secondary CPU(s) aren't in the device tree. Various ··· 993 993 set_cpu_possible(cpu, true); 994 994 smp_ops = &psurge_smp_ops; 995 995 } 996 - #endif /* CONFIG_PPC32 */ 996 + #endif /* CONFIG_PPC_PMAC32_PSURGE */ 997 997 998 998 #ifdef CONFIG_HOTPLUG_CPU 999 999 ppc_md.cpu_die = pmac_cpu_die;
+1
arch/powerpc/sysdev/xics/Kconfig
··· 1 1 config PPC_XICS 2 2 def_bool n 3 + select PPC_SMP_MUXED_IPI 3 4 4 5 config PPC_ICP_NATIVE 5 6 def_bool n