linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>, Paul Mundt <lethal@linux-sh.org>,
	Grant Likely <grant.likely@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linuxppc-dev@lists.ozlabs.org
Subject: [RFC 01/10] irqdomain: Relax failure path on setting up mappings
Date: Mon, 10 Jun 2013 01:49:13 +0100	[thread overview]
Message-ID: <1370825362-11145-2-git-send-email-grant.likely@linaro.org> (raw)
In-Reply-To: <1370825362-11145-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.

v2: Still output an information message on failed mappings and make sure
    attempted mapping gets cleared out of the irq_data structure.

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 | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 20b677d..61d6d3c 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -464,23 +464,15 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
 				/*
 				 * 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.
+				 * be mapped. Don't bother telling the user about it.
 				 */
 				if (ret != -EPERM) {
-					pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n",
-					       virq, hwirq, ret);
-					WARN_ON(1);
+					pr_info("%s didn't like hwirq-0x%lx to VIRQ%i mapping (rc=%d)\n",
+					       of_node_full_name(domain->of_node), hwirq, virq, ret);
 				}
 				irq_data->domain = NULL;
 				irq_data->hwirq = 0;
-				goto err_unmap;
+				continue;
 			}
 		}
 
-- 
1.8.1.2

  reply	other threads:[~2013-06-10  0:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10  0:49 [RFC 00/10] Refactor irqdomain Grant Likely
2013-06-10  0:49 ` Grant Likely [this message]
2013-06-10  0:49 ` [RFC 02/10] irqdomain: Replace LEGACY mapping with LINEAR Grant Likely
2013-06-10  0:49 ` [RFC 03/10] irqdomain: Add a name field Grant Likely
2013-06-10  0:49 ` [RFC 04/10] irqdomain: merge linear and tree reverse mappings Grant Likely
2013-06-10  0:49 ` [RFC 05/10] irqdomain: Eliminate revmap type Grant Likely
2013-06-10  0:49 ` [RFC 06/10] irqdomain: Clean up aftermath of irq_domain refactoring Grant Likely
2013-06-10  0:49 ` [RFC 07/10] irqdomain: Beef up debugfs output Grant Likely
2013-06-10  0:49 ` [RFC 08/10] irqdomain: Refactor irq_domain_associate_many() Grant Likely
2013-06-18  3:09   ` Mike Qiu
2013-06-18  8:54     ` Grant Likely
2013-06-10  0:49 ` [RFC 09/10] irqdomain: remove irq_domain_generate_simple() Grant Likely
2013-06-10  0:49 ` [RFC 10/10] irqchip: Make versatile fpga irq driver a generic chip Grant Likely
2013-06-10  7:40   ` Linus Walleij
2013-06-10 10:50     ` Grant Likely
2013-06-15 21:19       ` Linus Walleij
2013-06-15 21:22         ` Linus Walleij
2013-06-15 22:48           ` Grant Likely
2013-06-10  9:03   ` Russell King - ARM Linux
2013-06-10 10:33     ` Grant Likely

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=1370825362-11145-2-git-send-email-grant.likely@linaro.org \
    --to=grant.likely@linaro.org \
    --cc=arnd@arndb.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).