aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/clock.c
diff options
context:
space:
mode:
authorFrancesco VIRLINZI <francesco.virlinzi@st.com>2009-03-13 08:08:01 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-03-16 20:11:00 +0900
commit50cca715a64b66ccf173767d94d4020ea0a6129c (patch)
tree56f26236a191e98825dca07e69835e42ee019d1d /arch/sh/kernel/cpu/clock.c
parente9edb3fec2260b5a64e9ca9e09160b74f1b106e3 (diff)
downloadkernel_samsung_smdk4412-50cca715a64b66ccf173767d94d4020ea0a6129c.tar.gz
kernel_samsung_smdk4412-50cca715a64b66ccf173767d94d4020ea0a6129c.tar.bz2
kernel_samsung_smdk4412-50cca715a64b66ccf173767d94d4020ea0a6129c.zip
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: Francesco Virlinzi <francesco.virlinzi@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/clock.c')
-rw-r--r--arch/sh/kernel/cpu/clock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 3209a8740fa..1dc896483b5 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -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);
}