From: Bryan O'Donoghue <bod@kernel.org>
To: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Bjorn Andersson <andersson@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: qcom: gdsc: Fix error path on registration of multiple pm subdomains
Date: Sat, 28 Mar 2026 11:34:06 +0000 [thread overview]
Message-ID: <1c7946f6-4160-4427-9fb6-4d270f7e8fa8@kernel.org> (raw)
In-Reply-To: <20260328012619.832770-1-vladimir.zapolskiy@linaro.org>
On 28/03/2026 01:26, Vladimir Zapolskiy wrote:
> Some pm subdomains may be left in added to a parent domain state, if
> gdsc_add_subdomain_list() function fails in the middle and bails from
> a GDSC power domain controller registration out.
>
> Fixes: b489235b4dc0 ("clk: qcom: Support attaching GDSCs to multiple parents")
> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
> ---
> drivers/clk/qcom/gdsc.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
> index 7deabf8400cf..95aa07120245 100644
> --- a/drivers/clk/qcom/gdsc.c
> +++ b/drivers/clk/qcom/gdsc.c
> @@ -518,10 +518,20 @@ static int gdsc_add_subdomain_list(struct dev_pm_domain_list *pd_list,
>
> ret = pm_genpd_add_subdomain(genpd, subdomain);
> if (ret)
> - return ret;
> + goto remove_added_subdomains;
> }
>
> return 0;
> +
> +remove_added_subdomains:
> + for (i--; i >= 0; i--) {
> + struct device *dev = pd_list->pd_devs[i];
> + struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
> +
> + pm_genpd_remove_subdomain(genpd, subdomain);
> + }
> +
> + return ret;
> }
>
> static void gdsc_remove_subdomain_list(struct dev_pm_domain_list *pd_list,
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
next prev parent reply other threads:[~2026-03-28 11:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-28 1:26 [PATCH] clk: qcom: gdsc: Fix error path on registration of multiple pm subdomains Vladimir Zapolskiy
2026-03-28 11:34 ` Bryan O'Donoghue [this message]
2026-03-29 10:53 ` Dmitry Baryshkov
2026-03-30 16:01 ` Bjorn Andersson
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=1c7946f6-4160-4427-9fb6-4d270f7e8fa8@kernel.org \
--to=bod@kernel.org \
--cc=andersson@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=vladimir.zapolskiy@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