Skip to content

Commit

Permalink
Merge tag 'pmdomain-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
Linus Torvalds committed Feb 9, 2024
2 parents 4a8e4b3 + c41336f commit 3760081
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion drivers/pmdomain/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ static int __init genpd_power_off_unused(void)

return 0;
}
late_initcall(genpd_power_off_unused);
late_initcall_sync(genpd_power_off_unused);

#ifdef CONFIG_PM_SLEEP

Expand Down
15 changes: 7 additions & 8 deletions drivers/pmdomain/mediatek/mtk-pm-domains.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
goto err_put_node;
}

/* recursive call to add all subdomains */
ret = scpsys_add_subdomain(scpsys, child);
if (ret)
goto err_put_node;

ret = pm_genpd_add_subdomain(parent_pd, child_pd);
if (ret) {
dev_err(scpsys->dev, "failed to add %s subdomain to parent %s\n",
Expand All @@ -570,11 +575,6 @@ static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
dev_dbg(scpsys->dev, "%s add subdomain: %s\n", parent_pd->name,
child_pd->name);
}

/* recursive call to add all subdomains */
ret = scpsys_add_subdomain(scpsys, child);
if (ret)
goto err_put_node;
}

return 0;
Expand All @@ -588,9 +588,6 @@ static void scpsys_remove_one_domain(struct scpsys_domain *pd)
{
int ret;

if (scpsys_domain_is_on(pd))
scpsys_power_off(&pd->genpd);

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

clk_bulk_put(pd->num_clks, pd->clks);
clk_bulk_put(pd->num_subsys_clks, pd->subsys_clks);
Expand Down
3 changes: 2 additions & 1 deletion drivers/pmdomain/renesas/r8a77980-sysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ static const struct rcar_sysc_area r8a77980_areas[] __initconst = {
PD_CPU_NOCR },
{ "ca53-cpu3", 0x200, 3, R8A77980_PD_CA53_CPU3, R8A77980_PD_CA53_SCU,
PD_CPU_NOCR },
{ "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON },
{ "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON,
PD_CPU_NOCR },
{ "a3ir", 0x180, 0, R8A77980_PD_A3IR, R8A77980_PD_ALWAYS_ON },
{ "a2ir0", 0x400, 0, R8A77980_PD_A2IR0, R8A77980_PD_A3IR },
{ "a2ir1", 0x400, 1, R8A77980_PD_A2IR1, R8A77980_PD_A3IR },
Expand Down

0 comments on commit 3760081

Please sign in to comment.