Commit a55fb470 authored by Remy Bohmer's avatar Remy Bohmer Committed by Thomas Gleixner

ARM: AT91: Use edge irq for AT91-GPIO

On ARM there is a problem where the interrupt handler stalls when they
are coming faster than the kernel can handle. The problem seems to
occur on RT primarily, but the problem is also valid for non-RT
kernels.

The problem is twofold:
* the handle_simple_irq() mechanism is used for GPIO, but because the GPIO
interrupt source is actually an edge triggered interrupt source, the
handle_edge_irq() mechanism must be used. While using the simple_irq()
mechanisms edges can be missed for either mainline as RT kernels.
The simple_irq mechanism is *never* meant to be used for these types
of interrupts. See the thread at: http://lkml.org/lkml/2007/11/26/73
* The RT kernels has a problem that the interrupt get masked forever while
the interrupt thread is running and a new interrupt arrives.
In the interrupt threads there is masking done in the handle_simple_irq()
path, while a simple_irq typically cannot be masked.

This patch only solves the first bullet, which is enough for AT91, by
moving the GPIO interrupt handler towards the handle_edge_irq().
To solve the problem in the simple_irq() path a seperate fix has to be done,
but as it is no longer used by AT91, that fix will not affect AT91.

Tested on:
* AT91rm9200-ek, and proprietary board
* AT91SAM9261-ek. (This patches also solves the problem that the DM9000 does
                   not work on this board while using PREEMPT-RT)
Signed-off-by: default avatarRemy Bohmer <linux@bohmer.net>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 59ad0ff1
...@@ -375,12 +375,18 @@ static int gpio_irq_type(unsigned pin, unsigned type) ...@@ -375,12 +375,18 @@ static int gpio_irq_type(unsigned pin, unsigned type)
} }
} }
static void gpio_irq_ack_noop(unsigned int irq)
{
/* Dummy function. */
}
static struct irq_chip gpio_irqchip = { static struct irq_chip gpio_irqchip = {
.name = "GPIO", .name = "GPIO",
.mask = gpio_irq_mask, .mask = gpio_irq_mask,
.unmask = gpio_irq_unmask, .unmask = gpio_irq_unmask,
.set_type = gpio_irq_type, .set_type = gpio_irq_type,
.set_wake = gpio_irq_set_wake, .set_wake = gpio_irq_set_wake,
.ack = gpio_irq_ack_noop,
}; };
static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
...@@ -527,7 +533,7 @@ void __init at91_gpio_irq_setup(void) ...@@ -527,7 +533,7 @@ void __init at91_gpio_irq_setup(void)
* shorter, and the AIC handles interrupts sanely. * shorter, and the AIC handles interrupts sanely.
*/ */
set_irq_chip(pin, &gpio_irqchip); set_irq_chip(pin, &gpio_irqchip);
set_irq_handler(pin, handle_simple_irq); set_irq_handler(pin, handle_edge_irq);
set_irq_flags(pin, IRQF_VALID); set_irq_flags(pin, IRQF_VALID);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment