From: Marc Zyngier <marc.zyngier@arm.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Jiang Liu <jiang.liu@linux.intel.com>
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] genirq: Work around __irq_set_handler vs stacked domains ordering issues
Date: Sat, 15 Nov 2014 10:49:13 +0000 [thread overview]
Message-ID: <1416048553-29289-3-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1416048553-29289-1-git-send-email-marc.zyngier@arm.com>
With the introduction of stacked domains, we have the issue that,
depending on where in the stack this is called, __irq_set_handler
will succeed or fail: If this is called from the inner irqchip,
__irq_set_handler() will fail, as it will look at the outer domain
as the (desc->irq_data.chip == &no_irq_chip) test fails (we haven't
set the top level yet).
This patch implements the following: "If there is at least one
valid irqchip in the domain, it will probably sort itself out".
This is clearly not ideal, but it is far less confusing then
crashing because the top-level domain is not up yet.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
kernel/irq/chip.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index d028b34..cad4f62 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -731,7 +731,16 @@ __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
if (!handle) {
handle = handle_bad_irq;
} else {
- if (WARN_ON(desc->irq_data.chip == &no_irq_chip))
+ struct irq_data *irq_data = &desc->irq_data;
+#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+ while (irq_data) {
+ if (irq_data->chip != &no_irq_chip)
+ break;
+ irq_data = irq_data->parent_data;
+ }
+#endif
+
+ if (WARN_ON(!irq_data || irq_data->chip == &no_irq_chip))
goto out;
}
--
2.1.0
next prev parent reply other threads:[~2014-11-15 10:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-15 10:49 [PATCH 0/2] Stacked domains and MSI improvements Marc Zyngier
2014-11-15 10:49 ` [PATCH 1/2] PCI/MSI: Allow an msi_chip to be associated to an irq domain Marc Zyngier
2014-11-23 18:14 ` [tip:irq/irqdomain] PCI/MSI: Allow an msi_controller " tip-bot for Marc Zyngier
2014-11-15 10:49 ` Marc Zyngier [this message]
2014-11-23 18:11 ` [tip:irq/irqdomain] genirq: Work around __irq_set_handler vs stacked domains ordering issues tip-bot for Marc Zyngier
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=1416048553-29289-3-git-send-email-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=bhelgaas@google.com \
--cc=jiang.liu@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=yingjoe.chen@mediatek.com \
/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
all inboxes | Powered by JetHome®