Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp978699pxp; Wed, 16 Mar 2022 23:17:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ3PekE6TgXBauYgbXmC8xpDfJUkidTA4HCfuD+kDzSYefIkWxmTBv+5s/oXJ6favH5d/f X-Received: by 2002:a17:902:f545:b0:151:fa59:95bc with SMTP id h5-20020a170902f54500b00151fa5995bcmr3617786plf.82.1647497822836; Wed, 16 Mar 2022 23:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497822; cv=none; d=google.com; s=arc-20160816; b=x1m3nUR0+0JZC0nwh5GJ5/GHQ5kwCZqBOXG1lNjCKIuIOsb7kct4K+KylaP1GUqnJu +RX60w3BZm5uucd6YHn4YdNZ1+j+dWLB7ogXwIycvQK48Jt4c/ADm+bkDlj12ZiKjokS 0LPYye6sUAG+GHhQ+lq7fSZWZVWvSQNs7phLGeZVvKqGNWrmKtskw5ojz+y0hE3Y3JBP ePYVmroPfkhwNkBlBWAsmnoU5ZxiBvXzU6KqcWHG5ayAerAB95QYtLZfwH4YC7+oHHxi L2Yod2pH3TdnO5HHoYCfLbq8sYZY7r0VDZ87ho1xFmtYE/rwUBYz2InHxrk9l/pcc75Y JpZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=Vt4rwIMBEMUNNjZXA69wEJ4ZNjrwDap9rCGzE59E3As=; b=FWfRV/VbNaqj7TBTy8Qc1+wDFbAg5pvQrLZwinsIcKdYdCtYXuzNfsdjeHDHwTZvyM USYZSvTYeM26z9QBke9ayWuEAuzMy6zDwP2Xp3PJmx+ZLfalvYeWVOldHSn5uDCsIHSA I8ZD4fqsyANSE2cim5c68SSvNZqe/NUBg+yHVv2rDqm1lGdjUM9dVWnuAtcWmm+2mAJq NDRqUuFzhthRPb3TkeL69IPCf2wNztDJl4+lABGL73ZenB8PQRvY6wPu8iPRxhp/Umja 7L9enVO4r/ZGwlVOaOBr4Auhxpzp957QEC3TAuevsoMak8aaUWWG2es8m5d9M6BGR1dt F29g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t9-20020a17090a510900b001bfa79127a1si1475700pjh.9.2022.03.16.23.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2ECE9BF971; Wed, 16 Mar 2022 22:01:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352681AbiCPXx7 (ORCPT + 99 others); Wed, 16 Mar 2022 19:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353063AbiCPXxz (ORCPT ); Wed, 16 Mar 2022 19:53:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 824901AF2F; Wed, 16 Mar 2022 16:52:39 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 479B01476; Wed, 16 Mar 2022 16:52:39 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.19.225]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 662E33F766; Wed, 16 Mar 2022 16:52:36 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org Cc: lukasz.luba@arm.com, dietmar.eggemann@arm.com, Pierre.Gondois@arm.com, ionela.voinescu@arm.com, viresh.kumar@linaro.org, rafael@kernel.org, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, mka@chromium.org, nm@ti.com, sboyd@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, cristian.marussi@arm.com, sudeep.holla@arm.com, matthias.bgg@gmail.com Subject: [[PATCH 5/8] PM: EM: Remove old debugfs files and print all 'flags' Date: Wed, 16 Mar 2022 23:52:08 +0000 Message-Id: <20220316235211.29370-6-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220316235211.29370-1-lukasz.luba@arm.com> References: <20220316235211.29370-1-lukasz.luba@arm.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Energy Model gets more bits used in 'flags'. Avoid adding another debugfs file just to print what is the status of a new flag. Simply remove old debugfs files and add one generic which prints all flags as a hex value. Signed-off-by: Lukasz Luba --- kernel/power/energy_model.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c index babefc72085d..092513575e4e 100644 --- a/kernel/power/energy_model.c +++ b/kernel/power/energy_model.c @@ -54,28 +54,15 @@ static int em_debug_cpus_show(struct seq_file *s, void *unused) } DEFINE_SHOW_ATTRIBUTE(em_debug_cpus); -static int em_debug_units_show(struct seq_file *s, void *unused) +static int em_debug_flags_show(struct seq_file *s, void *unused) { struct em_perf_domain *pd = s->private; - char *units = (pd->flags & EM_PERF_DOMAIN_MILLIWATTS) ? - "milliWatts" : "bogoWatts"; - seq_printf(s, "%s\n", units); + seq_printf(s, "%#lx\n", pd->flags); return 0; } -DEFINE_SHOW_ATTRIBUTE(em_debug_units); - -static int em_debug_skip_inefficiencies_show(struct seq_file *s, void *unused) -{ - struct em_perf_domain *pd = s->private; - int enabled = (pd->flags & EM_PERF_DOMAIN_SKIP_INEFFICIENCIES) ? 1 : 0; - - seq_printf(s, "%d\n", enabled); - - return 0; -} -DEFINE_SHOW_ATTRIBUTE(em_debug_skip_inefficiencies); +DEFINE_SHOW_ATTRIBUTE(em_debug_flags); static void em_debug_create_pd(struct device *dev) { @@ -89,9 +76,8 @@ static void em_debug_create_pd(struct device *dev) debugfs_create_file("cpus", 0444, d, dev->em_pd->cpus, &em_debug_cpus_fops); - debugfs_create_file("units", 0444, d, dev->em_pd, &em_debug_units_fops); - debugfs_create_file("skip-inefficiencies", 0444, d, dev->em_pd, - &em_debug_skip_inefficiencies_fops); + debugfs_create_file("flags", 0444, d, dev->em_pd, + &em_debug_flags_fops); /* Create a sub-directory for each performance state */ for (i = 0; i < dev->em_pd->nr_perf_states; i++) -- 2.17.1