summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/smp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 16:31:41 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 16:31:41 -0800
commit5a62f995446be44811fefa48f91f9efb7ea172d7 (patch)
treee297371f0d513dc6278bb67d582d2216eb7d74ed /arch/powerpc/kernel/smp.c
parentf1d6d6cd9029daa7e7d4a0b14347b5392320f22a (diff)
parent5d7d8072edc11080a7cf6cc37c9f4e61ca1e93c9 (diff)
downloadlinux-5a62f995446be44811fefa48f91f9efb7ea172d7.tar.bz2
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (72 commits) powerpc/pseries: Fix build of topology stuff without CONFIG_NUMA powerpc/pseries: Fix VPHN build errors on non-SMP systems powerpc/83xx: add mpc8308_p1m DMA controller device-tree node powerpc/83xx: add DMA controller to mpc8308 device-tree node powerpc/512x: try to free dma descriptors in case of allocation failure powerpc/512x: add MPC8308 dma support powerpc/512x: fix the hanged dma transfer issue powerpc/512x: scatter/gather dma fix powerpc/powermac: Make auto-loading of therm_pm72 possible of/address: Use propper endianess in get_flags powerpc/pci: Use printf extension %pR for struct resource powerpc: Remove unnecessary casts of void ptr powerpc: Disable VPHN polling during a suspend operation powerpc/pseries: Poll VPA for topology changes and update NUMA maps powerpc: iommu: Add device name to iommu error printks powerpc: Record vma->phys_addr in ioremap() powerpc: Update compat_arch_ptrace powerpc: Fix PPC_PTRACE_SETHWDEBUG on PPC_BOOK3S powerpc/time: printk time stamp init not correct powerpc: Minor cleanups for machdep.h ...
Diffstat (limited to 'arch/powerpc/kernel/smp.c')
-rw-r--r--arch/powerpc/kernel/smp.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 68034bbf2e4f..981360509172 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -466,7 +466,20 @@ out:
return id;
}
-/* Must be called when no change can occur to cpu_present_mask,
+/* Helper routines for cpu to core mapping */
+int cpu_core_index_of_thread(int cpu)
+{
+ return cpu >> threads_shift;
+}
+EXPORT_SYMBOL_GPL(cpu_core_index_of_thread);
+
+int cpu_first_thread_of_core(int core)
+{
+ return core << threads_shift;
+}
+EXPORT_SYMBOL_GPL(cpu_first_thread_of_core);
+
+/* Must be called when no change can occur to cpu_present_map,
* i.e. during cpu online or offline.
*/
static struct device_node *cpu_to_l2cache(int cpu)
@@ -514,7 +527,7 @@ int __devinit start_secondary(void *unused)
notify_cpu_starting(cpu);
set_cpu_online(cpu, true);
/* Update sibling maps */
- base = cpu_first_thread_in_core(cpu);
+ base = cpu_first_thread_sibling(cpu);
for (i = 0; i < threads_per_core; i++) {
if (cpu_is_offline(base + i))
continue;
@@ -600,7 +613,7 @@ int __cpu_disable(void)
return err;
/* Update sibling maps */
- base = cpu_first_thread_in_core(cpu);
+ base = cpu_first_thread_sibling(cpu);
for (i = 0; i < threads_per_core; i++) {
cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i));
cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu));