From patchwork Wed Jan 26 00:50:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 507511 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0Q0pKuA001716 for ; Wed, 26 Jan 2011 00:51:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752961Ab1AZAvT (ORCPT ); Tue, 25 Jan 2011 19:51:19 -0500 Received: from na3sys009aog117.obsmtp.com ([74.125.149.242]:54721 "EHLO na3sys009aog117.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733Ab1AZAvT (ORCPT ); Tue, 25 Jan 2011 19:51:19 -0500 Received: from source ([209.85.160.48]) (using TLSv1) by na3sys009aob117.postini.com ([74.125.148.12]) with SMTP ID DSNKTT9wBooG0x0lcuwCZrbEc3s0b+0Nw9dV@postini.com; Tue, 25 Jan 2011 16:51:19 PST Received: by pwj9 with SMTP id 9so226216pwj.7 for ; Tue, 25 Jan 2011 16:51:18 -0800 (PST) Received: by 10.142.229.16 with SMTP id b16mr4783323wfh.106.1296003078294; Tue, 25 Jan 2011 16:51:18 -0800 (PST) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id x18sm19519812wfa.23.2011.01.25.16.51.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 Jan 2011 16:51:17 -0800 (PST) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Tero Kristo Subject: [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state Date: Tue, 25 Jan 2011 16:50:11 -0800 Message-Id: <1296003011-26427-1-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.3.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 26 Jan 2011 00:51:20 +0000 (UTC) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 8cbbead..1916038 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -168,9 +168,10 @@ static void omap3_core_restore_context(void) * once during boot sequence, but this works as we are not using secure * services. */ -static void omap3_save_secure_ram_context(u32 target_mpu_state) +static void omap3_save_secure_ram_context(void) { u32 ret; + int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm); if (omap_type() != OMAP2_DEVICE_TYPE_GP) { /* @@ -181,7 +182,7 @@ static void omap3_save_secure_ram_context(u32 target_mpu_state) pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); ret = _omap_save_secure_sram((u32 *) __pa(omap3_secure_ram_storage)); - pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state); + pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); /* Following is for error tracking, it should not happen */ if (ret) { printk(KERN_ERR "save_secure_sram() returns %08x\n", @@ -1094,7 +1095,7 @@ static int __init omap3_pm_init(void) local_fiq_disable(); omap_dma_global_context_save(); - omap3_save_secure_ram_context(PWRDM_POWER_ON); + omap3_save_secure_ram_context(); omap_dma_global_context_restore(); local_irq_enable();