* [PATCH] irqdomain: Improve diagnostics when a domain mapping fails
@ 2012-07-20 9:33 Mark Brown
2012-07-20 9:43 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-07-20 9:33 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Grant Likely, Thomas Gleixner
Cc: linux-kernel, 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).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
kernel/irq/irqdomain.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 68920c4..065a09d 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -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) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] irqdomain: Improve diagnostics when a domain mapping fails
2012-07-20 9:33 [PATCH] irqdomain: Improve diagnostics when a domain mapping fails Mark Brown
@ 2012-07-20 9:43 ` Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-07-20 9:43 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Grant Likely, Thomas Gleixner; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
On Fri, Jul 20, 2012 at 10:33:19AM +0100, Mark Brown wrote:
> 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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] irqdomain: Improve diagnostics when a domain mapping fails
@ 2012-07-20 9:44 Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-07-20 9:44 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Grant Likely, Thomas Gleixner
Cc: linux-kernel, 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).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
kernel/irq/irqdomain.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 68920c4..5dbcd30 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -318,7 +318,7 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
{
unsigned int virq = irq_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__,
of_node_full_name(domain->of_node), irq_base, (int)hwirq_base, count);
@@ -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) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-20 9:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 9:33 [PATCH] irqdomain: Improve diagnostics when a domain mapping fails Mark Brown
2012-07-20 9:43 ` Mark Brown
2012-07-20 9:44 Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.