Skip to content

Commit

Permalink
sh: clkfwk: Safer resume from hibernation.
Browse files Browse the repository at this point in the history
This patch fixes a possible problem in the resume from
hibenration. It temporaneally saves the clk->rate on the
stack to avoid any possible change during the clk->set_parent(..)
call.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Francesco VIRLINZI authored and Paul Mundt committed Mar 16, 2009
1 parent e9edb3f commit 50cca71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/sh/kernel/cpu/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,14 @@ static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state)
if (prev_state.event == PM_EVENT_FREEZE) {
list_for_each_entry(clkp, &clock_list, node)
if (likely(clkp->ops)) {
unsigned long rate = clkp->rate;

if (likely(clkp->ops->set_parent))
clkp->ops->set_parent(clkp,
clkp->parent);
if (likely(clkp->ops->set_rate))
clkp->ops->set_rate(clkp,
clkp->rate, NO_CHANGE);
rate, NO_CHANGE);
else if (likely(clkp->ops->recalc))
clkp->ops->recalc(clkp);
}
Expand Down

0 comments on commit 50cca71

Please sign in to comment.