After primary SCMI pmdomain is created, use new of_genpd helper to
check subdomain mappings, and create domain hierarchy.
Signed-off-by: Kevin Hilman (TI.com) <khilman@baylibre.com>
---
drivers/pmdomain/arm/scmi_pm_domain.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/pmdomain/arm/scmi_pm_domain.c b/drivers/pmdomain/arm/scmi_pm_domain.c
index 8fe1c0a501c9..a36bb50c7cf6 100644
--- a/drivers/pmdomain/arm/scmi_pm_domain.c
+++ b/drivers/pmdomain/arm/scmi_pm_domain.c
@@ -41,7 +41,7 @@ static int scmi_pd_power_off(struct generic_pm_domain *domain)
static int scmi_pm_domain_probe(struct scmi_device *sdev)
{
- int num_domains, i;
+ int num_domains, i, ret;
struct device *dev = &sdev->dev;
struct device_node *np = dev->of_node;
struct scmi_pm_domain *scmi_pd;
@@ -110,7 +110,14 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
dev_set_drvdata(dev, scmi_pd_data);
- return of_genpd_add_provider_onecell(np, scmi_pd_data);
+ ret = of_genpd_add_provider_onecell(np, scmi_pd_data);
+ if (ret)
+ return ret;
+
+ /* check for (optional) subdomain mapping with power-domain-map */
+ of_genpd_add_subdomain_map(np, scmi_pd_data);
+
+ return ret;
}
static void scmi_pm_domain_remove(struct scmi_device *sdev)
--
2.51.0
On Thu, 20 Nov 2025 at 01:58, Kevin Hilman (TI.com)
<khilman@baylibre.com> wrote:
>
> After primary SCMI pmdomain is created, use new of_genpd helper to
> check subdomain mappings, and create domain hierarchy.
>
> Signed-off-by: Kevin Hilman (TI.com) <khilman@baylibre.com>
> ---
> drivers/pmdomain/arm/scmi_pm_domain.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pmdomain/arm/scmi_pm_domain.c b/drivers/pmdomain/arm/scmi_pm_domain.c
> index 8fe1c0a501c9..a36bb50c7cf6 100644
> --- a/drivers/pmdomain/arm/scmi_pm_domain.c
> +++ b/drivers/pmdomain/arm/scmi_pm_domain.c
> @@ -41,7 +41,7 @@ static int scmi_pd_power_off(struct generic_pm_domain *domain)
>
> static int scmi_pm_domain_probe(struct scmi_device *sdev)
> {
> - int num_domains, i;
> + int num_domains, i, ret;
> struct device *dev = &sdev->dev;
> struct device_node *np = dev->of_node;
> struct scmi_pm_domain *scmi_pd;
> @@ -110,7 +110,14 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
>
> dev_set_drvdata(dev, scmi_pd_data);
>
> - return of_genpd_add_provider_onecell(np, scmi_pd_data);
> + ret = of_genpd_add_provider_onecell(np, scmi_pd_data);
> + if (ret)
> + return ret;
> +
> + /* check for (optional) subdomain mapping with power-domain-map */
> + of_genpd_add_subdomain_map(np, scmi_pd_data);
I think we need to take better care of dealing with errors here.
Typically a negative return value should be treated as an error, while
0 should be fine, right?
> +
> + return ret;
> }
>
> static void scmi_pm_domain_remove(struct scmi_device *sdev)
>
> --
> 2.51.0
>
Moreover, I wonder if we need to update the scmi-DT doc [1] too?
Kind regards
Uffe
[1]
Documentation/devicetree/bindings/firmware/arm,scmi.yaml
On Wed, Nov 19, 2025 at 04:58:46PM -0800, Kevin Hilman (TI.com) wrote: > @@ -110,7 +110,14 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev) > > dev_set_drvdata(dev, scmi_pd_data); > > - return of_genpd_add_provider_onecell(np, scmi_pd_data); > + ret = of_genpd_add_provider_onecell(np, scmi_pd_data); > + if (ret) > + return ret; > + > + /* check for (optional) subdomain mapping with power-domain-map */ > + of_genpd_add_subdomain_map(np, scmi_pd_data); > + > + return ret; return 0, plz. regards, dan carpenter
© 2016 - 2026 Red Hat, Inc.