[PATCH v2] pmdomain: ti-sci: skip unrepresentable power-domain IDs
Andrew Davis
afd at ti.com
Thu Dec 3 08:50:59 PST 2026
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 at vger.kernel.org
> Signed-off-by: Pengpeng Hou <pengpeng at 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
>
>
More information about the linux-arm-kernel
mailing list