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: 1325111 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 825BEDFFED for ; Wed, 15 Aug 2012 10:03:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753913Ab2HOKDT (ORCPT ); Wed, 15 Aug 2012 06:03:19 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:37506 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753799Ab2HOKDR (ORCPT ); Wed, 15 Aug 2012 06:03:17 -0400 Received: by mail-we0-f174.google.com with SMTP id x8so884296wey.19 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=LH31tWDbVP1t560KPJUSIaiuvP32S+NTubuZyArB0Vt7l4gfOWpGkYewfeIDaq2nRI /UBU1bge+Wd0NEizcaaGkmO89lQMz7INR/TDixLUVtsHapN/8tbuutEDVU5onF2r3syM cMoVIp+9winNGmvkGd079apUDPr/lboCWrM3yGowgir5OKDAck6x+Jf/HkTgeCt1M9nE U1bZGtda19Riw7s349udBoJ4ZbUCFsj/pp4FhLx4xA/9071wSg3S88UHnRnWVA7WqBs+ Nd7DU+JqWrtUDe3kRIO7u/adJXf4Q2cxoAP9/0BOLkBh5Tozbh5spw8OvsHNcgqC99C8 SCHQ== 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 Cc: Jean Pihet 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: ALoCoQlImZL8HUi/1fZd/5Z+V/spAcvk3Y2RLVLYPzd5QhQUgLP5sCSuOJNFVWdE1Nm9vm2k9nwk Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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; }