Skip to contentSkip to conversation

hal/arm : rthal_irq_enable/disable/end corrections

PATCH Applied Dmitry Adamushko 2 participants 2 messages Mar 1, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hal/arm : rthal_irq_enable/disable/end corrections

Hello,

Linux'es enable/disable_irq() should not be called from the primary domain.

In short, they use a normal linux spinlock + irq are off only for the Linux domain;
the precise description is available here :
https://mail.gna.org/public/xenomai-core/2006-02/msg00213.html

--
Best regards,
Dmitry Adamushko

hal.c renamed from hal.c-CVS +11 -8
@@ -161,7 +161,11 @@ int rthal_irq_enable (unsigned irq)
     if (irq >= IPIPE_NR_XIRQS)
         return -EINVAL;
 
-    enable_irq(irq);
+    if (rthal_irq_descp(irq)->handler == NULL ||
+	rthal_irq_descp(irq)->handler->enable == NULL)
+	return -ENODEV;
+
+    rthal_irq_descp(irq)->handler->enable(irq);
 
     return 0;
 }
@@ -171,19 +175,18 @@ int rthal_irq_disable (unsigned irq)
     if (irq >= IPIPE_NR_XIRQS)
         return -EINVAL;
 
-    disable_irq(irq);
+    if (rthal_irq_descp(irq)->handler == NULL ||
+	rthal_irq_descp(irq)->handler->disable == NULL)
+	return -ENODEV;
+
+    rthal_irq_descp(irq)->handler->disable(irq);
 
     return 0;
 }
 
 int rthal_irq_end (unsigned irq)
 {
-    if (irq >= IPIPE_NR_XIRQS)
-        return -EINVAL;
-
-    enable_irq(irq);
-
-    return 0;
+    return rthal_irq_enable(irq);
 }
 
 static inline int do_exception_event (unsigned event, unsigned domid, void *data)
#1 lore raw
Quoted 4 lines · Dmitry Adamushko

Hello,

Linux'es enable/disable_irq() should not be called from the primary domain.

Applied, thanks.

Quoted 16 lines

In short, they use a normal linux spinlock + irq are off only for the Linux domain;
the precise description is available here : https://mail.gna.org/public/xenomai-core/2006-02/msg00213.html

Signature · 10 lines
Best regards,
Dmitry Adamushko


------------------------------------------------------------------------

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.