diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-20 05:33:19 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-07-25 00:37:30 -0400 |
commit | f5a1ad057e6da5d0fc9c5677ff44797d193d3e62 (patch) | |
tree | 41eba9c89a1792d07db9110177fe62187a717f4e /kernel/irq/irqdomain.c | |
parent | 4c0946c47463defa681b83294383dc996d255bb7 (diff) |
irqdomain: Improve diagnostics when a domain mapping fails
When the map operation fails log the error code we get and add a WARN_ON()
so we get a backtrace (which should help work out which interrupt is the
source of the issue).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'kernel/irq/irqdomain.c')
-rw-r--r-- | kernel/irq/irqdomain.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 170724a07a2c..49a77727db42 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -415,7 +415,7 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, | |||
415 | { | 415 | { |
416 | unsigned int virq = irq_base; | 416 | unsigned int virq = irq_base; |
417 | irq_hw_number_t hwirq = hwirq_base; | 417 | irq_hw_number_t hwirq = hwirq_base; |
418 | int i; | 418 | int i, ret; |
419 | 419 | ||
420 | pr_debug("%s(%s, irqbase=%i, hwbase=%i, count=%i)\n", __func__, | 420 | pr_debug("%s(%s, irqbase=%i, hwbase=%i, count=%i)\n", __func__, |
421 | of_node_full_name(domain->of_node), irq_base, (int)hwirq_base, count); | 421 | of_node_full_name(domain->of_node), irq_base, (int)hwirq_base, count); |
@@ -436,11 +436,16 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, | |||
436 | 436 | ||
437 | irq_data->hwirq = hwirq; | 437 | irq_data->hwirq = hwirq; |
438 | irq_data->domain = domain; | 438 | irq_data->domain = domain; |
439 | if (domain->ops->map && domain->ops->map(domain, virq, hwirq)) { | 439 | if (domain->ops->map) { |
440 | pr_err("irq-%i==>hwirq-0x%lx mapping failed\n", virq, hwirq); | 440 | ret = domain->ops->map(domain, virq, hwirq); |
441 | irq_data->domain = NULL; | 441 | if (ret != 0) { |
442 | irq_data->hwirq = 0; | 442 | pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n", |
443 | goto err_unmap; | 443 | virq, hwirq, ret); |
444 | WARN_ON(1); | ||
445 | irq_data->domain = NULL; | ||
446 | irq_data->hwirq = 0; | ||
447 | goto err_unmap; | ||
448 | } | ||
444 | } | 449 | } |
445 | 450 | ||
446 | switch (domain->revmap_type) { | 451 | switch (domain->revmap_type) { |