From: sashiko-bot@kernel.org
To: "Patrick Delaunay" <patrick.delaunay@foss.st.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 7/7] arm64: dts: st: add power domains for STM32MP21 family
Date: Thu, 03 Dec 2026 19:54:35 +0000 [thread overview]
Message-ID: <sashiko-outbox-248572@kernel.org> (raw)
In-Reply-To: <20261203181556.v3.7.Ibc243544a13186cabedd574e63a3a1f881f9fcad@changeid>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] arm64: dts: st: unguarded usart2 dependency on d1_pd and PSCI
cluster_pd
- [Medium] pmdomain: st: leak OF node ref in stm32mp_pm_domain_probe()
--
commit 63312350be1210656670a702d73004820c600569
Author: Patrick Delaunay <patrick.delaunay@foss.st.com>
arm64: dts: st: add power domains for STM32MP21 family
This commit adds PSCI CPU, cluster, and retention power domains along with
the CPU idle state and D1 power domain for STM32MP21, and assigns usart2
to the D1 domain.
> diff --git a/arch/arm64/boot/dts/st/stm32mp211.dtsi b/arch/arm64/boot/dts/st/stm32mp211.dtsi
> index 4bfd58b26b51b..4da0ac7771b56 100644
> --- a/arch/arm64/boot/dts/st/stm32mp211.dtsi
> +++ b/arch/arm64/boot/dts/st/stm32mp211.dtsi
[ ... ]
> @@ -70,9 +85,30 @@ scmi_reset: protocol@16 {
> };
> };
>
> + d1_pd: power-controller {
> + compatible = "st,stm32mp-pm-domain";
> + #power-domain-cells = <0>;
> + power-domains = <&cluster_pd>;
> + };
[Severity: Medium]
Does binding d1_pd to st,stm32mp-pm-domain leak a device_node reference on
cluster_pd?
In commit "pmdomain: st: add STM32MP power domain", stm32mp_pm_domain_probe()
acquires a reference on link->domain.np via of_parse_phandle_with_args(),
and neither of_genpd_add_subdomain() nor of_genpd_remove_subdomain() drops
it.
Every error return after that call (including -EPROBE_DEFER from
of_genpd_add_subdomain()) and stm32mp_pm_domain_genpd_remove_subdomain() on
removal leave the reference leaked.
Registering a devm action to call of_node_put(link->domain.np) right after
of_parse_phandle_with_args() would cover both paths.
[ ... ]
> @@ -108,6 +144,7 @@ usart2: serial@400e0000 {
> interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ck_flexgen_08>;
> access-controllers = <&rifsc 32>;
> + power-domains = <&d1_pd>;
> status = "disabled";
> };
> };
[Severity: High]
Can assigning usart2 to d1_pd break the serial console on valid kernel
configurations or older kernels?
d1_pd depends on cluster_pd, whose provider (cpuidle-psci-domain.c) is only
built when CONFIG_ARM_PSCI_CPUIDLE_DOMAIN is enabled, while
CONFIG_STM32MP_PM_DOMAIN defaults to y on ARCH_STM32 and selects
PM_GENERIC_DOMAINS_OF without requiring CPU_IDLE or ARM_PSCI_CPUIDLE.
With CONFIG_PM=y and CONFIG_CPU_IDLE=n or CONFIG_ARM_PSCI_CPUIDLE=n,
platform_probe() -> dev_pm_domain_attach() cannot resolve cluster_pd, so
d1_pd never registers. usart2 (stdout-path in stm32mp215f-dk.dts) then
fails to probe with -ENODEV or -ETIMEDOUT once deferred probing ends.
The same permanent usart2 probe failure happens when
CONFIG_STM32MP_PM_DOMAIN=n with PM_GENERIC_DOMAINS_OF=y, or when booting
this DTB on an older kernel without the st,stm32mp-pm-domain driver.
Setting CONFIG_STM32MP_PM_DOMAIN=m with built-in CONFIG_SERIAL_STM32_CONSOLE=y
also defers console probing until userspace loads the module, or fails
permanently after driver_deferred_probe_timeout.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203171721.1525015-1-patrick.delaunay@foss.st.com?part=7
prev parent reply other threads:[~2026-12-03 19:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 17:15 [PATCH v3 0/7] arm64: dts: st: add STM32MP2 power domains Patrick Delaunay
2026-12-03 17:15 ` [PATCH v3 1/7] dt-bindings: power: st: add STM32MP PM domain Patrick Delaunay
2026-12-03 18:19 ` sashiko-bot
2026-12-03 17:16 ` [PATCH v3 4/7] arm64: dts: st: add D1 domain for STM32MP25 family Patrick Delaunay
2026-12-03 19:08 ` sashiko-bot
2026-12-03 17:16 ` [PATCH v3 5/7] arm64: dts: st: fix power-domain labels DT coding style in STM32MP25 Patrick Delaunay
2026-12-03 17:16 ` [PATCH v3 6/7] arm64: dts: st: add D1 domain for STM32MP23 family Patrick Delaunay
2026-12-03 19:29 ` sashiko-bot
2026-12-03 17:16 ` [PATCH v3 7/7] arm64: dts: st: add power domains for STM32MP21 family Patrick Delaunay
2026-12-03 19:54 ` sashiko-bot [this message]
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=sashiko-outbox-248572@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=patrick.delaunay@foss.st.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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