aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2011-05-10 15:29:17 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 01:30:53 -0400
commit3caba98fddd551ca7dcdb1eb701b36ed70b04fde (patch)
tree85239e83532cd2b800e2c161bfb712961d7991a0
parentf1072939b6dd01d038d47db0bdc01b33e5f90f28 (diff)
powerpc/mpic: Simplify ipi cpu mask handling
Now that MSG_ALL and MSG_ALL_BUT_SELF have been eliminated, smp_mpic_mesage_pass no longer needs to lookup the cpumask just to have mpic_send_ipi extract part of it and recode it in a NR_CPUS loop by mpic_physmask. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/sysdev/mpic.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 68ea50c41902..53121f625068 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1613,30 +1613,28 @@ void mpic_request_ipis(void)
1613 } 1613 }
1614} 1614}
1615 1615
1616static void mpic_send_ipi(unsigned int ipi_no, const struct cpumask *cpu_mask) 1616void smp_mpic_message_pass(int cpu, int msg)
1617{ 1617{
1618 struct mpic *mpic = mpic_primary; 1618 struct mpic *mpic = mpic_primary;
1619 u32 physmask;
1619 1620
1620 BUG_ON(mpic == NULL); 1621 BUG_ON(mpic == NULL);
1621 1622
1622#ifdef DEBUG_IPI
1623 DBG("%s: send_ipi(ipi_no: %d)\n", mpic->name, ipi_no);
1624#endif
1625
1626 mpic_cpu_write(MPIC_INFO(CPU_IPI_DISPATCH_0) +
1627 ipi_no * MPIC_INFO(CPU_IPI_DISPATCH_STRIDE),
1628 mpic_physmask(cpumask_bits(cpu_mask)[0]));
1629}
1630
1631void smp_mpic_message_pass(int cpu, int msg)
1632{
1633 /* make sure we're sending something that translates to an IPI */ 1623 /* make sure we're sending something that translates to an IPI */
1634 if ((unsigned int)msg > 3) { 1624 if ((unsigned int)msg > 3) {
1635 printk("SMP %d: smp_message_pass: unknown msg %d\n", 1625 printk("SMP %d: smp_message_pass: unknown msg %d\n",
1636 smp_processor_id(), msg); 1626 smp_processor_id(), msg);
1637 return; 1627 return;
1638 } 1628 }
1639 mpic_send_ipi(msg, cpumask_of(cpu)); 1629
1630#ifdef DEBUG_IPI
1631 DBG("%s: send_ipi(ipi_no: %d)\n", mpic->name, msg);
1632#endif
1633
1634 physmask = 1 << get_hard_smp_processor_id(cpu);
1635
1636 mpic_cpu_write(MPIC_INFO(CPU_IPI_DISPATCH_0) +
1637 msg * MPIC_INFO(CPU_IPI_DISPATCH_STRIDE), physmask);
1640} 1638}
1641 1639
1642int __init smp_mpic_probe(void) 1640int __init smp_mpic_probe(void)