Re: [PATCH 4.19 070/422] pinctrl: ingenic: Probe driver at subsys_initcall

From: Paul Cercueil
Date: Fri Nov 22 2019 - 13:25:12 EST


Hi Pavel,


Le jeu., nov. 21, 2019 at 11:17, Pavel Machek <pavel@xxxxxxx> a écrit :
On Tue 2019-11-19 06:14:27, Greg Kroah-Hartman wrote:
From: Paul Cercueil <paul@xxxxxxxxxxxxxxx>

[ Upstream commit 556a36a71ed80e17ade49225b58513ea3c9e4558 ]

Using postcore_initcall() makes the driver try to initialize way too
early.

Does it fix concrete bug / would you say it is suitable for -stable?

When using postcore_initcall() it locks up early in the boot process, so it definitely fixes a bug. I think it locks up because standard (non-early) platform drivers can't be probed postcore (but they can be registered and probed later).


+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -847,4 +847,4 @@ static int __init ingenic_pinctrl_drv_register(void)
{
return platform_driver_register(&ingenic_pinctrl_driver);
}
-postcore_initcall(ingenic_pinctrl_drv_register);
+subsys_initcall(ingenic_pinctrl_drv_register);

There are other pinctrl drivers initialized very early, do they need
fixing, too?

The other drivers call platform_driver_register(), not platform_driver_probe(), which means that they will probe at the same time as the other platform drivers.

The reason platform_driver_probe() is used in pinctrl-ingenic is that it allows the probe function and all the code attached to be marked __init.

Cheers,
-Paul