From patchwork Fri Mar 13 08:08:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco VIRLINZI X-Patchwork-Id: 11637 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2D88B42030232 for ; Fri, 13 Mar 2009 08:08:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751646AbZCMIIL (ORCPT ); Fri, 13 Mar 2009 04:08:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751703AbZCMIIL (ORCPT ); Fri, 13 Mar 2009 04:08:11 -0400 Received: from eu1sys200aog101.obsmtp.com ([207.126.144.111]:48046 "EHLO eu1sys200aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbZCMIIJ (ORCPT ); Fri, 13 Mar 2009 04:08:09 -0400 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKSboUZDkPSpm6NHPewDhthjVSFkXUX7Bo@postini.com; Fri, 13 Mar 2009 08:08:08 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7680CDAF9 for ; Fri, 13 Mar 2009 08:07:07 +0000 (GMT) Received: from mail1.ctn.st.com (mail1.ctn.st.com [164.130.116.128]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DE1FD4BFBE for ; Fri, 13 Mar 2009 08:08:03 +0000 (GMT) Received: from [10.52.139.41] (mdt-dhcp41.ctn.st.com [10.52.139.41]) by mail1.ctn.st.com (MOS 3.8.7a) with ESMTP id CZW39071 (AUTH virlinzi); Fri, 13 Mar 2009 09:08:03 +0100 (CET) Message-ID: <49BA1461.7070207@st.com> Date: Fri, 13 Mar 2009 09:08:01 +0100 From: Francesco VIRLINZI User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Linux-sh Subject: [PATCH] sh-clkfwk Safer resume from hibenration Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From 444e5623bfb9ceae22b6190dfcc003cb19efcf71 Mon Sep 17 00:00:00 2001 From: Francesco Virlinzi 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 --- 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