RT_PREEMPT problem with cascaded irqchip

Yann.LEPROVOST
2006-05-30T10:06:13Z

Hi folks,

After shared interrupt line with CONFIG_PREEMPT_HARDIRQS issue, I found
another problem with the gpio "interrupt on level change" management on
AT91RM9200.

>From the point of view of linux, there is to struct irqchip :
- one dealing with the interrupt controller (AIC)
- another one dealing with PIO controllers to mask and unmask interrupts
from gpios

The second one is cascaded with the first one through 4 irq lines (one for
each PIO controller, therefore 4 PIO controllers) using
set_irq_chained_handler.
After registering theses irqs, the gpio_irq_handler is correctly called on
gpio irqs...

However, when calling desc->chip->mask, the function at91rm9200_mask_irq is
called instead of gpio_mask_irq !
at91rm9200_mask_irq is registered on the first AIC struct irqchip.

I'm using linux-2.6.16-at91-rt23 with CONFIG_PREEMPT_HARDIRQS=yes
I have rewrite gpio_irq_handler as :

static void gpio_irq_handler(unsigned int irq, struct irqdesc* desc, struct
pt_regs* regs)
{
desc->chip->mask(irq);
desc->chip->unmask(irq);
}

As desc->chip->(un)mask(irq) doesn't acknowledge the PIO controller, kernel
loops in ISR...

What's wrong with desc->chip->mask ?

Regards

Yann Leprovost