All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] irqdomain: print a warning if domains contain IRQ 0
Date: Thu, 19 Apr 2012 12:29:17 -0600	[thread overview]
Message-ID: <20120419182917.2F64E3E0700@localhost> (raw)
In-Reply-To: <1334787792.3143.19.camel@pasglop>

On Thu, 19 Apr 2012 08:23:12 +1000, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Wed, 2012-04-18 at 15:40 +0200, Linus Walleij wrote:
> > From: Linus Walleij <linus.walleij@linaro.org>
> > 
> > Some of the clients using IRQ domains from the ARM VIC
> > (arch/arm/common/vic.c) don't know that their (hardware) IRQ 0
> > is silently ignored by the IRQ core, they will just notice
> > that they're not getting this IRQ anymore. So print a warning
> > if a domain contains IRQ 0 (NO_IRQ) so we get some noise about
> > it atleast.
> 
> I don't understand. HW IRQ 0 is not ignored and works perfectly
> fine on "normal" remapped domains. Or is this specific to "legacy
> domains" ? In this case pls make it clear in the subject :-)

This is indeed specific to the legacy domain.  I think the patch is
good and it will help weed out unintended irq0 users.  However, it
requires the following additional fix I think.  It will need to be
tested to make sure it doesn't break PowerPC ISA users.

g.

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index d0995bd..31f1f88 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -138,7 +138,7 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
 				const struct irq_domain_ops *ops,
 				void *host_data)
 {
-	return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops,
+	return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS-1, 1, 1, ops,
 				     host_data);
 }
 extern struct irq_domain *irq_find_host(struct device_node *node);


> > ---
> >  kernel/irq/irqdomain.c |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
> > index 0e0ba5f..1444454 100644
> > --- a/kernel/irq/irqdomain.c
> > +++ b/kernel/irq/irqdomain.c
> > @@ -136,8 +136,10 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
> >  		int hwirq = first_hwirq + i;
> >  
> >  		/* IRQ0 gets ignored */
> > -		if (!irq)
> > +		if (!irq) {
> > +			pr_warn("trying to register IRQ 0 (NO_IRQ) in an irq  domain\n");
> >  			continue;
> > +		}
> >  
> >  		/* Legacy flags are left to default at this point,
> >  		 * one can then use irq_create_mapping() to
> 
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

  parent reply	other threads:[~2012-04-19 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 13:40 [PATCH] irqdomain: print a warning if domains contain IRQ 0 Linus Walleij
2012-04-18 22:23 ` Benjamin Herrenschmidt
2012-04-18 22:32   ` Linus Walleij
2012-04-19 18:29   ` Grant Likely [this message]
2012-04-20  6:38     ` Linus Walleij
2012-04-27 18:56       ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120419182917.2F64E3E0700@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=benh@kernel.crashing.org \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.