From patchwork Wed May 30 09:45:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 10438047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8EE96602BD for ; Wed, 30 May 2018 09:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A66B2888B for ; Wed, 30 May 2018 09:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69D43288ED; Wed, 30 May 2018 09:45:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E11702888B for ; Wed, 30 May 2018 09:45:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965196AbeE3Jpm (ORCPT ); Wed, 30 May 2018 05:45:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50044 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965213AbeE3Jpl (ORCPT ); Wed, 30 May 2018 05:45:41 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4195D6060A; Wed, 30 May 2018 09:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527673541; bh=cLahtTXRWz/WUDhEaKuIJRVlyIgrK3HIOD3o9AVThTs=; h=From:To:Cc:Subject:Date:From; b=P2S5cW/jUUu49VG7e16apQenv37hxl+6r2GDEafOEKtoMFM2XmboXoW9TIpzg76km 4n7Q4PdGcczmWjURELibhX3b2TAbIoI1Tl7M5SllraJwpV3vTC2U+XNP1YewxxUvs0 RmuVMAzD/NRFNUKtHI3sp0lMEm/dZFUOd6kJhDss= Received: from blr-ubuntu-173.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1517460128; Wed, 30 May 2018 09:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527673540; bh=cLahtTXRWz/WUDhEaKuIJRVlyIgrK3HIOD3o9AVThTs=; h=From:To:Cc:Subject:Date:From; b=NVpaJDA7AvuxpdRK/IVp5tLsvP2ZB98B0CApzM/tLQUXuuDUqqua5DBaYWctXcaMT fWwt47P+KaSvXr9GC6UXUj2EYcpCnok84cnpQaCzs3E3JnkPtdBbcI3aehwJZkuSpw 959SdetGsi1vt4eIMEwnrsgLW0x18fp+gYA08eVM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1517460128 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org From: Rajendra Nayak To: viresh.kumar@linaro.org, ulf.hansson@linaro.org Cc: linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, collinsd@codeaurora.org, Rajendra Nayak Subject: [PATCH] PM / Domains: Add perf_state attribute to genpd debugfs Date: Wed, 30 May 2018 15:15:17 +0530 Message-Id: <20180530094517.24765-1-rnayak@codeaurora.org> X-Mailer: git-send-email 2.17.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that genpd supports performance states, add this additional attribute as part of the power domains debugfs entry, to display the current performance state for the Power domain. Suggested-by: David Collins Signed-off-by: Rajendra Nayak Acked-by: Viresh Kumar Acked-by: Ulf Hansson --- drivers/base/power/domain.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index ffeb6ea8d6eb..a02d793c8275 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2802,6 +2802,19 @@ static int genpd_devices_show(struct seq_file *s, void *data) return ret; } +static int genpd_perf_state_show(struct seq_file *s, void *data) +{ + struct generic_pm_domain *genpd = s->private; + + if (genpd_lock_interruptible(genpd)) + return -ERESTARTSYS; + + seq_printf(s, "%u\n", genpd->performance_state); + + genpd_unlock(genpd); + return 0; +} + #define define_genpd_open_function(name) \ static int genpd_##name##_open(struct inode *inode, struct file *file) \ { \ @@ -2815,6 +2828,7 @@ define_genpd_open_function(idle_states); define_genpd_open_function(active_time); define_genpd_open_function(total_idle_time); define_genpd_open_function(devices); +define_genpd_open_function(perf_state); #define define_genpd_debugfs_fops(name) \ static const struct file_operations genpd_##name##_fops = { \ @@ -2831,6 +2845,7 @@ define_genpd_debugfs_fops(idle_states); define_genpd_debugfs_fops(active_time); define_genpd_debugfs_fops(total_idle_time); define_genpd_debugfs_fops(devices); +define_genpd_debugfs_fops(perf_state); static int __init genpd_debug_init(void) { @@ -2864,6 +2879,9 @@ static int __init genpd_debug_init(void) d, genpd, &genpd_total_idle_time_fops); debugfs_create_file("devices", 0444, d, genpd, &genpd_devices_fops); + if (genpd->set_performance_state) + debugfs_create_file("perf_state", 0444, + d, genpd, &genpd_perf_state_fops); } return 0;