All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@web.de>
Subject: [Xenomai] one-shot fasteoi irqs
Date: Wed, 27 Mar 2013 00:05:40 +0100	[thread overview]
Message-ID: <515229C4.6000805@xenomai.org> (raw)


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.


             reply	other threads:[~2013-03-26 23:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 23:05 Gilles Chanteperdrix [this message]
2013-03-27  6:50 ` [Xenomai] one-shot fasteoi irqs Jan Kiszka
2013-03-27  9:23   ` Gilles Chanteperdrix
2013-03-27  9:30     ` Jan Kiszka
2013-03-27 12:55       ` Gilles Chanteperdrix
2013-03-27 13:30         ` Jan Kiszka
2013-03-27 20:50           ` Gilles Chanteperdrix
2013-04-02 21:44           ` Gilles Chanteperdrix
2013-04-06  9:43             ` Jan Kiszka
2013-04-08 21:09               ` Gilles Chanteperdrix
2013-04-10  9:32                 ` Philippe Gerum
2013-04-10 10:36                   ` Jan Kiszka
2013-04-10 19:36                     ` Gilles Chanteperdrix
2013-04-11  7:35                       ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515229C4.6000805@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.