From patchwork Sun Dec 9 20:03:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 1854411 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E32643FCF2 for ; Sun, 9 Dec 2012 20:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758951Ab2LIUFV (ORCPT ); Sun, 9 Dec 2012 15:05:21 -0500 Received: from utopia.booyaka.com ([74.50.51.50]:40212 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758934Ab2LIUFL (ORCPT ); Sun, 9 Dec 2012 15:05:11 -0500 Received: (qmail 6899 invoked by uid 1019); 9 Dec 2012 20:05:08 -0000 MBOX-Line: From nobody Sun Dec 9 13:03:30 2012 Subject: [PATCH 10/12] ARM: OMAP2+: powerdomain: skip previous-power-state read if next_pwrst is ON To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Paul Walmsley Date: Sun, 09 Dec 2012 13:03:30 -0700 Message-ID: <20121209200328.3196.96843.stgit@dusk.lan> In-Reply-To: <20121209200108.3196.12452.stgit@dusk.lan> References: <20121209200108.3196.12452.stgit@dusk.lan> User-Agent: StGit/0.16-37-g27ac3 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org If the powerdomain's next-power-state is set to ON, then we can skip the powerdomain previous-power-state read during pwrdm_post_transition(). This is both an optimization (for all OMAPs) and a fix (for OMAP2xxx). It turns out the OMAP2xxx previous power state mechanism is slightly different than the OMAP3+ mechanism. The bitfield can't be cleared, and it's only updated after a powerdomain power state transition. So reading this value before any powerdomain power state transition occurred will always return OFF (the reset value). After this patch, if the power domain was programmed to stay ON before pwrdm_pre_transition() is called, the previous power state code will return ON during pwrdm_post_transition(). Signed-off-by: Paul Walmsley --- arch/arm/mach-omap2/powerdomain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index a4bb0bb..72d6ce0 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -681,7 +681,9 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) int prev, fpwrst; int trace_state = 0; - prev = _pwrdm_read_prev_fpwrst(pwrdm); + prev = (pwrdm->next_fpwrst == PWRDM_FUNC_PWRST_ON) ? + PWRDM_FUNC_PWRST_ON : _pwrdm_read_prev_fpwrst(pwrdm); + if (pwrdm->fpwrst != prev) pwrdm->fpwrst_counter[prev - PWRDM_FPWRST_OFFSET]++;