From patchwork Wed Aug 15 10:02:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 1325171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id F2EFA3FC81 for ; Wed, 15 Aug 2012 10:06:48 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T1aSD-0006eX-48; Wed, 15 Aug 2012 10:03:57 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T1aRZ-0006Vq-DH for linux-arm-kernel@lists.infradead.org; Wed, 15 Aug 2012 10:03:21 +0000 Received: by wgbds1 with SMTP id ds1so4489724wgb.0 for ; Wed, 15 Aug 2012 03:03:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=s0/nYeAJ1B4v95EqcYXzgLkd4Vcev7Ed25zzeWPv+ZU=; b=C/CMl0yJIP4Qp5NXpZhszHVznevlZQQOXP+QFZ8CdY5V9xCYOWNo68nMCeWu3asJYL EP8c9PhTcxsXSWhsK38T1aAOxhrU/ZaVab1UyN3xVDQYVJjvrb+03HAVQnO4JpoANl3h eKq16t4rl6Hmvw+fZk1uB7QhHAUCMI3spNuq/pRQQNTqtg36rbCBbQzIxOEuicWseYmC S/ykfU0HbVZODF8jfo2dopBQNQ8OMGECsrPB+AwV/oa0Tpb9XyGviglZDQWYbQFWi0XV wEkVzHrt+TOPl0qngXNUuQe0+HKVFPtvVADPMaK5mXCEWbqXQRh4u9KvFRtbUS/ydApr 6FzA== Received: by 10.180.76.36 with SMTP id h4mr35816401wiw.13.1345024996341; Wed, 15 Aug 2012 03:03:16 -0700 (PDT) Received: from localhost.localdomain (49.68-66-87.adsl-dyn.isp.belgacom.be. [87.66.68.49]) by mx.google.com with ESMTPS id q4sm27679093wix.9.2012.08.15.03.03.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Aug 2012 03:03:15 -0700 (PDT) From: Jean Pihet To: linux-omap@vger.kernel.org, paul@pwsan.com, linux-arm-kernel@lists.infradead.org, khilman@ti.com, Rajendra Nayak , Santosh Shilimkar , Nishanth Menon Subject: [PATCH 6/8] ARM: OMAP2+: PM debug: trace the functional power domains states Date: Wed, 15 Aug 2012 12:02:46 +0200 Message-Id: <1345024968-28951-7-git-send-email-j-pihet@ti.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1345024968-28951-1-git-send-email-j-pihet@ti.com> References: <1345024968-28951-1-git-send-email-j-pihet@ti.com> X-Gm-Message-State: ALoCoQnJ3D15fwhTtD9eKl1quvGM9T7CR8o8nDA7mDnUNoX/Y5uitUmfF4keBqLA86qVyRfWR+yn X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.41 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jean Pihet X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Trace the power domain transitions using the functional power states, which include the power and logic states. While at it, fix the trace in the case a power domain did not hit the desired state, as reported by Paul Walmsley. Reported-by: Paul Walmsley Signed-off-by: Jean Pihet --- arch/arm/mach-omap2/powerdomain.c | 15 +++++---------- 1 files changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 6b8580b..06a566b 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -144,7 +144,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm) static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) { - int prev, state, trace_state = 0; + int prev, next, state, trace_state; if (pwrdm == NULL) return -EINVAL; @@ -165,10 +165,10 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) * If the power domain did not hit the desired state, * generate a trace event with both the desired and hit states */ - if (state != prev) { + next = pwrdm_read_next_fpwrst(pwrdm); + if (next != prev) { trace_state = (PWRDM_TRACE_STATES_FLAG | - ((state & OMAP_POWERSTATE_MASK) << 8) | - ((prev & OMAP_POWERSTATE_MASK) << 0)); + (next << 8) | (prev << 0)); trace_power_domain_target(pwrdm->name, trace_state, smp_processor_id()); } @@ -781,13 +781,8 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) pr_debug("powerdomain: setting next powerstate for %s to %0x\n", pwrdm->name, pwrst); - if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) { - /* Trace the pwrdm desired target state */ - trace_power_domain_target(pwrdm->name, pwrst, - smp_processor_id()); - /* Program the pwrdm desired target state */ + if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); - } return ret; }