patch for seL4 kernel attached.
From 177c356416b0cddfb9a41c80fbe54749a57cd55e Mon Sep 17 00:00:00 2001
From: Tim Newsham <[email protected]>
Date: Fri, 20 Feb 2015 16:47:32 -1000
Subject: [PATCH] - fix am335x spurious interrupt issue

---
 src/plat/am335x/machine/hardware.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/plat/am335x/machine/hardware.c b/src/plat/am335x/machine/hardware.c
index fc3620e..e1ed279 100644
--- a/src/plat/am335x/machine/hardware.c
+++ b/src/plat/am335x/machine/hardware.c
@@ -170,20 +170,12 @@ getActiveIRQ(void)
     uint32_t intcps_sir_irq = intc->intcps_sir_irq;
     interrupt_t irq = (interrupt_t)(intcps_sir_irq & 0x7f);
 
-    /* Ignore spurious interrupts. */
     if ((intcps_sir_irq & INTCPS_SIR_IRQ_SPURIOUSIRQFLAG) == 0) {
         assert((irq / 32) < (sizeof intc->intcps_n / sizeof intc->intcps_n[0]));
         if (intc->intcps_n[irq / 32].intcps_pending_irq & (1 << (irq & 31))) {
             return irq;
-        } else {
-            /* XXX happening a lot for irq=66! */
         }
-    } else {
-        /* XXX - should never happen? */
-        printf("spurious irq %d / %x\n", irq, intcps_sir_irq);
     }
-
-    /* No interrupt. */
     return irqInvalid;
 }
 
@@ -224,9 +216,14 @@ void handleReservedIRQ(irq_t irq)
 void
 ackInterrupt(irq_t irq)
 {
+    /*
+     * am335x ref man, sec 6.2.2 only requires a DSB after NEWIRQAGR.
+     * I found that without dsb() or more code before, I get interrupts
+     * without the associated pending bit being set. Perhaps this
+     * indicates a missing barrier in code elsewhere? -TimN
+     */
+    dsb();
     intc->intcps_control = INTCPS_CONTROL_NEWIRQAGR;
-    /* Ensure the ack has hit the interrupt controller before potentially
-     * re-enabling interrupts. */
     dsb();
 }
 
-- 
1.9.1

_______________________________________________
Devel mailing list
[email protected]
https://sel4.systems/lists/listinfo/devel

Reply via email to