All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irq: fix crash due to op-less irq domains
@ 2011-12-14 20:55 Linus Walleij
  2011-12-14 22:14 ` Rob Herring
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2011-12-14 20:55 UTC (permalink / raw)
  To: linux-kernel, Rob Herring, Thomas Gleixner
  Cc: Linus Walleij, Rob Herring, Thomas Gleixner

From: Linus Walleij <linus.walleij@linaro.org>

IRQ domains without ops does not work anymore after commit
"irq: support domains with non-zero hwirq base", since the
check dereferences domain->ops->to_irq without checking of
domain->ops are NULL. This makes U300 (and probably most other
systems using the PL190 VIC) boot again.

Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 include/linux/irqdomain.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 99834e58..78a1e66 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -74,7 +74,7 @@ struct irq_domain {
 static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
 					     unsigned long hwirq)
 {
-	if (d->ops->to_irq)
+	if (d->ops && d->ops->to_irq)
 		return d->ops->to_irq(d, hwirq);
 	if (WARN_ON(hwirq < d->hwirq_base))
 		return 0;
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] irq: fix crash due to op-less irq domains
  2011-12-14 20:55 [PATCH] irq: fix crash due to op-less irq domains Linus Walleij
@ 2011-12-14 22:14 ` Rob Herring
  2011-12-14 22:22   ` Jamie Iles
  2011-12-14 22:24   ` Linus Walleij
  0 siblings, 2 replies; 6+ messages in thread
From: Rob Herring @ 2011-12-14 22:14 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, Thomas Gleixner, Linus Walleij, Jamie Iles,
	Marc Zyngier

Linus,

On 12/14/2011 02:55 PM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> IRQ domains without ops does not work anymore after commit
> "irq: support domains with non-zero hwirq base", since the
> check dereferences domain->ops->to_irq without checking of
> domain->ops are NULL. This makes U300 (and probably most other
> systems using the PL190 VIC) boot again.

I thought the VIC series had the fix for this, but it seems not. NULL
ops is considered invalid based on the code comments. The correct fix is
this patch:

irqdomain: export irq_domain_simple_ops for !CONFIG_OF
http://www.spinics.net/lists/arm-kernel/msg150290.html

I believe this is going in with some iMX changes. But I guess the VIC is
going to need a fix to use irq_domain_simple_ops.

Rob

> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  include/linux/irqdomain.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
> index 99834e58..78a1e66 100644
> --- a/include/linux/irqdomain.h
> +++ b/include/linux/irqdomain.h
> @@ -74,7 +74,7 @@ struct irq_domain {
>  static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
>  					     unsigned long hwirq)
>  {
> -	if (d->ops->to_irq)
> +	if (d->ops && d->ops->to_irq)
>  		return d->ops->to_irq(d, hwirq);
>  	if (WARN_ON(hwirq < d->hwirq_base))
>  		return 0;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] irq: fix crash due to op-less irq domains
  2011-12-14 22:14 ` Rob Herring
@ 2011-12-14 22:22   ` Jamie Iles
  2011-12-14 22:26     ` Linus Walleij
  2011-12-14 22:24   ` Linus Walleij
  1 sibling, 1 reply; 6+ messages in thread
From: Jamie Iles @ 2011-12-14 22:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, linux-kernel, Thomas Gleixner, Linus Walleij,
	Jamie Iles, Marc Zyngier

On Wed, Dec 14, 2011 at 04:14:53PM -0600, Rob Herring wrote:
> Linus,
> 
> On 12/14/2011 02:55 PM, Linus Walleij wrote:
> > From: Linus Walleij <linus.walleij@linaro.org>
> > 
> > IRQ domains without ops does not work anymore after commit
> > "irq: support domains with non-zero hwirq base", since the
> > check dereferences domain->ops->to_irq without checking of
> > domain->ops are NULL. This makes U300 (and probably most other
> > systems using the PL190 VIC) boot again.
> 
> I thought the VIC series had the fix for this, but it seems not. NULL
> ops is considered invalid based on the code comments. The correct fix is
> this patch:
> 
> irqdomain: export irq_domain_simple_ops for !CONFIG_OF
> http://www.spinics.net/lists/arm-kernel/msg150290.html
> 
> I believe this is going in with some iMX changes. But I guess the VIC is
> going to need a fix to use irq_domain_simple_ops.

Yes, Thomas has acked that patch, but it wasn't clear who was going to 
merge it.  I asked if this could go through Russell along with a patch 
to make the VIC driver use it but haven't heard anything back yet.  I'll 
repost them now.

Jamie

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] irq: fix crash due to op-less irq domains
  2011-12-14 22:14 ` Rob Herring
  2011-12-14 22:22   ` Jamie Iles
@ 2011-12-14 22:24   ` Linus Walleij
  2011-12-15  7:03     ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2011-12-14 22:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, linux-kernel, Thomas Gleixner, Jamie Iles,
	Marc Zyngier, Russell King - ARM Linux

On Wed, Dec 14, 2011 at 11:14 PM, Rob Herring <robherring2@gmail.com> wrote:
> Linus,
>
> On 12/14/2011 02:55 PM, Linus Walleij wrote:
>> From: Linus Walleij <linus.walleij@linaro.org>
>>
>> IRQ domains without ops does not work anymore after commit
>> "irq: support domains with non-zero hwirq base", since the
>> check dereferences domain->ops->to_irq without checking of
>> domain->ops are NULL. This makes U300 (and probably most other
>> systems using the PL190 VIC) boot again.
>
> I thought the VIC series had the fix for this, but it seems not. NULL
> ops is considered invalid based on the code comments. The correct fix is
> this patch:
>
> irqdomain: export irq_domain_simple_ops for !CONFIG_OF
> http://www.spinics.net/lists/arm-kernel/msg150290.html
>
> I believe this is going in with some iMX changes.

Can we please move this patch over to whatever branch the patch that
breaks my system is on, so I can create a proper fix for the
non-devicetree VIC users then?

Or apply an exact copy of the patch. Git will cope.

(Among the systems broken are likely the ARM Versatile too BTW,
not just obscure things like my U300.)

> But I guess the VIC is
> going to need a fix to use irq_domain_simple_ops.

If I just have the baseline in linux-next, I can fix it, but then I need
that patch in linux-next first, now all non-devicetree VIC systems are
just broken with no way for me to fix them :-(

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] irq: fix crash due to op-less irq domains
  2011-12-14 22:22   ` Jamie Iles
@ 2011-12-14 22:26     ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2011-12-14 22:26 UTC (permalink / raw)
  To: Jamie Iles
  Cc: Rob Herring, Linus Walleij, linux-kernel, Thomas Gleixner,
	Marc Zyngier, Russell King - ARM Linux

On Wed, Dec 14, 2011 at 11:22 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> On Wed, Dec 14, 2011 at 04:14:53PM -0600, Rob Herring wrote:
>>
>> I believe this is going in with some iMX changes. But I guess the VIC is
>> going to need a fix to use irq_domain_simple_ops.
>
> Yes, Thomas has acked that patch, but it wasn't clear who was going to
> merge it.  I asked if this could go through Russell along with a patch
> to make the VIC driver use it but haven't heard anything back yet.  I'll
> repost them now.

Can you please repost, then put them in Russell's patch tracker?

Would be super!
Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] irq: fix crash due to op-less irq domains
  2011-12-14 22:24   ` Linus Walleij
@ 2011-12-15  7:03     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2011-12-15  7:03 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Rob Herring, Linus Walleij, linux-kernel, Thomas Gleixner,
	Jamie Iles, Marc Zyngier, Russell King - ARM Linux

On Wed, Dec 14, 2011 at 11:24:59PM +0100, Linus Walleij wrote:

> If I just have the baseline in linux-next, I can fix it, but then I need
> that patch in linux-next first, now all non-devicetree VIC systems are
> just broken with no way for me to fix them :-(

Yes, this really needs fixing - I've been carrying the same patch as
Linus plus three more found due to the same problems for a while now in
order to allow me to boot my systems.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-15  7:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 20:55 [PATCH] irq: fix crash due to op-less irq domains Linus Walleij
2011-12-14 22:14 ` Rob Herring
2011-12-14 22:22   ` Jamie Iles
2011-12-14 22:26     ` Linus Walleij
2011-12-14 22:24   ` Linus Walleij
2011-12-15  7:03     ` 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.