Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Linus Walleij" <linusw@kernel.org>
Cc: conor+dt@kernel.org, Frank.Li@kernel.org,
	dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org,
	robh@kernel.org, vkoul@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 12/18] pmdomain: st: ux500: Control DB8500 EPODs
Date: Sun, 20 Sep 2026 23:04:24 +0000	[thread overview]
Message-ID: <20260920230424.87BFB1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921-ux500-power-domains-v7-1-v3-12-9352be6b86b1@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] pmdomain: ux500: missing RAM retention flags in power domains
- [Medium] pmdomain: ux500: power leak from initializing domains as OFF
--

commit 9e8ecf92bb791471023c621b0664e285a95b3ad6
Author: Linus Walleij <linusw@kernel.org>

pmdomain: st: ux500: Control DB8500 EPODs

This commit moves the DB8500 EPOD state handling into the Ux500 power-domain
driver. It also keeps the old regulator driver mutually exclusive with the
pmdomain driver.

> diff --git a/drivers/pmdomain/st/ste-ux500-pm-domain.c b/drivers/pmdomain/st/ste-ux500-pm-domain.c
> index d90a563cd6f37..b31a36a4acd17 100644
> --- a/drivers/pmdomain/st/ste-ux500-pm-domain.c
> +++ b/drivers/pmdomain/st/ste-ux500-pm-domain.c
[ ... ]
> +static int enable_epod(u16 epod_id, bool ramret)
> +{
> +	int ret;
> +
> +	if (ramret) {
> +		if (!epod_on[epod_id]) {
> +			ret = db8500_prcmu_set_epod(epod_id, EPOD_STATE_RAMRET);

[Severity: High]
Are the RAM retention branches in enable_epod() and disable_epod() dead code?

The dbx500_powerdomain_info struct defines an is_ramret boolean, and these
functions check it to use EPOD_STATE_RAMRET. However, none of the 16 domains
initialized in ux500_pm_domains set .is_ramret = true.

[ ... ]
> -static struct generic_pm_domain ux500_pm_domain_sva_mmdsp = {
> +static struct dbx500_powerdomain_info ux500_pm_domain_sva_mmdsp = {
>  	/* Vape_SVA_MMDSP_pwr */
> -	.name = "SVA_MMDSP",
> -	.power_off = pd_power_off,
> -	.power_on = pd_power_on,
> +	.genpd = {
> +		.name = "SVA_MMDSP",
> +		.power_off = pd_power_off,
> +		.power_on = pd_power_on,
> +	},
> +	.epod_id = EPOD_ID_SVAMMDSP,
>  };

[Severity: High]
Will the omission of .is_ramret = true here cause SRAM data loss or prevent
the domain from entering retention during suspend?

In the old regulator driver, domains such as SVAMMDSP, SIAMMDSP, ESRAM12,
and ESRAM34 explicitly had this flag set. Because the flag is never set in
the new PM domain driver, it defaults to false. This means normal runtime PM
transitions will fully power off the domains (EPOD_STATE_OFF) instead of
retaining their state.

[ ... ]
> @@ -186,11 +304,12 @@ static int ux500_pm_domains_probe(struct platform_device *pdev)
[ ... ]
>  	genpd_data->num_domains = ARRAY_SIZE(ux500_pm_domains);
>  
>  	for (i = 0; i < ARRAY_SIZE(ux500_pm_domains); ++i)
> -		pm_genpd_init(ux500_pm_domains[i], NULL, false);
> +		pm_genpd_init(ux500_pm_domains[i], NULL, true);

[Severity: Medium]
Could initializing these domains as software-OFF (is_off = true) lead to a
power leak if the bootloader leaves them enabled?

When initialized as OFF (true), the genpd framework does not set stay_on
and considers the domain to be already powered off in software. Because of
this, genpd_power_off_unused() sees them as already OFF and skips calling
pd_power_off().

Consequently, any domain left ON by the bootloader without an active kernel
consumer is never powered off, failing to replicate the late init cleanup
behavior of the old regulator driver.

> +
> +	ret = of_genpd_add_provider_onecell(np, genpd_data);
> +	if (ret)
> +		goto remove_genpds;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-ux500-power-domains-v7-1-v3-0-9352be6b86b1@kernel.org?part=12

  reply	other threads:[~2026-09-20 23:04 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 22:48 [PATCH v3 00/18] pmdomain: st: ux500: Implement ux500 power domains Linus Walleij
2026-09-20 22:48 ` [PATCH v3 01/18] dt-bindings: power: Convert Ux500 PM domains to schema Linus Walleij
2026-09-28  5:37   ` Krzysztof Kozlowski
2026-09-20 22:48 ` [PATCH v3 02/18] dt-bindings: arm: ux500: Drop NR_DOMAINS Linus Walleij
2026-09-20 22:48 ` [PATCH v3 03/18] dt-bindings: arm: Add the actual power domains on U8500 Linus Walleij
2026-09-20 22:48 ` [PATCH v3 04/18] dt-bindings: mfd: db8500-prcmu: Deprecate EPOD regulators Linus Walleij
2026-09-20 22:48 ` [PATCH v3 05/18] dt-bindings: display: ste,mcde: Allow power domains Linus Walleij
2026-10-08 17:41   ` Rob Herring
2026-09-20 22:48 ` [PATCH v3 06/18] pmdomain: st: ux500: Implement more " Linus Walleij
2026-09-20 22:48 ` [PATCH v3 07/18] ARM: dts: ux500: Rename power domains node Linus Walleij
2026-09-20 22:48 ` [PATCH v3 08/18] dt-bindings: clock: stericsson,u8500-clks: Allow power domains Linus Walleij
2026-09-20 22:48 ` [PATCH v3 09/18] dt-bindings: timer: arm,twd-timer: " Linus Walleij
2026-09-20 22:48 ` [PATCH v3 10/18] dt-bindings: watchdog: arm,twd-wdt: " Linus Walleij
2026-09-20 22:48 ` [PATCH v3 11/18] ARM: dts: ux500: Add " Linus Walleij
2026-09-20 23:04   ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 12/18] pmdomain: st: ux500: Control DB8500 EPODs Linus Walleij
2026-09-20 23:04   ` sashiko-bot [this message]
2026-09-24 13:44   ` Ulf Hansson
2026-09-20 22:48 ` [PATCH v3 13/18] drm/mcde: Use power domain for display power Linus Walleij
2026-09-20 22:58   ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 14/18] misc: sram: Enable runtime PM Linus Walleij
2026-09-20 23:02   ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 15/18] dmaengine: ste_dma40: Use power domain for LCLA SRAM Linus Walleij
2026-09-20 23:03   ` sashiko-bot
2026-09-21 16:36   ` Frank Li
2026-09-24 13:26   ` Ulf Hansson
2026-09-30 20:15     ` Frank Li
2026-10-06 13:21     ` Vinod Koul
2026-09-20 22:48 ` [PATCH v3 16/18] mfd/regulator: db8500-prcmu: Remove EPOD regulators Linus Walleij
2026-09-20 22:48 ` [PATCH v3 17/18] dt-bindings: display: ste,mcde: Deprecate EPOD supply Linus Walleij
2026-09-20 23:00   ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 18/18] ARM: dts: ux500: Remove DB8500 EPOD regulators Linus Walleij
2026-09-20 23:05   ` sashiko-bot
2026-09-21  7:06     ` Linus Walleij
2026-10-06 10:30 ` [PATCH v3 00/18] pmdomain: st: ux500: Implement ux500 power domains Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260920230424.87BFB1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linusw@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox