Commit e2a8092c3fa9766248e9515252ae44e6df2d97a0
1 parent
dd8cb37b4e
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 25 additions and 30 deletions Side-by-side Diff
arch/blackfin/mach-common/ints-priority.c
... | ... | @@ -567,22 +567,41 @@ |
567 | 567 | # define bfin_gpio_set_wake NULL |
568 | 568 | #endif |
569 | 569 | |
570 | +static void bfin_demux_gpio_block(unsigned int irq) | |
571 | +{ | |
572 | + unsigned int gpio, mask; | |
573 | + | |
574 | + gpio = irq_to_gpio(irq); | |
575 | + mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio); | |
576 | + | |
577 | + while (mask) { | |
578 | + if (mask & 1) | |
579 | + bfin_handle_irq(irq); | |
580 | + irq++; | |
581 | + mask >>= 1; | |
582 | + } | |
583 | +} | |
584 | + | |
570 | 585 | static void bfin_demux_gpio_irq(unsigned int inta_irq, |
571 | 586 | struct irq_desc *desc) |
572 | 587 | { |
573 | - unsigned int i, gpio, mask, irq, search = 0; | |
588 | + unsigned int irq; | |
574 | 589 | |
575 | 590 | switch (inta_irq) { |
576 | -#if defined(CONFIG_BF53x) | |
591 | +#if defined(BF537_FAMILY) | |
577 | 592 | case IRQ_PROG_INTA: |
578 | - irq = IRQ_PF0; | |
579 | - search = 1; | |
593 | + bfin_demux_gpio_block(IRQ_PF0); | |
594 | + irq = IRQ_PG0; | |
580 | 595 | break; |
581 | -# if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) | |
596 | +# if !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) | |
582 | 597 | case IRQ_MAC_RX: |
583 | 598 | irq = IRQ_PH0; |
584 | 599 | break; |
585 | 600 | # endif |
601 | +#elif defined(BF533_FAMILY) | |
602 | + case IRQ_PROG_INTA: | |
603 | + irq = IRQ_PF0; | |
604 | + break; | |
586 | 605 | #elif defined(BF538_FAMILY) |
587 | 606 | case IRQ_PORTF_INTA: |
588 | 607 | irq = IRQ_PF0; |
... | ... | @@ -613,31 +632,7 @@ |
613 | 632 | return; |
614 | 633 | } |
615 | 634 | |
616 | - if (search) { | |
617 | - for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { | |
618 | - irq += i; | |
619 | - | |
620 | - mask = get_gpiop_data(i) & get_gpiop_maska(i); | |
621 | - | |
622 | - while (mask) { | |
623 | - if (mask & 1) | |
624 | - bfin_handle_irq(irq); | |
625 | - irq++; | |
626 | - mask >>= 1; | |
627 | - } | |
628 | - } | |
629 | - } else { | |
630 | - gpio = irq_to_gpio(irq); | |
631 | - mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio); | |
632 | - | |
633 | - do { | |
634 | - if (mask & 1) | |
635 | - bfin_handle_irq(irq); | |
636 | - irq++; | |
637 | - mask >>= 1; | |
638 | - } while (mask); | |
639 | - } | |
640 | - | |
635 | + bfin_demux_gpio_block(irq); | |
641 | 636 | } |
642 | 637 | |
643 | 638 | #else /* CONFIG_BF54x */ |