On Tue, May 27, 2025 at 10:45:25AM -0300, Hiago De Franco wrote: [...]
> > > > Thanks for the detailed analysis! > > > > This is a very similar issue as many other genpd providers are > > suffering from - and something that I have been working on recently to > > fix. > > > > A few days ago I posted a new version of a series [1], which is based > > upon using the fw_devlink and ->sync_state() support. In principle, we > > need to prevent genpd from power-off a PM domain if it was powered-on > > during boot , until all the consumer-drivers of a PM domain have been > > probed. > > > > I had a look at the DT description of how imx describes power-domain > > providers/consumers, along with the corresponding genpd provider > > implementation in drivers/pmdomain/imx/scu-pd.c. Unless I missed > > something, I think [1] should do the trick for you, without any > > further changes. Can you please give it a try and see if that solves > > this problem? > > Cool! I can give a try and provide an answer soon. Thanks! We are making progress ;-) With the patches you shared Ulf (I added them on top of the current master branch), it works as expected, dev_pm_genpd_is_on() returns 0 when I boot the kernel without M4 running and it returns 1 when I boot the kernel with M4 running with a hello-world demo. However now I tried to, if dev_pm_genpd_is_on() returns 1, put the DETACHED state, something as if (dev_pm_genpd_is_on(priv->pd_list->pd_devs[0])) priv->rproc->state = RPROC_DETACHED; In this case I used 0 because I understand this is the IMX_SC_R_M4_0_PID0 defined in my device tree overlay: power-domains = <&pd IMX_SC_R_M4_0_PID0>, <&pd IMX_SC_R_M4_0_MU_1A>; But in this case, the kernel does not boot anymore, I see the "Starting kernel..." and nothing else. I am using the pm_runtime functions before rproc_add(): @@ -1146,6 +1154,9 @@ static int imx_rproc_probe(struct platform_device *pdev) } } + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + ret = rproc_add(rproc); if (ret) { dev_err(dev, "rproc_add failed\n"); and calling dev_pm_genpd_is_on() after dev_pm_domain_attach_list() has been called. With kernel not starting I cannot even debug it. Do you have any suggestion on why this might be happening? > > > > > [...] > > > > Kind regards > > Uffe > > > > [1] > > https://lore.kernel.org/all/20250523134025.75130-1-ulf.hans...@linaro.org/ > > Best regards, > Hiago Best regards, Hiago