diff mbox

powerpc: Print information about mapping hw irqs to virtual irqs

Message ID b804a7950247ceb99706be8cadb9bf5da5f73b09.1238983497.git.michael@ellerman.id.au (mailing list archive)
State Accepted, archived
Commit c7d07fdd5af084bbd0a7921f9b07037b9bc8829d
Delegated to: Paul Mackerras
Headers show

Commit Message

Michael Ellerman April 6, 2009, 2:05 a.m. UTC
The irq remapping layer seems to cause some confusion when people
see a different irq number in /proc/interrupts vs the one they
request in their driver or DTS.

So have the irq remapping layer print out a message when we map an
irq. The message is only printed the first time the irq is mapped,
and it's KERN_DEBUG so most people won't see it.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/kernel/irq.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Wolfram Sang April 6, 2009, 12:30 p.m. UTC | #1
On Mon, Apr 06, 2009 at 12:05:02PM +1000, Michael Ellerman wrote:
> The irq remapping layer seems to cause some confusion when people
> see a different irq number in /proc/interrupts vs the one they
> request in their driver or DTS.
> 
> So have the irq remapping layer print out a message when we map an
> irq. The message is only printed the first time the irq is mapped,
> and it's KERN_DEBUG so most people won't see it.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

I like the patch in general...

> ---
>  arch/powerpc/kernel/irq.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 5576147..8c1a496 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -672,11 +672,13 @@ unsigned int irq_create_mapping(struct irq_host *host,
>  			return NO_IRQ;
>  		}
>  	}
> -	pr_debug("irq: -> obtained virq %d\n", virq);
>  
>  	if (irq_setup_virq(host, virq, hwirq))
>  		return NO_IRQ;
>  
> +	printk(KERN_DEBUG "irq: irq %lu on host %s mapped to virtual irq %u\n",
> +		hwirq, host->of_node ? host->of_node->full_name : "null", virq);
> +

Are you replacing the pr_debug because you want to drop the
DEBUG-dependency?

>  	return virq;
>  }
>  EXPORT_SYMBOL_GPL(irq_create_mapping);
> -- 
> 1.6.1.2
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
Michael Ellerman April 6, 2009, 12:57 p.m. UTC | #2
On Mon, 2009-04-06 at 14:30 +0200, Wolfram Sang wrote:
> On Mon, Apr 06, 2009 at 12:05:02PM +1000, Michael Ellerman wrote:
> > diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> > index 5576147..8c1a496 100644
> > --- a/arch/powerpc/kernel/irq.c
> > +++ b/arch/powerpc/kernel/irq.c
> > @@ -672,11 +672,13 @@ unsigned int irq_create_mapping(struct irq_host *host,
> >  			return NO_IRQ;
> >  		}
> >  	}
> > -	pr_debug("irq: -> obtained virq %d\n", virq);
> >  
> >  	if (irq_setup_virq(host, virq, hwirq))
> >  		return NO_IRQ;
> >  
> > +	printk(KERN_DEBUG "irq: irq %lu on host %s mapped to virtual irq %u\n",
> > +		hwirq, host->of_node ? host->of_node->full_name : "null", virq);
> > +
> 
> Are you replacing the pr_debug because you want to drop the
> DEBUG-dependency?

Yes. Several people have been confused by the value in /proc/interrupts
not matching what they expected - so I want there to be something in
dmesg by default that will hopefully make it clear to people what's
going on.

cheers
Grant Likely April 6, 2009, 1:27 p.m. UTC | #3
On Sun, Apr 5, 2009 at 8:05 PM, Michael Ellerman <michael@ellerman.id.au> wrote:
> The irq remapping layer seems to cause some confusion when people
> see a different irq number in /proc/interrupts vs the one they
> request in their driver or DTS.
>
> So have the irq remapping layer print out a message when we map an
> irq. The message is only printed the first time the irq is mapped,
> and it's KERN_DEBUG so most people won't see it.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
>  arch/powerpc/kernel/irq.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 5576147..8c1a496 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -672,11 +672,13 @@ unsigned int irq_create_mapping(struct irq_host *host,
>                        return NO_IRQ;
>                }
>        }
> -       pr_debug("irq: -> obtained virq %d\n", virq);
>
>        if (irq_setup_virq(host, virq, hwirq))
>                return NO_IRQ;
>
> +       printk(KERN_DEBUG "irq: irq %lu on host %s mapped to virtual irq %u\n",
> +               hwirq, host->of_node ? host->of_node->full_name : "null", virq);
> +
>        return virq;
>  }
>  EXPORT_SYMBOL_GPL(irq_create_mapping);
> --
> 1.6.1.2
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
Wolfram Sang April 6, 2009, 1:58 p.m. UTC | #4
On Mon, Apr 06, 2009 at 12:05:02PM +1000, Michael Ellerman wrote:
> The irq remapping layer seems to cause some confusion when people
> see a different irq number in /proc/interrupts vs the one they
> request in their driver or DTS.
> 
> So have the irq remapping layer print out a message when we map an
> irq. The message is only printed the first time the irq is mapped,
> and it's KERN_DEBUG so most people won't see it.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

> ---
>  arch/powerpc/kernel/irq.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 5576147..8c1a496 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -672,11 +672,13 @@ unsigned int irq_create_mapping(struct irq_host *host,
>  			return NO_IRQ;
>  		}
>  	}
> -	pr_debug("irq: -> obtained virq %d\n", virq);
>  
>  	if (irq_setup_virq(host, virq, hwirq))
>  		return NO_IRQ;
>  
> +	printk(KERN_DEBUG "irq: irq %lu on host %s mapped to virtual irq %u\n",
> +		hwirq, host->of_node ? host->of_node->full_name : "null", virq);
> +
>  	return virq;
>  }
>  EXPORT_SYMBOL_GPL(irq_create_mapping);
> -- 
> 1.6.1.2
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
diff mbox

Patch

diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 5576147..8c1a496 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -672,11 +672,13 @@  unsigned int irq_create_mapping(struct irq_host *host,
 			return NO_IRQ;
 		}
 	}
-	pr_debug("irq: -> obtained virq %d\n", virq);
 
 	if (irq_setup_virq(host, virq, hwirq))
 		return NO_IRQ;
 
+	printk(KERN_DEBUG "irq: irq %lu on host %s mapped to virtual irq %u\n",
+		hwirq, host->of_node ? host->of_node->full_name : "null", virq);
+
 	return virq;
 }
 EXPORT_SYMBOL_GPL(irq_create_mapping);