public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: <tglx@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, <patches@opensource.wolfsonmicro.com>
Subject: [PATCH v2] genirq: Add support for nested shared IRQs
Date: Tue, 7 Mar 2017 16:28:18 +0000	[thread overview]
Message-ID: <1488904098-5350-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)

I am working on a system which has an audio CODEC and two speaker amps,
each of the speaker amps have an open-drain IRQ line which are connected
together and attached to a pin on the audio CODEC, which is capable of
functioning as an IRQ chip. The audio CODEC then in turn has its own IRQ
line which heads back to the host processor.

This setup necessitates having a shared nested IRQ on the audio CODEC.
Currently however the kernel does not appear to support shared nested
IRQs.

Fortunately support is fairly easy to add, only required the
modification of handle_nested_irq to call all the IRQ handlers, rather
than just the first one associated with the IRQ.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---

Changes since v1:
 - Improve commit messages
 - Use for_each_action_of_desc
 - Correct handling of note_interrupt

Thanks,
Charles

 kernel/irq/chip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index be3c34e..686be4b 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -348,7 +348,10 @@ void handle_nested_irq(unsigned int irq)
 	irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
 	raw_spin_unlock_irq(&desc->lock);
 
-	action_ret = action->thread_fn(action->irq, action->dev_id);
+	action_ret = IRQ_NONE;
+	for_each_action_of_desc(desc, action)
+		action_ret |= action->thread_fn(action->irq, action->dev_id);
+
 	if (!noirqdebug)
 		note_interrupt(desc, action_ret);
 
-- 
2.1.4

             reply	other threads:[~2017-03-07 16:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 16:28 Charles Keepax [this message]
2017-03-11 12:01 ` [tip:irq/core] genirq: Add support for nested shared IRQs tip-bot for Charles Keepax

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=1488904098-5350-1-git-send-email-ckeepax@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=tglx@linutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox