public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh-clkfwk  Safer resume from hibenration
@ 2009-03-13  8:08 Francesco VIRLINZI
  2009-03-13 16:33 ` Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Francesco VIRLINZI @ 2009-03-13  8:08 UTC (permalink / raw)
  To: linux-sh

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-sh-clkfwk-Safer-resume-from-hibenration.patch --]
[-- Type: text/x-patch, Size: 1312 bytes --]

From 444e5623bfb9ceae22b6190dfcc003cb19efcf71 Mon Sep 17 00:00:00 2001
From: Francesco Virlinzi <francesco.virlinzi@st.com>
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

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
---
 arch/sh/kernel/cpu/clock.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 3209a87..e2d2451 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -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);
 					}
-- 
1.5.6.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sh-clkfwk  Safer resume from hibenration
  2009-03-13  8:08 [PATCH] sh-clkfwk Safer resume from hibenration Francesco VIRLINZI
@ 2009-03-13 16:33 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-03-16  5:14 ` Francesco VIRLINZI
  2009-03-16 11:11 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-03-13 16:33 UTC (permalink / raw)
  To: linux-sh

On 09:08 Fri 13 Mar     , Francesco VIRLINZI wrote:
>

> >From 444e5623bfb9ceae22b6190dfcc003cb19efcf71 Mon Sep 17 00:00:00 2001
> From: Francesco Virlinzi <francesco.virlinzi@st.com>
> 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
> 
> Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
> ---
>  arch/sh/kernel/cpu/clock.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
> index 3209a87..e2d2451 100644
> --- a/arch/sh/kernel/cpu/clock.c
> +++ b/arch/sh/kernel/cpu/clock.c
> @@ -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
>  					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);
>  					}
> -- 
> 1.5.6.6
> 
Best Regards,
J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] sh-clkfwk  Safer resume from hibenration
  2009-03-13  8:08 [PATCH] sh-clkfwk Safer resume from hibenration Francesco VIRLINZI
  2009-03-13 16:33 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-03-16  5:14 ` Francesco VIRLINZI
  2009-03-16 11:11 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Francesco VIRLINZI @ 2009-03-16  5:14 UTC (permalink / raw)
  To: linux-sh

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

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


[-- Attachment #2: 0001-sh-clkfwk-Safer-resume-from-hibenration.patch --]
[-- Type: text/x-patch, Size: 1315 bytes --]

From c4554c101842c0de279d222c1b45c309dfaaa181 Mon Sep 17 00:00:00 2001
From: Francesco Virlinzi <francesco.virlinzi@st.com>
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

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
---
 arch/sh/kernel/cpu/clock.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 3209a87..1dc8964 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);
 					}
-- 
1.5.6.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sh-clkfwk  Safer resume from hibenration
  2009-03-13  8:08 [PATCH] sh-clkfwk Safer resume from hibenration Francesco VIRLINZI
  2009-03-13 16:33 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-03-16  5:14 ` Francesco VIRLINZI
@ 2009-03-16 11:11 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2009-03-16 11:11 UTC (permalink / raw)
  To: linux-sh

On Mon, Mar 16, 2009 at 06:14:14AM +0100, Francesco VIRLINZI wrote:
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-16 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-13  8:08 [PATCH] sh-clkfwk Safer resume from hibenration Francesco VIRLINZI
2009-03-13 16:33 ` Jean-Christophe PLAGNIOL-VILLARD
2009-03-16  5:14 ` Francesco VIRLINZI
2009-03-16 11:11 ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox