Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dhruva Gole <d-gole@ti.com>
To: "Kevin Hilman (TI)" <khilman@baylibre.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Rob Herring <robh@kernel.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	<linux-pm@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <arm-scmi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/3] pmdomain: arm_scmi: add support for domain hierarchies
Date: Fri, 13 Mar 2026 17:37:07 +0530	[thread overview]
Message-ID: <20260313120707.jhkyd772wzuwmlhd@lcpd911> (raw)
In-Reply-To: <20260310-topic-lpm-pmdomain-child-ids-v1-3-5361687a18ff@baylibre.com>

On Mar 10, 2026 at 17:19:25 -0700, Kevin Hilman (TI) wrote:
> After primary SCMI pmdomain is created, use new of_genpd helper which
> checks for child domain mappings defined in power-domains-child-ids.
> 
> Also remove any child domain mappings when SCMI domain is removed.
> 
> Signed-off-by: Kevin Hilman (TI) <khilman@baylibre.com>
> ---

Again, since it worked fine on my AM62L,
Tested-by: Dhruva Gole <d-gole@ti.com>

But I had some thoughts further down...

>  drivers/pmdomain/arm/scmi_pm_domain.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pmdomain/arm/scmi_pm_domain.c b/drivers/pmdomain/arm/scmi_pm_domain.c
> index b5e2ffd5ea64..9d8faef44aa9 100644
> --- a/drivers/pmdomain/arm/scmi_pm_domain.c
> +++ b/drivers/pmdomain/arm/scmi_pm_domain.c
> @@ -114,6 +114,14 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
>  
>  	dev_set_drvdata(dev, scmi_pd_data);
>  
> +	/*
> +	 * Parse (optional) power-domains-child-ids property to
> +	 * establish parent-child relationships
> +	 */
> +	ret = of_genpd_add_child_ids(np, scmi_pd_data);
> +	if (ret < 0 && ret != -ENOENT)
> +		pr_err("Failed to parse power-domains-child-ids for %pOF: %d\n", np, ret);

Nit: I think the style of this driver is to use dev_err than pr_err

Also, maybe a dev_warn makes more sense since we're not even returning
the error or doing anything different if we get certain error path.

I am wondering if it makes sense to just abort the whole idea of
creating power-domain child ids if anything goes wrong?

Basically just of_genpd_remove_child_ids if we face a condition where we
have different number of parents/ children or id > num etc...

All are error cases where the system behaviour can go on to become very
unpredictable if we end up making a false/ incomplete parent-child ID
map.

Thoughts?

PS.
If we go on to do a of_genpd_remove_child_ids here incase of failure then it makes sense to
scream a dev_err here.


> +
>  	return 0;
>  err_rm_genpds:
>  	for (i = num_domains - 1; i >= 0; i--)
> @@ -129,9 +137,13 @@ static void scmi_pm_domain_remove(struct scmi_device *sdev)
>  	struct device *dev = &sdev->dev;
>  	struct device_node *np = dev->of_node;
>  
> +	scmi_pd_data = dev_get_drvdata(dev);
> +
> +	/* Remove any parent-child relationships established at probe time */
> +	of_genpd_remove_child_ids(np, scmi_pd_data);
> +
>  	of_genpd_del_provider(np);
>  
> -	scmi_pd_data = dev_get_drvdata(dev);
>  	for (i = 0; i < scmi_pd_data->num_domains; i++) {
>  		if (!scmi_pd_data->domains[i])
>  			continue;
> 
> -- 
> 2.51.0
> 
> 

-- 
Best regards,
Dhruva Gole
Texas Instruments Incorporated


  reply	other threads:[~2026-03-13 12:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11  0:19 [PATCH 0/3] pmdomain: core: add support for domain hierarchies in DT Kevin Hilman (TI)
2026-03-11  0:19 ` [PATCH 1/3] dt-bindings: power: Add power-domains-child-ids property Kevin Hilman (TI)
2026-03-11  1:38   ` Rob Herring (Arm)
2026-03-11 21:34     ` Kevin Hilman
2026-03-24 23:25   ` Rob Herring
2026-03-11  0:19 ` [PATCH 2/3] pmdomain: core: add support for power-domains-child-ids Kevin Hilman (TI)
2026-03-13 11:55   ` Dhruva Gole
2026-03-25 10:22   ` Ulf Hansson
2026-04-10  0:45     ` Kevin Hilman
2026-04-10  8:57       ` Ulf Hansson
2026-04-10 22:25         ` Kevin Hilman
2026-04-14 13:42           ` Ulf Hansson
2026-03-11  0:19 ` [PATCH 3/3] pmdomain: arm_scmi: add support for domain hierarchies Kevin Hilman (TI)
2026-03-13 12:07   ` Dhruva Gole [this message]
2026-04-10  1:01     ` Kevin Hilman

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=20260313120707.jhkyd772wzuwmlhd@lcpd911 \
    --to=d-gole@ti.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=khilman@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=ulf.hansson@linaro.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