Commit 50cca715 authored by Francesco VIRLINZI's avatar Francesco VIRLINZI Committed by Paul Mundt

sh: clkfwk: Safer resume from hibernation.

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: default avatarFrancesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent e9edb3fe
...@@ -372,12 +372,14 @@ static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state) ...@@ -372,12 +372,14 @@ static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state)
if (prev_state.event == PM_EVENT_FREEZE) { if (prev_state.event == PM_EVENT_FREEZE) {
list_for_each_entry(clkp, &clock_list, node) list_for_each_entry(clkp, &clock_list, node)
if (likely(clkp->ops)) { if (likely(clkp->ops)) {
unsigned long rate = clkp->rate;
if (likely(clkp->ops->set_parent)) if (likely(clkp->ops->set_parent))
clkp->ops->set_parent(clkp, clkp->ops->set_parent(clkp,
clkp->parent); clkp->parent);
if (likely(clkp->ops->set_rate)) if (likely(clkp->ops->set_rate))
clkp->ops->set_rate(clkp, clkp->ops->set_rate(clkp,
clkp->rate, NO_CHANGE); rate, NO_CHANGE);
else if (likely(clkp->ops->recalc)) else if (likely(clkp->ops->recalc))
clkp->ops->recalc(clkp); clkp->ops->recalc(clkp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment