kernel-ark/arch/powerpc/platforms/powermac
Milton Miller 23d72bfd8f powerpc: Consolidate ipi message mux and demux
Consolidate the mux and demux of ipi messages into smp.c and call
a new smp_ops callback to actually trigger the ipi.

The powerpc architecture code is optimised for having 4 distinct
ipi triggers, which are mapped to 4 distinct messages (ipi many, ipi
single, scheduler ipi, and enter debugger).  However, several interrupt
controllers only provide a single software triggered interrupt that
can be delivered to each cpu.  To resolve this limitation, each smp_ops
implementation created a per-cpu variable that is manipulated with atomic
bitops.  Since these lines will be contended they are optimialy marked as
shared_aligned and take a full cache line for each cpu.  Distro kernels
may have 2 or 3 of these in their config, each taking per-cpu space
even though at most one will be in use.

This consolidation removes smp_message_recv and replaces the single call
actions cases with direct calls from the common message recognition loop.
The complicated debugger ipi case with its muxed crash handling code is
moved to debug_ipi_action which is now called from the demux code (instead
of the multi-message action calling smp_message_recv).

I put a call to reschedule_action to increase the likelyhood of correctly
merging the anticipated scheduler_ipi() hook coming from the scheduler
tree; that single required call can be inlined later.

The actual message decode is a copy of the old pseries xics code with its
memory barriers and cache line spacing, augmented with a per-cpu unsigned
long based on the book-e doorbell code.  The optional data is set via a
callback from the implementation and is passed to the new cause-ipi hook
along with the logical cpu number.  While currently only the doorbell
implemntation uses this data it should be almost zero cost to retrieve and
pass it -- it adds a single register load for the argument from the same
cache line to which we just completed a store and the register is dead
on return from the call.  I extended the data element from unsigned int
to unsigned long in case some other code wanted to associate a pointer.

The doorbell check_self is replaced by a call to smp_muxed_ipi_resend,
conditioned on the CPU_DBELL feature.  The ifdef guard could be relaxed
to CONFIG_SMP but I left it with BOOKE for now.

Also, the doorbell interrupt vector for book-e was not calling irq_enter
and irq_exit, which throws off cpu accounting and causes code to not
realize it is running in interrupt context.  Add the missing calls.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-05-19 15:31:03 +10:00
..
backlight.c
bootx_init.c powerpc: Remove trailing space in messages 2010-02-09 13:56:23 +11:00
cache.S
cpufreq_32.c [CPUFREQ] Remove the pm_message_t argument from driver suspend 2011-03-16 17:54:33 -04:00
cpufreq_64.c powerpc/cpumask: Use cpu_online_mask 2010-05-06 17:16:12 +10:00
feature.c powerpc/powermac: Drop unnecessary null test 2010-08-24 15:26:28 +10:00
Kconfig powerpc/kconfig: Kill PPC_MULTIPLATFORM 2009-03-11 17:11:35 +11:00
low_i2c.c Fix common misspellings 2011-03-31 11:26:23 -03:00
Makefile Fix common misspellings 2011-03-31 11:26:23 -03:00
nvram.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pci.c Fix common misspellings 2011-03-31 11:26:23 -03:00
pfunc_base.c powerpc: Convert feature_lock to raw_spinlock 2010-02-19 14:52:32 +11:00
pfunc_core.c powerpc/powermac/pfunc_core.c: Add of_node_put to avoid memory leak 2010-09-02 14:07:33 +10:00
pic.c powerpc/irq: Stop exporting irq_map 2011-05-04 15:02:15 +10:00
pmac.h powerpc/pmac/smp: Consolidate 32-bit and 64-bit PowerMac cpu_die in one file 2011-04-01 15:37:21 +11:00
setup.c powerpc/pmac/smp: Consolidate 32-bit and 64-bit PowerMac cpu_die in one file 2011-04-01 15:37:21 +11:00
sleep.S powerpc/mm: Introduce MMU features 2008-12-21 14:21:16 +11:00
smp.c powerpc: Consolidate ipi message mux and demux 2011-05-19 15:31:03 +10:00
time.c of: add 'of_' prefix to machine_is_compatible() 2010-02-09 08:33:00 -07:00
udbg_adb.c
udbg_scc.c of: add 'of_' prefix to machine_is_compatible() 2010-02-09 08:33:00 -07:00