Philippe Gerum wrote:
Anders Blomdell wrote:

When trying to run Xenomai on PowerPC with OpenPIC, I have (finally) found that interrupt latency is much improved with the following patch:



--- arch/ppc/syslib/open_pic.c~ 2006-01-08 03:15:24.000000000 +0100
+++ arch/ppc/syslib/open_pic.c  2006-02-07 16:56:14.000000000 +0100
@@ -820,7 +820,7 @@
  */
 static void openpic_ack_irq(unsigned int irq_nr)
 {
-#ifdef __SLOW_VERSION__
+#if defined(__SLOW_VERSION__) || defined(CONFIG_IPIPE)
        openpic_disable_irq(irq_nr);
        openpic_eoi();
 #else
@@ -831,7 +831,7 @@

 static void openpic_end_irq(unsigned int irq_nr)
 {
-#ifdef __SLOW_VERSION__
+#if defined(__SLOW_VERSION__) || defined(CONFIG_IPIPE)
        if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
            && irq_desc[irq_nr].action)
                openpic_enable_irq(irq_nr);



The reason for this, is that the fast version doesn't call openpic_eoi until the interrupt is ended, which means that all RT-interrupts are delayed by a pending Linux interrupt.


Gasp. Will check on my Icecube asap, thanks (a lot).


The mpc52xx is using its own version of PIC management - which should not induce such delay on eoi, so I cannot experiment this change yet. However, I've revisited your patch so that the OpenPIC code always sends eoi in fast mode, regardless of the interrupt polarity. Could you try the patch below and let me know of the outcome? TIA,

--- arch/ppc/syslib/open_pic.c~ 2005-10-28 02:02:08.000000000 +0200
+++ arch/ppc/syslib/open_pic.c  2006-02-08 10:30:22.000000000 +0100
@@ -824,7 +824,9 @@
        openpic_disable_irq(irq_nr);
        openpic_eoi();
 #else
+#ifndef CONFIG_IPIPE
        if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0)
+#endif /* CONFIG_IPIPE */
                openpic_eoi();
 #endif
 }
@@ -836,8 +838,10 @@
            && irq_desc[irq_nr].action)
                openpic_enable_irq(irq_nr);
 #else
+#ifndef CONFIG_IPIPE
        if ((irq_desc[irq_nr].status & IRQ_LEVEL) != 0)
                openpic_eoi();
+#endif /* CONFIG_IPIPE */
 #endif
 }


--

Philippe.

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to