1 From a8bb19e5ba9a3a73fe6a761295b67b641a7bc9df Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Fri, 26 Apr 2013 12:06:03 +0200
4 Subject: [PATCH 13/13] MIPS: BCM63XX: allow setting affinity for IPIC
6 Add support for setting the SMP affinity for the IPIC IRQs.
8 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
10 arch/mips/bcm63xx/irq.c | 27 ++++++++++++++++++++++++++-
11 1 file changed, 26 insertions(+), 1 deletion(-)
13 --- a/arch/mips/bcm63xx/irq.c
14 +++ b/arch/mips/bcm63xx/irq.c
15 @@ -418,9 +418,14 @@ static void bcm63xx_internal_irq_mask(st
16 static void bcm63xx_internal_irq_unmask(struct irq_data *d)
19 + const struct cpumask *dest = cpu_online_mask;
21 spin_lock_irqsave(&ipic_lock, flags);
22 - internal_irq_unmask(d->irq - IRQ_INTERNAL_BASE, cpu_online_mask);
24 + if (irqd_affinity_was_set(d))
27 + internal_irq_unmask(d->irq - IRQ_INTERNAL_BASE, dest);
28 spin_unlock_irqrestore(&ipic_lock, flags);
31 @@ -596,10 +601,30 @@ static int bcm63xx_external_irq_set_type
32 return IRQ_SET_MASK_OK_NOCOPY;
36 +static int bcm63xx_internal_set_affinity(struct irq_data *data,
37 + const struct cpumask *dest,
40 + unsigned int irq = data->irq - IRQ_INTERNAL_BASE;
41 + unsigned long flags;
43 + spin_lock_irqsave(&ipic_lock, flags);
44 + if (!irqd_irq_disabled(data))
45 + internal_irq_unmask(irq, dest);
46 + spin_unlock_irqrestore(&ipic_lock, flags);
52 static struct irq_chip bcm63xx_internal_irq_chip = {
53 .name = "bcm63xx_ipic",
54 .irq_mask = bcm63xx_internal_irq_mask,
55 .irq_unmask = bcm63xx_internal_irq_unmask,
57 + .irq_set_affinity = bcm63xx_internal_set_affinity,
61 static struct irq_chip bcm63xx_external_irq_chip = {