Skip to contentSkip to conversation

sh-clkfwk Safer resume from hibenration

PATCH Applied Francesco VIRLINZI 3 participants 4 messages Mar 13, 2009 – Mar 16, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh-clkfwk Safer resume from hibenration

From 444e5623bfb9ceae22b6190dfcc003cb19efcf71 Mon Sep 17 00:00:00 2001
From: Francesco Virlinzi <[email protected]>
Date: Fri, 13 Mar 2009 08:39:26 +0100
Subject: [PATCH] sh: clkfwk: Safer resume from hibenration

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

---
 arch/sh/kernel/cpu/clock.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/sh/kernel/cpu/clock.c +2 -1
index 3209a87..e2d2451 100644
@@ -372,12 +372,13 @@ 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);
 					}
Signature · 1 line
1.5.6.6
#1 lore raw
Quoted 22 lines · Francesco VIRLINZI
Quoted 3 lines

From 444e5623bfb9ceae22b6190dfcc003cb19efcf71 Mon Sep 17 00:00:00 2001

From: Francesco Virlinzi <[email protected]>
Date: Fri, 13 Mar 2009 08:39:26 +0100
Subject: [PATCH] sh: clkfwk: Safer resume from hibenration

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

---
 arch/sh/kernel/cpu/clock.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/sh/kernel/cpu/clock.c +0 -0
index 3209a87..e2d2451 100644

arch/sh/kernel/cpu/clock.c static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state) · line 375

Quoted 4 lines
arch/sh/kernel/cpu/clock.c +1 -0
@@ -372,12 +372,13 @@ 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;

please add an empty line

Quoted 13 lines
arch/sh/kernel/cpu/clock.c +1 -1
 					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);
 					}
Signature · 1 line
1.5.6.6

Best Regards,
J.

#2 lore raw

PATCH 1/1 sh-clkfwk Safer resume from hibenration

In reply to Francesco VIRLINZI

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

Regards
Francesco

P.S.: Added empty line

From c4554c101842c0de279d222c1b45c309dfaaa181 Mon Sep 17 00:00:00 2001
From: Francesco Virlinzi <[email protected]>
Date: Mon, 16 Mar 2009 06:12:28 +0100
Subject: [PATCH] sh: clkfwk: Safer resume from hibenration

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

---
 arch/sh/kernel/cpu/clock.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/sh/kernel/cpu/clock.c +3 -1
index 3209a87..1dc8964 100644
@@ -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);
 					}
Signature · 1 line
1.5.6.6
Applied
#3 lore raw
In reply to Francesco VIRLINZI
Quoted 5 lines · Francesco VIRLINZI

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

Applied, thanks.