* [PATCH v2] pmdomain: ti-sci: skip unrepresentable power-domain IDs
@ 2026-12-03 3:39 Pengpeng Hou
2026-12-03 16:50 ` Andrew Davis
0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-12-03 3:39 UTC (permalink / raw)
To: Nishanth Menon
Cc: Pengpeng Hou, Tero Kristo, Santosh Shilimkar, Ulf Hansson,
linux-arm-kernel, linux-pm, linux-kernel, Hari Prasath G E,
stable
The domain count is the largest DT ID plus one. U32_MAX cannot be
represented by that scheme: it wraps the count to zero, but the list
still carries the ID for the final table fill.
Skip that reference during collection. Valid domains can still be
registered, and the existing xlate range check rejects a later lookup of
the skipped ID.
Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one")
Cc: stable@vger.kernel.org
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
Changes since v1:
Add Fixes and stable Cc. Skip just the invalid reference rather than fail
probe after other domains have been initialized.
Previous version: https://lore.kernel.org/r/20260722041142.95204-1-pengpeng@iscas.ac.cn
Codex assisted with patch preparation and the changelog.
Current review: Codex (Assisted-by: gpt 5).
Static review only; this revision was not built.
drivers/pmdomain/ti/ti_sci_pm_domains.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c
index 50898dc43310cf998660cd93e3b9f5488cc827d4..ca7444a5259d67eb55b4dce78729cac7d3e60f09 100644
--- a/drivers/pmdomain/ti/ti_sci_pm_domains.c
+++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c
@@ -248,7 +248,8 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
"#power-domain-cells",
index, &args)) {
- if (args.args_count >= 1 && args.np == dev->of_node) {
+ if (args.args_count >= 1 && args.np == dev->of_node &&
+ args.args[0] != U32_MAX) {
bool is_on;
of_node_put(args.np);
base-commit: 693c2e04e3f1d4c59af236e1211b7b8cb165a790
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] pmdomain: ti-sci: skip unrepresentable power-domain IDs
2026-12-03 3:39 [PATCH v2] pmdomain: ti-sci: skip unrepresentable power-domain IDs Pengpeng Hou
@ 2026-12-03 16:50 ` Andrew Davis
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Davis @ 2026-12-03 16:50 UTC (permalink / raw)
To: Pengpeng Hou, Nishanth Menon
Cc: Tero Kristo, Santosh Shilimkar, Ulf Hansson, linux-arm-kernel,
linux-pm, linux-kernel, Hari Prasath G E, stable
On 12/2/26 9:39 PM, Pengpeng Hou wrote:
> The domain count is the largest DT ID plus one. U32_MAX cannot be
> represented by that scheme: it wraps the count to zero, but the list
> still carries the ID for the final table fill.
>
> Skip that reference during collection. Valid domains can still be
> registered, and the existing xlate range check rejects a later lookup of
> the skipped ID.
>
> Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one")
> Cc: stable@vger.kernel.org
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
> Changes since v1:
> Add Fixes and stable Cc. Skip just the invalid reference rather than fail
> probe after other domains have been initialized.
> Previous version: https://lore.kernel.org/r/20260722041142.95204-1-pengpeng@iscas.ac.cn
>
I liked this previous version better, printing a message seems like
the correct thing to do vs silently ignoring. Like kalloc failing this
should never happen so simply erroring out is fine, but if you really want
to skip instead of erroring out, then why not:
> diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c
> index 50898dc43310c..3d688370c6251 100644
> --- a/drivers/pmdomain/ti/ti_sci_pm_domains.c
> +++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c
> @@ -252,6 +252,13 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
> bool is_on;
>
> of_node_put(args.np);
> +
> + if (args.args[0] == U32_MAX) {
> + dev_warn(dev, "power-domain ID is too large, skipping\n");
> + index++;
> + continue;
> + }
> +
> if (args.args[0] > max_id) {
> max_id = args.args[0];
> } else {
Andrew
> Codex assisted with patch preparation and the changelog.
> Current review: Codex (Assisted-by: gpt 5).
> Static review only; this revision was not built.
>
> drivers/pmdomain/ti/ti_sci_pm_domains.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c
> index 50898dc43310cf998660cd93e3b9f5488cc827d4..ca7444a5259d67eb55b4dce78729cac7d3e60f09 100644
> --- a/drivers/pmdomain/ti/ti_sci_pm_domains.c
> +++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c
> @@ -248,7 +248,8 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
> "#power-domain-cells",
> index, &args)) {
>
> - if (args.args_count >= 1 && args.np == dev->of_node) {
> + if (args.args_count >= 1 && args.np == dev->of_node &&
> + args.args[0] != U32_MAX) {
> bool is_on;
>
> of_node_put(args.np);
>
> base-commit: 693c2e04e3f1d4c59af236e1211b7b8cb165a790
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-03 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-03 3:39 [PATCH v2] pmdomain: ti-sci: skip unrepresentable power-domain IDs Pengpeng Hou
2026-12-03 16:50 ` Andrew Davis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®