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: <20250114180649.alehyqs657p2vyzl@bogus>
Date: Tue, 14 Jan 2025 18:16:29 +0000
From: Sudeep Holla <sudeep.holla@....com>
To: Ranjani Vaidyanathan <ranjani.vaidyanathan@....com>
Cc: Peng Fan <peng.fan@....com>, "Peng Fan (OSS)" <peng.fan@....nxp.com>,
	Sudeep Holla <sudeep.holla@....com>,
	"cristian.marussi@....com" <cristian.marussi@....com>,
	"ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
	"arm-scmi@...r.kernel.org" <arm-scmi@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [EXT] Re: [PATCH] pmdomain: arm: scmi_pm_domain: Initialize
 state as off

On Tue, Jan 14, 2025 at 04:09:13PM +0000, Ranjani Vaidyanathan wrote:
> Hello Sudeep,
>
> Comments below.
>
> Regards,
> Ranjani Vaidyanathan
>
> -----Original Message-----
> From: Sudeep Holla [mailto:sudeep.holla@....com]
> Sent: Tuesday, January 14, 2025 9:24 AM
> To: Ranjani Vaidyanathan <ranjani.vaidyanathan@....com>
> Cc: Peng Fan <peng.fan@....com>; Peng Fan (OSS) <peng.fan@....nxp.com>; cristian.marussi@....com; Sudeep Holla <sudeep.holla@....com>; ulf.hansson@...aro.org; arm-scmi@...r.kernel.org; linux-arm-kernel@...ts.infradead.org; linux-pm@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: Re: [EXT] Re: [PATCH] pmdomain: arm: scmi_pm_domain: Initialize state as off
>
> Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
>
>
> Hi Ranjani,
>
> On Mon, Jan 13, 2025 at 07:54:06PM +0000, Ranjani Vaidyanathan wrote:
> > Hello Sudeep,
> >
> > Will try to explain the situation we are facing.
> > 1. We have multiple agents running, Agent-A is booted up first before
> > Linux is booted and powers up a shared power domain PD-X.
> > 2. Linux boots and gets the power state of PD-X. And its already ON.
> > And then PD -X is initialized with a default ON state.
> > 3. When the driver that needs PD-X  is probed, Linux sees that the
> > power domain status is ON and never makes an SCMI call to power up the
> > PD-X for Linux Agent.
> > 4. Agent-A now is shutdown/suspends. Linux will crash because the
> > platform disables PD-X because it has no other requests for PD-X.
> >
>
> Thanks for the detailed explanation. I understand the issue now.
>
> I would like to discuss if the below alternative approach works for you.
> We can debate the pros and cons. I see with the approach in this patch
> proposed by Peng we would avoid querying and setting genpd all together
> during the genpd initialisation which is good. But if there are any genpd
> left on by the platform or bootloader(same agent), it will not get turned
> off when Linux tries to turn off the unused genpds(IIRC this could be the
> reason for the current state of code). While your platform may find sending
> those commands unnecessary, there was some usecase where SCMI platform kept
> all resources ON by default for faster boot and expects OSPM to turn off
> unused resources. So we need to support both the cases. I hope my below
> patch should suffice.
>
> [RV] Linux can still make the call to disable unused power domains, even if
> it never explicitly made a request to power it on. The platform will
> aggregate the request from all agents and will power off the resource if no
> other agent has enabled it. From Linux point of view it has disabled all
> unused power domains.

I need to dig into genpd to see if that is possible. IIUC, genpd tracks the
state and will call off only if it is turned on and is unused. If we
initialise to default off state, it may not issue the OFF call to the
firmware irrespective of the actual state(i.e. even if it left ON).

> Your patch below may also work, but feels like a workaround to artificially
> (for lack of a better word) enable a resource.

I tend to agree this might feel like workaround but I need to look and
refresh my genpd knowledge. Or we can check with Ulf.

> And also makes unnecessary SCMI calls (expensive) for every resource
> immaterial of it power state (maybe can be improved by a conditional check).

Yes we can make explicit call only for ON state.

--
Regards,
Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ