linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0 to VIRQ8 mapping (rc=-19)
@ 2019-12-20 16:49 H. Nikolaus Schaller
  2019-12-20 17:01 ` Paul Cercueil
  0 siblings, 1 reply; 6+ messages in thread
From: H. Nikolaus Schaller @ 2019-12-20 16:49 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Discussions about the Letux Kernel, Linux Kernel Mailing List,
	linux-mips, MIPS Creator CI20 Development, Marc Zyngier,
	Zhou Yanjie

Hi Paul,
since v5.5-rc1 the boot log is flooded by a sequence of messages like:

[    0.000000] NR_IRQS: 222
[    0.000000] irq: :interrupt-controller@10001000 didn't like hwirq-0x0 to VIRQ8 mapping (rc=-19)
[    0.000000] irq: :interrupt-controller@10001000 didn't like hwirq-0x1 to VIRQ9 mapping (rc=-19)
[    0.000000] irq: :interrupt-controller@10001000 didn't like hwirq-0x2 to VIRQ10 mapping (rc=-19)
[    0.000000] irq: :interrupt-controller@10001000 didn't like hwirq-0x3 to VIRQ11 mapping (rc=-19)
[    0.000000] irq: :interrupt-controller@10001000 didn't like hwirq-0x4 to VIRQ12 mapping (rc=-19)
...
[    0.000000] irq: :interrupt-controller@10001000 didn't like hwirq-0x3e to VIRQ70 mapping (rc=-19)
[    0.000000] irq: :interrupt-controller@10001000 didn't like hwirq-0x3f to VIRQ71 mapping (rc=-19)

A handful of /proc/interrupts are nevertheless working.

I have now analyzed the situation a little:

* the message is printed by irq_domain_associate()
* call sequence is ingenic_intc_of_init() -> irq_domain_add_legacy() -> irq_domain_associate_many() -> irq_domain_associate()
* the reason for the message is that
  domain->ops->map()
  called in irq_domain_associate() returns an error
* domain->ops is initialized to &irq_generic_chip_ops
* domain->ops->map is initialized to irq_map_generic_chip()
* irq_map_generic_chip() calls __irq_get_domain_generic_chip()
* which returns -ENODEV (-19) if d->gc == NULL

So the location, where the -19 comes from, is found.

Now why is d->gc == NULL in __irq_get_domain_generic_chip() ?

This IMHO seems to be a bad initialization sequence:

* ingenic_intc_of_init() calls firstly irq_domain_add_legacy()
* which does *not* initialize domain->gc but expects it to be !NULL through irq_map_generic_chip()
* and would only irq_alloc_domain_generic_chips() which initializes domain->gc if irq_domain_add_legacy() is successful
* irq_alloc_domain_generic_chips() would initialize domain->gc by calling __irq_alloc_domain_generic_chips()

There are indeed significant changes in drivers/irqchip/irq-ingenic.c
from v5.4to v5.5-rc1 which have introduced the use of irq_domain_add_legacy()
and irq_alloc_domain_generic_chips() by

52ecc87642f2 irqchip: ingenic: Error out if IRQ domain creation failed
208caadce5d4 irqchip: ingenic: Get virq number from IRQ domain
8bc7464b5140 irqchip: ingenic: Alloc generic chips from IRQ domain
b8b0145f7d0e irqchip: Ingenic: Add process for more than one irq at the same time.

Most likely 52ecc87642f2 has changed the call sequence and therefore always fails.

Is there some essential patch missing to be upstreamed?
I have looked but not found anything related in linux-next.

I have also tried reverting 52ecc87642f2 alone but it has conflicts.

But I can revert all 4 commits with an otherwise unchanged setup and
the messages are gone for me.

How would a fix look like?

BR and thanks,
Nikolaus


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

* Re: [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0 to VIRQ8 mapping (rc=-19)
  2019-12-20 16:49 [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0 to VIRQ8 mapping (rc=-19) H. Nikolaus Schaller
@ 2019-12-20 17:01 ` Paul Cercueil
  2019-12-20 17:09   ` Marc Zyngier
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Cercueil @ 2019-12-20 17:01 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Discussions about the Letux Kernel, Linux Kernel Mailing List,
	linux-mips, MIPS Creator CI20 Development, Marc Zyngier,
	Zhou Yanjie

Hi Nikolaus,

Try with this: https://lkml.org/lkml/2019/11/22/1831

And don't hesitate to add your Tested-by :)

Cheers,
-Paul


Le ven., déc. 20, 2019 at 17:49, H. Nikolaus Schaller 
<hns@goldelico.com> a écrit :
> Hi Paul,
> since v5.5-rc1 the boot log is flooded by a sequence of messages like:
> 
> [    0.000000] NR_IRQS: 222
> [    0.000000] irq: :interrupt-controller@10001000 didn't like 
> hwirq-0x0 to VIRQ8 mapping (rc=-19)
> [    0.000000] irq: :interrupt-controller@10001000 didn't like 
> hwirq-0x1 to VIRQ9 mapping (rc=-19)
> [    0.000000] irq: :interrupt-controller@10001000 didn't like 
> hwirq-0x2 to VIRQ10 mapping (rc=-19)
> [    0.000000] irq: :interrupt-controller@10001000 didn't like 
> hwirq-0x3 to VIRQ11 mapping (rc=-19)
> [    0.000000] irq: :interrupt-controller@10001000 didn't like 
> hwirq-0x4 to VIRQ12 mapping (rc=-19)
> ...
> [    0.000000] irq: :interrupt-controller@10001000 didn't like 
> hwirq-0x3e to VIRQ70 mapping (rc=-19)
> [    0.000000] irq: :interrupt-controller@10001000 didn't like 
> hwirq-0x3f to VIRQ71 mapping (rc=-19)
> 
> A handful of /proc/interrupts are nevertheless working.
> 
> I have now analyzed the situation a little:
> 
> * the message is printed by irq_domain_associate()
> * call sequence is ingenic_intc_of_init() -> irq_domain_add_legacy() 
> -> irq_domain_associate_many() -> irq_domain_associate()
> * the reason for the message is that
>   domain->ops->map()
>   called in irq_domain_associate() returns an error
> * domain->ops is initialized to &irq_generic_chip_ops
> * domain->ops->map is initialized to irq_map_generic_chip()
> * irq_map_generic_chip() calls __irq_get_domain_generic_chip()
> * which returns -ENODEV (-19) if d->gc == NULL
> 
> So the location, where the -19 comes from, is found.
> 
> Now why is d->gc == NULL in __irq_get_domain_generic_chip() ?
> 
> This IMHO seems to be a bad initialization sequence:
> 
> * ingenic_intc_of_init() calls firstly irq_domain_add_legacy()
> * which does *not* initialize domain->gc but expects it to be !NULL 
> through irq_map_generic_chip()
> * and would only irq_alloc_domain_generic_chips() which initializes 
> domain->gc if irq_domain_add_legacy() is successful
> * irq_alloc_domain_generic_chips() would initialize domain->gc by 
> calling __irq_alloc_domain_generic_chips()
> 
> There are indeed significant changes in drivers/irqchip/irq-ingenic.c
> from v5.4to v5.5-rc1 which have introduced the use of 
> irq_domain_add_legacy()
> and irq_alloc_domain_generic_chips() by
> 
> 52ecc87642f2 irqchip: ingenic: Error out if IRQ domain creation failed
> 208caadce5d4 irqchip: ingenic: Get virq number from IRQ domain
> 8bc7464b5140 irqchip: ingenic: Alloc generic chips from IRQ domain
> b8b0145f7d0e irqchip: Ingenic: Add process for more than one irq at 
> the same time.
> 
> Most likely 52ecc87642f2 has changed the call sequence and therefore 
> always fails.
> 
> Is there some essential patch missing to be upstreamed?
> I have looked but not found anything related in linux-next.
> 
> I have also tried reverting 52ecc87642f2 alone but it has conflicts.
> 
> But I can revert all 4 commits with an otherwise unchanged setup and
> the messages are gone for me.
> 
> How would a fix look like?
> 
> BR and thanks,
> Nikolaus
> 



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

* Re: [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0  to VIRQ8 mapping (rc=-19)
  2019-12-20 17:01 ` Paul Cercueil
@ 2019-12-20 17:09   ` Marc Zyngier
  2019-12-20 17:26     ` Paul Cercueil
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2019-12-20 17:09 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: H. Nikolaus Schaller, Discussions about the Letux Kernel,
	Linux Kernel Mailing List, linux-mips,
	MIPS Creator CI20 Development, Zhou Yanjie

On 2019-12-20 17:01, Paul Cercueil wrote:
> Hi Nikolaus,
>
> Try with this: https://lkml.org/lkml/2019/11/22/1831
>
> And don't hesitate to add your Tested-by :)

Is that an actual fix? It wasn't tagged as such, which is why
I didn't send it right away... It'd  be good to find out.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0  to VIRQ8 mapping (rc=-19)
  2019-12-20 17:09   ` Marc Zyngier
@ 2019-12-20 17:26     ` Paul Cercueil
  2019-12-20 17:53       ` H. Nikolaus Schaller
  2019-12-23  8:07       ` Zhou Yanjie
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Cercueil @ 2019-12-20 17:26 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: H. Nikolaus Schaller, Discussions about the Letux Kernel,
	Linux Kernel Mailing List, linux-mips,
	MIPS Creator CI20 Development, Zhou Yanjie

Hi Marc,

I wasn't aware of the bug, that's why there is no tag.
I can send a V2 with a fix tag (and Cc linux-stable) if Nikolaus 
reports it working.

-Paul


Le ven., déc. 20, 2019 at 17:09, Marc Zyngier <maz@kernel.org> a 
écrit :
> On 2019-12-20 17:01, Paul Cercueil wrote:
>> Hi Nikolaus,
>> 
>> Try with this: https://lkml.org/lkml/2019/11/22/1831
>> 
>> And don't hesitate to add your Tested-by :)
> 
> Is that an actual fix? It wasn't tagged as such, which is why
> I didn't send it right away... It'd  be good to find out.
> 
> Thanks,
> 
>         M.
> --
> Jazz is not dead. It just smells funny...



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

* Re: [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0  to VIRQ8 mapping (rc=-19)
  2019-12-20 17:26     ` Paul Cercueil
@ 2019-12-20 17:53       ` H. Nikolaus Schaller
  2019-12-23  8:07       ` Zhou Yanjie
  1 sibling, 0 replies; 6+ messages in thread
From: H. Nikolaus Schaller @ 2019-12-20 17:53 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Marc Zyngier, Discussions about the Letux Kernel,
	Linux Kernel Mailing List, linux-mips,
	MIPS Creator CI20 Development, Zhou Yanjie

Hi Paul,

> Am 20.12.2019 um 18:26 schrieb Paul Cercueil <paul@crapouillou.net>:
> 
> Hi Marc,
> 
> I wasn't aware of the bug, that's why there is no tag.
> I can send a V2 with a fix tag (and Cc linux-stable) if Nikolaus reports it working.

Yes it works! Messages are gone, CI20 still boots, and cat /proc/interrupts shows them counting upwards.

Unfortunately I can't answer to the original [PATCH], but please add my

Tested-by: H. Nikolaus Schaller <hns@goldelico.com>

to v2.

> 
> -Paul
> 
> 
> Le ven., déc. 20, 2019 at 17:09, Marc Zyngier <maz@kernel.org> a écrit :
>> On 2019-12-20 17:01, Paul Cercueil wrote:
>>> Hi Nikolaus,
>>> Try with this: https://lkml.org/lkml/2019/11/22/1831
>>> And don't hesitate to add your Tested-by :)
>> Is that an actual fix? It wasn't tagged as such, which is why
>> I didn't send it right away... It'd  be good to find out.


BR and thanks,
Nikolaus



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

* Re: [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0 to VIRQ8 mapping (rc=-19)
  2019-12-20 17:26     ` Paul Cercueil
  2019-12-20 17:53       ` H. Nikolaus Schaller
@ 2019-12-23  8:07       ` Zhou Yanjie
  1 sibling, 0 replies; 6+ messages in thread
From: Zhou Yanjie @ 2019-12-23  8:07 UTC (permalink / raw)
  To: Paul Cercueil, Marc Zyngier
  Cc: H. Nikolaus Schaller, Discussions about the Letux Kernel,
	Linux Kernel Mailing List, linux-mips,
	MIPS Creator CI20 Development, Zhou Yanjie

Hi, Paul,

On 2019年12月21日 01:26, Paul Cercueil wrote:
> Hi Marc,
>
> I wasn't aware of the bug, that's why there is no tag.
> I can send a V2 with a fix tag (and Cc linux-stable) if Nikolaus 
> reports it working.
>

I also encountered similar problem on X1000. After applying the patch, 
the problem is resolved. You can add:

Tested-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>


Thanks and best regards!

> -Paul
>
>
> Le ven., déc. 20, 2019 at 17:09, Marc Zyngier <maz@kernel.org> a écrit :
>> On 2019-12-20 17:01, Paul Cercueil wrote:
>>> Hi Nikolaus,
>>>
>>> Try with this: https://lkml.org/lkml/2019/11/22/1831
>>>
>>> And don't hesitate to add your Tested-by :)
>>
>> Is that an actual fix? It wasn't tagged as such, which is why
>> I didn't send it right away... It'd  be good to find out.
>>
>> Thanks,
>>
>>         M.
>> -- 
>> Jazz is not dead. It just smells funny...
>


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

end of thread, other threads:[~2019-12-23  8:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-20 16:49 [BUG] CI20: interrupt-controller@10001000 didn't like hwirq-0x0 to VIRQ8 mapping (rc=-19) H. Nikolaus Schaller
2019-12-20 17:01 ` Paul Cercueil
2019-12-20 17:09   ` Marc Zyngier
2019-12-20 17:26     ` Paul Cercueil
2019-12-20 17:53       ` H. Nikolaus Schaller
2019-12-23  8:07       ` Zhou Yanjie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).