lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250528173813.rxqu6pzqgu4m5joo@hiago-nb>
Date: Wed, 28 May 2025 14:38:13 -0300
From: Hiago De Franco <hiagofranco@...il.com>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Peng Fan <peng.fan@....nxp.com>,
	Mathieu Poirier <mathieu.poirier@...aro.org>,
	linux-pm@...r.kernel.org, linux-remoteproc@...r.kernel.org,
	Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Bjorn Andersson <andersson@...nel.org>,
	Hiago De Franco <hiago.franco@...adex.com>, imx@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	daniel.baluta@....com, iuliana.prodan@....nxp.com,
	Fabio Estevam <festevam@...il.com>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Peng Fan <peng.fan@....com>
Subject: Re: [PATCH v2 3/3] remoteproc: imx_rproc: add power mode check for
 remote core attachment

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.hansson@linaro.org/
> 
> Best regards,
> Hiago
 
Best regards,
Hiago

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ