All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Interrupt only runs once
@ 2009-09-15 15:27 James Kilts
  2009-09-16 15:47 ` Philippe Gerum
  0 siblings, 1 reply; 9+ messages in thread
From: James Kilts @ 2009-09-15 15:27 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 2113 bytes --]

I'm porting Xenomai/I-pipe to the NS921x (an arm9-based) platform, but I'm
having problems getting the interrupts to re-enable after the first
interrupt triggers.

A kernel driver module is being used to test the interrupt latency using an
input GPIO pin which triggers a dedicated external IRQ, to which the ISR
responds by toggling a different GPIO pin.  I realize that there are test
applications which do very similar things, and that the RTDM skin is
preferable over the native API.  Still, I would like to understand why the
interrupt is not being properly acknowledged and reset.

If the ISR manually performs the ACK and EOI using platform specific calls,
subsequent interrupts are handled properly.  My understanding was that
Xenomai should re-enable the interrupt for processing without such
intervention.  How do I force Xenomai to clear and re-enable the interrupt
to handle subsequent interrupts?

Thanks,
James



static int __init turnaround_irq_measure_init(void)
{
    ....

    retval = rt_intr_create(&irq_response_desc,
"ns9xxx_measure_irq_rt_response",
                            TURNAROUND_INPUT_IRQ,
turnaround_irq_measure_response,
                            NULL, NULL);

    if (retval == 0)  // 0 is success
    {
        set_irq_type(TURNAROUND_INPUT_IRQ, IRQ_TYPE_EDGE_FALLING);
        retval = rt_intr_enable(&irq_response_desc);

        if (retval != 0)  // 0 is success
        {
            console_print("Turnaround test driver rt interrupt enable:
FAILED\n");
        }
    }
    else
    {
        console_print("Turnaround test driver rt interrupt create:
FAILED\n");
    }

    return 0;
}


static int turnaround_irq_measure_response(struct xnintr *intr)
{
    /* Set GPIO pin low */
    gpio_set_value(TURNAROUND_OUTPUT_GPIO, 0);

    /* Wait 50 microseconds */
    rt_timer_spin(50000);

    /* Set GPIO pin high */
    gpio_set_value(TURNAROUND_OUTPUT_GPIO, 1);

    /* Start listening again */
    /* NOTE:  These two lines should not be necessary */
    ns9xxx_ack_irq(TURNAROUND_INPUT_IRQ);
    ns9xxx_eoi_irq(TURNAROUND_INPUT_IRQ);

    return RT_INTR_HANDLED;
}

[-- Attachment #2: Type: text/html, Size: 2388 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-24 18:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-15 15:27 [Xenomai-help] Interrupt only runs once James Kilts
2009-09-16 15:47 ` Philippe Gerum
2009-09-17 17:26   ` James Kilts
2009-09-17 17:31     ` Gilles Chanteperdrix
2009-09-17 17:39     ` Gilles Chanteperdrix
2009-09-17 20:45       ` James Kilts
2009-09-17 20:58         ` Gilles Chanteperdrix
2009-09-24 18:46           ` James Kilts
2009-09-24 18:58             ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.