Skip to content

Commit 3760081

Browse files
committed
Merge tag 'pmdomain-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain fixes from Ulf Hansson: "Core: - Move the unused cleanup to a _sync initcall Providers: - mediatek: Fix race conditions at probe/remove with genpd - renesas: r8a77980-sysc: CR7 must be always on" * tag 'pmdomain-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: pmdomain: mediatek: fix race conditions with genpd pmdomain: renesas: r8a77980-sysc: CR7 must be always on pmdomain: core: Move the unused cleanup to a _sync initcall
2 parents 4a8e4b3 + c41336f commit 3760081

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

drivers/pmdomain/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ static int __init genpd_power_off_unused(void)
11091109

11101110
return 0;
11111111
}
1112-
late_initcall(genpd_power_off_unused);
1112+
late_initcall_sync(genpd_power_off_unused);
11131113

11141114
#ifdef CONFIG_PM_SLEEP
11151115

drivers/pmdomain/mediatek/mtk-pm-domains.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
561561
goto err_put_node;
562562
}
563563

564+
/* recursive call to add all subdomains */
565+
ret = scpsys_add_subdomain(scpsys, child);
566+
if (ret)
567+
goto err_put_node;
568+
564569
ret = pm_genpd_add_subdomain(parent_pd, child_pd);
565570
if (ret) {
566571
dev_err(scpsys->dev, "failed to add %s subdomain to parent %s\n",
@@ -570,11 +575,6 @@ static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
570575
dev_dbg(scpsys->dev, "%s add subdomain: %s\n", parent_pd->name,
571576
child_pd->name);
572577
}
573-
574-
/* recursive call to add all subdomains */
575-
ret = scpsys_add_subdomain(scpsys, child);
576-
if (ret)
577-
goto err_put_node;
578578
}
579579

580580
return 0;
@@ -588,9 +588,6 @@ static void scpsys_remove_one_domain(struct scpsys_domain *pd)
588588
{
589589
int ret;
590590

591-
if (scpsys_domain_is_on(pd))
592-
scpsys_power_off(&pd->genpd);
593-
594591
/*
595592
* We're in the error cleanup already, so we only complain,
596593
* but won't emit another error on top of the original one.
@@ -600,6 +597,8 @@ static void scpsys_remove_one_domain(struct scpsys_domain *pd)
600597
dev_err(pd->scpsys->dev,
601598
"failed to remove domain '%s' : %d - state may be inconsistent\n",
602599
pd->genpd.name, ret);
600+
if (scpsys_domain_is_on(pd))
601+
scpsys_power_off(&pd->genpd);
603602

604603
clk_bulk_put(pd->num_clks, pd->clks);
605604
clk_bulk_put(pd->num_subsys_clks, pd->subsys_clks);

drivers/pmdomain/renesas/r8a77980-sysc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ static const struct rcar_sysc_area r8a77980_areas[] __initconst = {
2525
PD_CPU_NOCR },
2626
{ "ca53-cpu3", 0x200, 3, R8A77980_PD_CA53_CPU3, R8A77980_PD_CA53_SCU,
2727
PD_CPU_NOCR },
28-
{ "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON },
28+
{ "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON,
29+
PD_CPU_NOCR },
2930
{ "a3ir", 0x180, 0, R8A77980_PD_A3IR, R8A77980_PD_ALWAYS_ON },
3031
{ "a2ir0", 0x400, 0, R8A77980_PD_A2IR0, R8A77980_PD_A3IR },
3132
{ "a2ir1", 0x400, 1, R8A77980_PD_A2IR1, R8A77980_PD_A3IR },

0 commit comments

Comments
 (0)