[PATCH] pmdomain: arm: scmi: Check pm_genpd_init() in probe
Sudeep Holla
sudeep.holla at kernel.org
Mon Jul 6 02:34:23 PDT 2026
On Sun, Jul 05, 2026 at 06:32:56PM +0800, Guangshuo Li wrote:
> scmi_pm_domain_probe() stores each domain in the onecell domains array
> after calling pm_genpd_init(), but it ignores the return value from
> pm_genpd_init().
>
> If pm_genpd_init() fails, the genpd has not been added to the global
> genpd list. The probe code nevertheless stores the genpd pointer in the
> domains array. A later provider registration failure then unwinds the
> array with pm_genpd_remove(), which can try to remove a genpd that was
> never registered.
>
> Check the return value from pm_genpd_init() and only store successfully
> initialized domains in the onecell array. On failure, unwind the domains
> that were already initialized.
>
It was done that way intentionally IIRC. We don't want to remove all the
power domains if some not so important power domains fail to initialise.
You can log the error if that helps but removing all the domains that
have initialised seems bit of extreme.
Are you facing any issues on a real platform or is this just by code
inspection.
--
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list