Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3510325pxb; Mon, 4 Apr 2022 19:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+//CO3b3X1B3GjU17NtHNppa/Tnh2pQFkQoloWKxAtQtM2ZSEoBYOXP0NvGtjH0Ppm8sF X-Received: by 2002:a05:6a00:22cb:b0:4fa:ad77:1510 with SMTP id f11-20020a056a0022cb00b004faad771510mr1376797pfj.80.1649125161619; Mon, 04 Apr 2022 19:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649125161; cv=none; d=google.com; s=arc-20160816; b=WPrvrVdHbUW/DEScETZY+rjPVqbbNXHEfmIgSULd9kiIV2xhQxir3LqkbwW/NdsG2E aQzJnDIOABUU/Nbegyip0yVWdtSiU4FL7roLoAaoezlCNPG0dX2GnDvab3TleL6VROHb zt40BZM9XDXWgEdwEFxU7ZiVwJAvm/2qtxmj0sH1S+006+JN9qRkytZWlvHQVx1d6Uge esRgsJpm1QcS9Deh7Uzp9ub6eZpTlh8cek6MUuyTUZ33QEWAEpwzRxnc8cvRiuGQQJse CcyiXPIz5nFnNBGwuQDsiUOv4SJygRv7oerXDtroEYAd5otAxV73eByeDeCkKRw69LYm Grdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=yoF4frlvuWNGLNSexCTE/zCTnhAyoLc5VhdxemGFKYM=; b=d0jrjg1wOoPWa9Lh68CGfDxzik6Ygrj0Fs+fLYaHUC9J38toPVbswsYnfdCvHT6Fdx fwtQ4DmR3FfpEM8AYMR2uMbzQ+u0BqAyFdXuXqIrdO+dYltZbhxTt2l4QPLYpcBgYfMZ ZPeRuujFskX4Fib19Qq6x0M6KUy0D8C6R/UOGwfgMpEQQ+6AWY7ggSDHpgY1T75oEN3q jwGX4oUJcOYQkmMMw+ah3HcC/ySd3YbZ9OEEfnJo0FfIbkYz5PJXwlbVpdasEbWV0jYu kvoAuRa9ozFG3LvFFTDDxsL8Nig75Lj8/90boPKQ2cEhbI4UmehPyLUDDdrngZohLOzZ 1Lzg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id q10-20020a056a00084a00b004fa8ece959esi12212630pfk.37.2022.04.04.19.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:19:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 01C7F29A54F; Mon, 4 Apr 2022 17:41:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378854AbiDDQEc (ORCPT + 99 others); Mon, 4 Apr 2022 12:04:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378843AbiDDQEW (ORCPT ); Mon, 4 Apr 2022 12:04:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7834D427DD; Mon, 4 Apr 2022 09:02:25 -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 44BFFD6E; Mon, 4 Apr 2022 09:02:25 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.1.196.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DED9D3F73B; Mon, 4 Apr 2022 09:02:24 -0700 (PDT) Date: Mon, 4 Apr 2022 17:02:23 +0100 From: Ionela Voinescu To: Lukasz Luba Cc: linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, Pierre.Gondois@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: Re: [RESEND][PATCH 5/8] PM: EM: Remove old debugfs files and print all 'flags' Message-ID: References: <20220321095729.20655-1-lukasz.luba@arm.com> <20220321095729.20655-6-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220321095729.20655-6-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 Hi Lukasz, IMO the debugfs files were fine as they were: - They offered information on units and inefficiencies without having to dig into the code to see which bit is for which flag. - I believe the artificial EM power values fit under bogoWatts as unit, so that part would still be correct. On the other hand, your new file offers more information: we'd be able to see in debugfs whether we're dealing with an artificial EM, despite needing a bit more looking over the code to understand the output. I don't have a strong opinion and the code looks fine, so: Reviewed-by: Ionela Voinescu On Monday 21 Mar 2022 at 09:57:26 (+0000), Lukasz Luba wrote: > 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 >