diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-04-15 12:51:33 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-05-25 08:13:43 -0400 |
commit | e2a8092c3fa9766248e9515252ae44e6df2d97a0 (patch) | |
tree | 99619c0acee0ad019c8551465a1e37b71a9ff27a /arch/blackfin | |
parent | dd8cb37b4e92c487fd10e7da96bab18d33de62da (diff) | |
download | linux-stable-e2a8092c3fa9766248e9515252ae44e6df2d97a0.tar.gz linux-stable-e2a8092c3fa9766248e9515252ae44e6df2d97a0.tar.bz2 linux-stable-e2a8092c3fa9766248e9515252ae44e6df2d97a0.zip |
Blackfin: bf537: fix excessive gpio int demuxing
The search logic in the gpio demux walks all possible gpio blocks starting
at the specified pin. The trouble on bf537 parts when we demux the port
F and port G mask A interrupts is that we also demux port H mask A ints.
Most of the time this isn't an issue as people don't usually use port H,
but might as well avoid it when possible.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/mach-common/ints-priority.c | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index a77f96f9be7c..ad28eb12003a 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c @@ -567,22 +567,41 @@ static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) # define bfin_gpio_set_wake NULL #endif +static void bfin_demux_gpio_block(unsigned int irq) +{ + unsigned int gpio, mask; + + gpio = irq_to_gpio(irq); + mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio); + + while (mask) { + if (mask & 1) + bfin_handle_irq(irq); + irq++; + mask >>= 1; + } +} + static void bfin_demux_gpio_irq(unsigned int inta_irq, struct irq_desc *desc) { - unsigned int i, gpio, mask, irq, search = 0; + unsigned int irq; switch (inta_irq) { -#if defined(CONFIG_BF53x) +#if defined(BF537_FAMILY) case IRQ_PROG_INTA: - irq = IRQ_PF0; - search = 1; + bfin_demux_gpio_block(IRQ_PF0); + irq = IRQ_PG0; break; -# if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) +# if !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) case IRQ_MAC_RX: irq = IRQ_PH0; break; # endif +#elif defined(BF533_FAMILY) + case IRQ_PROG_INTA: + irq = IRQ_PF0; + break; #elif defined(BF538_FAMILY) case IRQ_PORTF_INTA: irq = IRQ_PF0; @@ -613,31 +632,7 @@ static void bfin_demux_gpio_irq(unsigned int inta_irq, return; } - if (search) { - for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { - irq += i; - - mask = get_gpiop_data(i) & get_gpiop_maska(i); - - while (mask) { - if (mask & 1) - bfin_handle_irq(irq); - irq++; - mask >>= 1; - } - } - } else { - gpio = irq_to_gpio(irq); - mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio); - - do { - if (mask & 1) - bfin_handle_irq(irq); - irq++; - mask >>= 1; - } while (mask); - } - + bfin_demux_gpio_block(irq); } #else /* CONFIG_BF54x */ |