Skip to contentSkip to conversation

irqdomain: Improve diagnostics when a domain mapping fails

PATCH In review Mark Brown 1 participant 2 messages Jul 20, 2012

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 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).

---
 kernel/irq/irqdomain.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
kernel/irq/irqdomain.c +10 -5
index 68920c4..065a09d 100644
@@ -339,11 +339,16 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
 
 		irq_data->hwirq = hwirq;
 		irq_data->domain = domain;
-		if (domain->ops->map && domain->ops->map(domain, virq, hwirq)) {
-			pr_err("irq-%i==>hwirq-0x%lx mapping failed\n", virq, hwirq);
-			irq_data->domain = NULL;
-			irq_data->hwirq = 0;
-			goto err_unmap;
+		if (domain->ops->map) {
+			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->hwirq = 0;
+				goto err_unmap;
+			}
 		}
 
 		if (hwirq < domain->revmap_data.linear.size) {
Signature · 1 line
1.7.10.4
author
#1 lore raw
Quoted 3 lines · Mark Brown

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).

This needs a v2 - I had some other stuff in there which I'd forgotten added the ret variable, will resend shortly.