From patchwork Mon Mar 16 05:14:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco VIRLINZI X-Patchwork-Id: 12296 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 n2G5EPb0001111 for ; Mon, 16 Mar 2009 05:14:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751112AbZCPFO0 (ORCPT ); Mon, 16 Mar 2009 01:14:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751419AbZCPFOZ (ORCPT ); Mon, 16 Mar 2009 01:14:25 -0400 Received: from eu1sys200aog101.obsmtp.com ([207.126.144.111]:56334 "EHLO eu1sys200aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112AbZCPFOZ (ORCPT ); Mon, 16 Mar 2009 01:14:25 -0400 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKSb3gLZxWbNtRZyFD2rGKXAc3yzUCEqln@postini.com; Mon, 16 Mar 2009 05:14:23 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 1E4ACDA4E for ; Mon, 16 Mar 2009 05:13:23 +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 EE8734BD8F for ; Mon, 16 Mar 2009 05:14:20 +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 CZX14191 (AUTH virlinzi); Mon, 16 Mar 2009 06:14:20 +0100 (CET) Message-ID: <49BDE026.7020203@st.com> Date: Mon, 16 Mar 2009 06:14:14 +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 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 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 --- 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