From: Grant Likely <grant.likely@linaro.org>
To: linux-kernel@vger.kernel.org, tglx@linutronix.de
Cc: Grant Likely <grant.likely@linaro.org>,
Paul Mundt <lethal@linux-sh.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 2/3] irqdomain: Relax failure path on setting up mappings
Date: Wed, 29 May 2013 03:10:53 +0100 [thread overview]
Message-ID: <1369793454-19197-3-git-send-email-grant.likely@linaro.org> (raw)
In-Reply-To: <1369793454-19197-1-git-send-email-grant.likely@linaro.org>
Commit 98aa468e, "irqdomain: Support for static IRQ mapping and
association" introduced an API for directly associating blocks of hwirqs
to linux irqs. However, if any irq in that block failed to map (say if
the mapping functions returns an error because the irq is already
mapped) then the whole thing will fail and roll back. This is probably
too aggressive since there are valid reasons why a mapping may fail.
ie. Firmware may have a particular IRQ marked as unusable.
This patch drops the error path out of irq_domain_associate(). If a
mapping fails, then it is simply skipped. There is no reason to fail the
entire allocation.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/irqdomain.c | 29 +++--------------------------
1 file changed, 3 insertions(+), 26 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 1db9e70..428ae1db 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -455,28 +455,9 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
irq_data->domain = domain;
if (domain->ops->map) {
ret = domain->ops->map(domain, virq, hwirq);
- if (ret != 0) {
- /*
- * If map() returns -EPERM, this interrupt is protected
- * by the firmware or some other service and shall not
- * be mapped.
- *
- * Since on some platforms we blindly try to map everything
- * we end up with a log full of backtraces.
- *
- * So instead, we silently fail on -EPERM, it is the
- * responsibility of the PIC driver to display a relevant
- * message if needed.
- */
- if (ret != -EPERM) {
- pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n",
- virq, hwirq, ret);
- WARN_ON(1);
- }
- irq_data->domain = NULL;
- irq_data->hwirq = 0;
- goto err_unmap;
- }
+ /* Some maps are refused; this is probably just fine */
+ if (ret)
+ continue;
}
switch (domain->revmap_type) {
@@ -495,10 +476,6 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
}
return 0;
-
- err_unmap:
- irq_domain_disassociate_many(domain, irq_base, i);
- return -EINVAL;
}
EXPORT_SYMBOL_GPL(irq_domain_associate_many);
--
1.8.1.2
next prev parent reply other threads:[~2013-05-29 2:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 2:10 [PATCH 0/3] Try out the irqdomain + generic chip integration series Grant Likely
2013-05-29 2:10 ` [PATCH 1/3] irqchip: Add mask to block out invalid irqs Grant Likely
2013-05-29 9:23 ` [tip:irq/core] genirq: " tip-bot for Grant Likely
2013-05-29 2:10 ` Grant Likely [this message]
2013-05-29 2:10 ` [PATCH 3/3] irqchip: Make versatile fpga irq driver a generic chip Grant Likely
2013-05-29 17:55 ` Linus Walleij
2013-05-29 19:56 ` Grant Likely
2013-05-30 21:06 ` Linus Walleij
2013-05-29 8:19 ` [PATCH 0/3] Try out the irqdomain + generic chip integration series Thomas Gleixner
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=1369793454-19197-3-git-send-email-grant.likely@linaro.org \
--to=grant.likely@linaro.org \
--cc=benh@kernel.crashing.org \
--cc=lethal@linux-sh.org \
--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 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®