Blackfin: SMP: add support for IRQ affinity

Now that the Blackfin IRQ controller supports this, drivers get the normal
functionality of controlling which CPU to bind IRQs to.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Sonic Zhang 2009-12-28 07:29:57 +00:00 committed by Mike Frysinger
parent 69e1d8a61d
commit 0325f25a91
1 changed files with 34 additions and 4 deletions

View File

@ -173,7 +173,12 @@ static void bfin_internal_mask_irq(unsigned int irq)
local_irq_restore_hw(flags);
}
#ifdef CONFIG_SMP
static void bfin_internal_unmask_irq_affinity(unsigned int irq,
const struct cpumask *affinity)
#else
static void bfin_internal_unmask_irq(unsigned int irq)
#endif
{
unsigned long flags;
@ -186,16 +191,38 @@ static void bfin_internal_unmask_irq(unsigned int irq)
local_irq_save_hw(flags);
mask_bank = SIC_SYSIRQ(irq) / 32;
mask_bit = SIC_SYSIRQ(irq) % 32;
bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) |
(1 << mask_bit));
#ifdef CONFIG_SMP
bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) |
(1 << mask_bit));
if (cpumask_test_cpu(0, affinity))
#endif
bfin_write_SIC_IMASK(mask_bank,
bfin_read_SIC_IMASK(mask_bank) |
(1 << mask_bit));
#ifdef CONFIG_SMP
if (cpumask_test_cpu(1, affinity))
bfin_write_SICB_IMASK(mask_bank,
bfin_read_SICB_IMASK(mask_bank) |
(1 << mask_bit));
#endif
#endif
local_irq_restore_hw(flags);
}
#ifdef CONFIG_SMP
static void bfin_internal_unmask_irq(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
bfin_internal_unmask_irq_affinity(irq, desc->affinity);
}
static int bfin_internal_set_affinity(unsigned int irq, const struct cpumask *mask)
{
bfin_internal_mask_irq(irq);
bfin_internal_unmask_irq_affinity(irq, mask);
return 0;
}
#endif
#ifdef CONFIG_PM
int bfin_internal_set_wake(unsigned int irq, unsigned int state)
{
@ -271,6 +298,9 @@ static struct irq_chip bfin_internal_irqchip = {
.mask_ack = bfin_internal_mask_irq,
.disable = bfin_internal_mask_irq,
.enable = bfin_internal_unmask_irq,
#ifdef CONFIG_SMP
.set_affinity = bfin_internal_set_affinity,
#endif
#ifdef CONFIG_PM
.set_wake = bfin_internal_set_wake,
#endif