From patchwork Thu Feb 4 16:47:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 77084 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o14GmOkH024301 for ; Thu, 4 Feb 2010 16:48:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758483Ab0BDQsB (ORCPT ); Thu, 4 Feb 2010 11:48:01 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:36611 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758471Ab0BDQr5 (ORCPT ); Thu, 4 Feb 2010 11:47:57 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o14Glrui016487 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Feb 2010 10:47:55 -0600 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o14Glq7W006036; Thu, 4 Feb 2010 22:17:52 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id o14GlquO007676; Thu, 4 Feb 2010 22:17:52 +0530 Received: (from a0393109@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id o14GlqV4007674; Thu, 4 Feb 2010 22:17:52 +0530 From: Thara Gopinath To: linux-omap@vger.kernel.org Cc: Thara Gopinath , Paul Walmsley Subject: [PATCH 3/3] OMAP3 PM: Adding counters for power domain logic off and mem off during retention. Date: Thu, 4 Feb 2010 22:17:51 +0530 Message-Id: <1265302071-7624-4-git-send-email-thara@ti.com> X-Mailer: git-send-email 1.5.5 In-Reply-To: <1265302071-7624-3-git-send-email-thara@ti.com> References: <1265302071-7624-1-git-send-email-thara@ti.com> <1265302071-7624-2-git-send-email-thara@ti.com> <1265302071-7624-3-git-send-email-thara@ti.com> 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.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Feb 2010 16:48:24 +0000 (UTC) diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 0ce356f..c18f7f2 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -385,6 +385,11 @@ static int pwrdm_dbg_show_counter(struct powerdomain *pwrdm, void *user) seq_printf(s, ",%s:%d", pwrdm_state_names[i], pwrdm->state_counter[i]); + seq_printf(s, ",RET-LOGIC-OFF:%d", pwrdm->ret_logic_off_counter); + for (i = 0; i < pwrdm->banks; i++) + seq_printf(s, ",RET-MEMBANK%d-OFF:%d", i + 1, + pwrdm->ret_mem_off_counter[i]); + seq_printf(s, "\n"); return 0; diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index e9eeaa4..34f1f6c 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -125,6 +125,10 @@ static int _pwrdm_register(struct powerdomain *pwrdm) for (i = 0; i < PWRDM_MAX_PWRSTS; i++) pwrdm->state_counter[i] = 0; + pwrdm->ret_logic_off_counter = 0; + for (i = 0; i < pwrdm->banks; i++) + pwrdm->ret_mem_off_counter[i] = 0; + pwrdm_wait_transition(pwrdm); pwrdm->state = pwrdm_read_pwrst(pwrdm); pwrdm->state_counter[pwrdm->state] = 1; @@ -153,6 +157,22 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) prev = pwrdm_read_prev_pwrst(pwrdm); if (pwrdm->state != prev) pwrdm->state_counter[prev]++; + if (prev == PWRDM_POWER_RET) { + int i; + + if ((pwrdm->pwrsts_logic_ret == PWRSTS_OFF_RET) && + (pwrdm_read_prev_logic_pwrst(pwrdm) == + PWRDM_POWER_OFF)) + pwrdm->ret_logic_off_counter++; + + for (i = 0; i < pwrdm->banks; i++) { + if ((pwrdm->pwrsts_mem_ret[i] == + PWRSTS_OFF_RET) && + (pwrdm_read_prev_mem_pwrst( + pwrdm, i) == PWRDM_POWER_OFF)) + pwrdm->ret_mem_off_counter[i]++; + } + } break; default: return -EINVAL; diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h index 9b97c90..de33455 100644 --- a/arch/arm/plat-omap/include/plat/powerdomain.h +++ b/arch/arm/plat-omap/include/plat/powerdomain.h @@ -100,6 +100,8 @@ struct powerdomain { struct list_head node; int state; unsigned state_counter[PWRDM_MAX_PWRSTS]; + unsigned ret_logic_off_counter; + unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS]; #ifdef CONFIG_PM_DEBUG s64 timer;