mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>, Nishanth Menon <nm@ti.com>
Cc: Tero Kristo <kristo@kernel.org>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Ulf Hansson <ulfh@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Hari Prasath G E <gehariprasath@ti.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH v2] pmdomain: ti-sci: skip unrepresentable power-domain IDs
Date: Thu, 3 Dec 2026 10:50:59 -0600	[thread overview]
Message-ID: <e2578251-9330-4cd9-9424-965be03a0e00@ti.com> (raw)
In-Reply-To: <20261203033900.60325-1-pengpeng@iscas.ac.cn>

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
> 
> 


      reply	other threads:[~2026-12-03 16:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  3:39 Pengpeng Hou
2026-12-03 16:50 ` Andrew Davis [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=e2578251-9330-4cd9-9424-965be03a0e00@ti.com \
    --to=afd@ti.com \
    --cc=gehariprasath@ti.com \
    --cc=kristo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pengpeng@iscas.ac.cn \
    --cc=ssantosh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=ulfh@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

all inboxes | Powered by JetHome®