All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] genirq: Fix handle_nested_irq() for IRQF_SHARED
Date: Mon, 13 Mar 2017 17:52:40 -0700	[thread overview]
Message-ID: <20170314005240.18911-1-tony@atomide.com> (raw)

Shared interrupts can be registered with handle_nested_irq(), but
currently only one of the registered handlers gets called.

The use of shared interrupts with handle_nested_irq() is probably rare,
but at least a case of a shared VBUS interrupt between USB PHY and
battery charger drivers for a PMIC makes sense.

Typically for_each_action_of_desc() gets called via handle_irq_event()
at _handle_irq_event_percpu(), but handle_nested_irq() is different
because of it's dummy irq_nested_primary_handler().

Let's fix the issue by calling the handler for all the entries in
the action list.

Fixes: 399b5da29b9f ("genirq: Support nested threaded irq handling")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 kernel/irq/chip.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -348,9 +348,11 @@ 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);
-	if (!noirqdebug)
-		note_interrupt(desc, action_ret);
+	for_each_action_of_desc(desc, action) {
+		action_ret = action->thread_fn(action->irq, action->dev_id);
+		if (!noirqdebug)
+			note_interrupt(desc, action_ret);
+	}
 
 	raw_spin_lock_irq(&desc->lock);
 	irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
-- 
2.11.1

             reply	other threads:[~2017-03-14  0:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14  0:52 Tony Lindgren [this message]
2017-03-14  8:38 ` [PATCH] genirq: Fix handle_nested_irq() for IRQF_SHARED Thomas Gleixner
2017-03-14 14:48   ` Tony Lindgren

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=20170314005240.18911-1-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.