All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization
@ 2016-11-08 19:35 Geert Uytterhoeven
  2016-11-08 19:42 ` Florian Fainelli
  2016-11-09  9:03 ` Marc Zyngier
  0 siblings, 2 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2016-11-08 19:35 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier
  Cc: Florian Fainelli, Simon Horman, Magnus Damm, linux-renesas-soc,
	linux-kernel, netdev, Geert Uytterhoeven

Currently the renesas-irqc driver uses postcore_initcall().

However, the new CPG/MSSR driver uses subsys_initcall(). Hence the
IRQC's probe will be deferred, which causes the Micrel Ethernet PHY to
not find its interrupt on R-Car Gen2 and RZ/G, as the of_mdio subsystem
does not support deferred probe yet.

Replace postcore_initcall() by device_initcall() to work around this.

Note that on R-Mobile APE6, where the PFC/GPIO combo uses the IRQC as
its parent interrupt controller, this does cause a few additional probe
deferrals (for SCIFA0, SD0, SD1, and MMC). But the affected drivers
handle that fine.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
v2:
  - Drop RFC state,
  - Add Tested-by,
  - Improved description.
---
 drivers/irqchip/irq-renesas-irqc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 52304b139aa46a60..992849e54d00ea77 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -295,7 +295,7 @@ static int __init irqc_init(void)
 {
 	return platform_driver_register(&irqc_device_driver);
 }
-postcore_initcall(irqc_init);
+device_initcall(irqc_init);
 
 static void __exit irqc_exit(void)
 {
-- 
1.9.1

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

* Re: [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization
  2016-11-08 19:35 [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization Geert Uytterhoeven
@ 2016-11-08 19:42 ` Florian Fainelli
  2016-11-08 19:50   ` Geert Uytterhoeven
  2016-11-09  9:03 ` Marc Zyngier
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2016-11-08 19:42 UTC (permalink / raw)
  To: Geert Uytterhoeven, Thomas Gleixner, Jason Cooper, Marc Zyngier
  Cc: Simon Horman, Magnus Damm, linux-renesas-soc, linux-kernel, netdev

On 11/08/2016 11:35 AM, Geert Uytterhoeven wrote:
> Currently the renesas-irqc driver uses postcore_initcall().
> 
> However, the new CPG/MSSR driver uses subsys_initcall(). Hence the
> IRQC's probe will be deferred, which causes the Micrel Ethernet PHY to
> not find its interrupt on R-Car Gen2 and RZ/G, as the of_mdio subsystem
> does not support deferred probe yet.

Is not that the more correct fix to implement though?
-- 
Florian

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

* Re: [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization
  2016-11-08 19:42 ` Florian Fainelli
@ 2016-11-08 19:50   ` Geert Uytterhoeven
  2016-11-09 19:17     ` Florian Fainelli
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2016-11-08 19:50 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Geert Uytterhoeven, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	Simon Horman, Magnus Damm, Linux-Renesas, linux-kernel, netdev

Hi Florian,

On Tue, Nov 8, 2016 at 8:42 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 11/08/2016 11:35 AM, Geert Uytterhoeven wrote:
>> Currently the renesas-irqc driver uses postcore_initcall().
>>
>> However, the new CPG/MSSR driver uses subsys_initcall(). Hence the
>> IRQC's probe will be deferred, which causes the Micrel Ethernet PHY to
>> not find its interrupt on R-Car Gen2 and RZ/G, as the of_mdio subsystem
>> does not support deferred probe yet.
>
> Is not that the more correct fix to implement though?

Sure it is. But nothing has happened since this was reported ca. 1 year ago.
Cfr. "of_mdiobus_register_phy() and deferred probe"
https://lkml.org/lkml/2015/10/22/377

My MDIO foo is not that strong...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization
  2016-11-08 19:35 [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization Geert Uytterhoeven
  2016-11-08 19:42 ` Florian Fainelli
@ 2016-11-09  9:03 ` Marc Zyngier
  1 sibling, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2016-11-09  9:03 UTC (permalink / raw)
  To: Geert Uytterhoeven, Thomas Gleixner, Jason Cooper
  Cc: Florian Fainelli, Simon Horman, Magnus Damm, linux-renesas-soc,
	linux-kernel, netdev

Hi Geert,

On 08/11/16 19:35, Geert Uytterhoeven wrote:
> Currently the renesas-irqc driver uses postcore_initcall().
> 
> However, the new CPG/MSSR driver uses subsys_initcall(). Hence the
> IRQC's probe will be deferred, which causes the Micrel Ethernet PHY to
> not find its interrupt on R-Car Gen2 and RZ/G, as the of_mdio subsystem
> does not support deferred probe yet.
> 
> Replace postcore_initcall() by device_initcall() to work around this.
> 
> Note that on R-Mobile APE6, where the PFC/GPIO combo uses the IRQC as
> its parent interrupt controller, this does cause a few additional probe
> deferrals (for SCIFA0, SD0, SD1, and MMC). But the affected drivers
> handle that fine.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Tested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> ---
> v2:
>   - Drop RFC state,
>   - Add Tested-by,
>   - Improved description.
> ---
>  drivers/irqchip/irq-renesas-irqc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
> index 52304b139aa46a60..992849e54d00ea77 100644
> --- a/drivers/irqchip/irq-renesas-irqc.c
> +++ b/drivers/irqchip/irq-renesas-irqc.c
> @@ -295,7 +295,7 @@ static int __init irqc_init(void)
>  {
>  	return platform_driver_register(&irqc_device_driver);
>  }
> -postcore_initcall(irqc_init);
> +device_initcall(irqc_init);

Overall, I'm not keen on these hacks (by moving from one initcall to
another, you're as likely to fix something than to break something else).

What should really be done is to either teach the various drivers to
handle deferred probing, or to teach the kernel to handle proper
dependencies (vastly more ambitious).

Thanks,

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

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

* Re: [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization
  2016-11-08 19:50   ` Geert Uytterhoeven
@ 2016-11-09 19:17     ` Florian Fainelli
  2016-11-09 19:43       ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2016-11-09 19:17 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Geert Uytterhoeven, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	Simon Horman, Magnus Damm, Linux-Renesas, linux-kernel, netdev

On 11/08/2016 11:50 AM, Geert Uytterhoeven wrote:
> Hi Florian,
> 
> On Tue, Nov 8, 2016 at 8:42 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> On 11/08/2016 11:35 AM, Geert Uytterhoeven wrote:
>>> Currently the renesas-irqc driver uses postcore_initcall().
>>>
>>> However, the new CPG/MSSR driver uses subsys_initcall(). Hence the
>>> IRQC's probe will be deferred, which causes the Micrel Ethernet PHY to
>>> not find its interrupt on R-Car Gen2 and RZ/G, as the of_mdio subsystem
>>> does not support deferred probe yet.
>>
>> Is not that the more correct fix to implement though?
> 
> Sure it is. But nothing has happened since this was reported ca. 1 year ago.
> Cfr. "of_mdiobus_register_phy() and deferred probe"
> https://lkml.org/lkml/2015/10/22/377
> 
> My MDIO foo is not that strong...

Let me try to cook something here which may require
of_mdiobus_register_phy(), are you okay testing patches?
-- 
Florian

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

* Re: [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization
  2016-11-09 19:17     ` Florian Fainelli
@ 2016-11-09 19:43       ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2016-11-09 19:43 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Geert Uytterhoeven, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	Simon Horman, Magnus Damm, Linux-Renesas, linux-kernel, netdev

Hi Florian,

On Wed, Nov 9, 2016 at 8:17 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 11/08/2016 11:50 AM, Geert Uytterhoeven wrote:
>> On Tue, Nov 8, 2016 at 8:42 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>> On 11/08/2016 11:35 AM, Geert Uytterhoeven wrote:
>>>> Currently the renesas-irqc driver uses postcore_initcall().
>>>>
>>>> However, the new CPG/MSSR driver uses subsys_initcall(). Hence the
>>>> IRQC's probe will be deferred, which causes the Micrel Ethernet PHY to
>>>> not find its interrupt on R-Car Gen2 and RZ/G, as the of_mdio subsystem
>>>> does not support deferred probe yet.
>>>
>>> Is not that the more correct fix to implement though?
>>
>> Sure it is. But nothing has happened since this was reported ca. 1 year ago.
>> Cfr. "of_mdiobus_register_phy() and deferred probe"
>> https://lkml.org/lkml/2015/10/22/377
>>
>> My MDIO foo is not that strong...
>
> Let me try to cook something here which may require
> of_mdiobus_register_phy(), are you okay testing patches?

Of course I am. Thanks a lot!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2016-11-09 19:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-08 19:35 [PATCH v2] irqchip/renesas-irqc: Postpone driver initialization Geert Uytterhoeven
2016-11-08 19:42 ` Florian Fainelli
2016-11-08 19:50   ` Geert Uytterhoeven
2016-11-09 19:17     ` Florian Fainelli
2016-11-09 19:43       ` Geert Uytterhoeven
2016-11-09  9:03 ` Marc Zyngier

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.