diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-05-05 21:37:43 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-05-05 21:37:43 -0400 |
commit | 5fe0c1f2f0dca3351536284b0180a79f341b7854 (patch) | |
tree | 20e7cc0ae006c8e21fb476d27eeed30771262706 /kernel/irq | |
parent | f3d40c2532fee15a30d7a364ac365c21748a4a95 (diff) |
irqdomain: Allow quiet failure mode
Some interrupt controllers refuse to map interrupts marked as
"protected" by firwmare. Since we try to map everyting in the
device-tree on some platforms, we end up with a lot of nasty
WARN's in the boot log for what is a normal situation on those
machines.
This defines a specific return code (-EPERM) from the host map()
callback which cause irqdomain to fail silently.
MPIC is updated to return this when hitting a protected source
printing only a single line message for diagnostic purposes.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/irqdomain.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 96f3a1d9c379..5a83dde8ca0c 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -462,9 +462,23 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, | |||
462 | if (domain->ops->map) { | 462 | if (domain->ops->map) { |
463 | ret = domain->ops->map(domain, virq, hwirq); | 463 | ret = domain->ops->map(domain, virq, hwirq); |
464 | if (ret != 0) { | 464 | if (ret != 0) { |
465 | pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n", | 465 | /* |
466 | virq, hwirq, ret); | 466 | * If map() returns -EPERM, this interrupt is protected |
467 | WARN_ON(1); | 467 | * by the firmware or some other service and shall not |
468 | * be mapped. | ||
469 | * | ||
470 | * Since on some platforms we blindly try to map everything | ||
471 | * we end up with a log full of backtraces. | ||
472 | * | ||
473 | * So instead, we silently fail on -EPERM, it is the | ||
474 | * responsibility of the PIC driver to display a relevant | ||
475 | * message if needed. | ||
476 | */ | ||
477 | if (ret != -EPERM) { | ||
478 | pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n", | ||
479 | virq, hwirq, ret); | ||
480 | WARN_ON(1); | ||
481 | } | ||
468 | irq_data->domain = NULL; | 482 | irq_data->domain = NULL; |
469 | irq_data->hwirq = 0; | 483 | irq_data->hwirq = 0; |
470 | goto err_unmap; | 484 | goto err_unmap; |