Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: qcom: gdsc: Fix error path on registration of multiple pm subdomains

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>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
Link: https://lore.kernel.org/r/20260328012619.832770-1-vladimir.zapolskiy@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Vladimir Zapolskiy and committed by
Bjorn Andersson
16ba98da c412c6b1

+11 -1
+11 -1
drivers/clk/qcom/gdsc.c
··· 518 518 519 519 ret = pm_genpd_add_subdomain(genpd, subdomain); 520 520 if (ret) 521 - return ret; 521 + goto remove_added_subdomains; 522 522 } 523 523 524 524 return 0; 525 + 526 + remove_added_subdomains: 527 + for (i--; i >= 0; i--) { 528 + struct device *dev = pd_list->pd_devs[i]; 529 + struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain); 530 + 531 + pm_genpd_remove_subdomain(genpd, subdomain); 532 + } 533 + 534 + return ret; 525 535 } 526 536 527 537 static void gdsc_remove_subdomain_list(struct dev_pm_domain_list *pd_list,