Hi Jan,

I seem to recall you sent patches to fix threaded irqs some time ago. I 
am having a problem here without SMP, whereas the system works with 
SMP. A fasteoi irq handler triggers repeatedly while its threaded 
counterpart never gets triggered. I believe this is because 
handle_fasteoi_irq unconditionally releases the irq line. The following 
patch seems to fix the issue though I would prefer a cleaner solution.

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 11e75d1..2ff8d3a 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -463,8 +463,11 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
 
 #ifdef CONFIG_IPIPE
        /* XXX: IRQCHIP_EOI_IF_HANDLED is ignored. */
-       if (desc->irq_data.chip->irq_release)
-               desc->irq_data.chip->irq_release(&desc->irq_data);
+       if (desc->irq_data.chip->irq_release) {
+               if ((!(desc->istate & IRQS_ONESHOT) ||
+                    !desc->threads_oneshot))
+                       desc->irq_data.chip->irq_release(&desc->irq_data);
+       }
 out_eoi:
 #else  /* !CONFIG_IPIPE */
        if (desc->istate & IRQS_ONESHOT)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index e49a288..485c2c4 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -715,9 +715,15 @@ again:
 
        desc->threads_oneshot &= ~action->thread_mask;
 
-       if (!desc->threads_oneshot && !irqd_irq_disabled(&desc->irq_data) &&
-           irqd_irq_masked(&desc->irq_data))
-               unmask_irq(desc);
+       if (!desc->threads_oneshot && !irqd_irq_disabled(&desc->irq_data)) {
+#ifdef CONFIG_IPIPE
+               if (desc->irq_data.chip->irq_release)
+                       desc->irq_data.chip->irq_release(&desc->irq_data);
+               else 
+#endif
+                       if (irqd_irq_masked(&desc->irq_data))
+                               unmask_irq(desc);
+       }
 
 out_unlock:
        raw_spin_unlock_irq(&desc->lock);


-- 
                                                                Gilles.

_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to