Commit f5a1ad05 authored by Mark Brown's avatar Mark Brown Committed by Grant Likely

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 4c0946c4
...@@ -415,7 +415,7 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, ...@@ -415,7 +415,7 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
{ {
unsigned int virq = irq_base; unsigned int virq = irq_base;
irq_hw_number_t hwirq = hwirq_base; irq_hw_number_t hwirq = hwirq_base;
int i; int i, ret;
pr_debug("%s(%s, irqbase=%i, hwbase=%i, count=%i)\n", __func__, pr_debug("%s(%s, irqbase=%i, hwbase=%i, count=%i)\n", __func__,
of_node_full_name(domain->of_node), irq_base, (int)hwirq_base, count); of_node_full_name(domain->of_node), irq_base, (int)hwirq_base, count);
...@@ -436,12 +436,17 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, ...@@ -436,12 +436,17 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
irq_data->hwirq = hwirq; irq_data->hwirq = hwirq;
irq_data->domain = domain; irq_data->domain = domain;
if (domain->ops->map && domain->ops->map(domain, virq, hwirq)) { if (domain->ops->map) {
pr_err("irq-%i==>hwirq-0x%lx mapping failed\n", virq, hwirq); ret = domain->ops->map(domain, virq, hwirq);
if (ret != 0) {
pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n",
virq, hwirq, ret);
WARN_ON(1);
irq_data->domain = NULL; irq_data->domain = NULL;
irq_data->hwirq = 0; irq_data->hwirq = 0;
goto err_unmap; goto err_unmap;
} }
}
switch (domain->revmap_type) { switch (domain->revmap_type) {
case IRQ_DOMAIN_MAP_LINEAR: case IRQ_DOMAIN_MAP_LINEAR:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment