From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAD16ECE58D for ; Fri, 11 Oct 2019 18:29:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBE9420673 for ; Fri, 11 Oct 2019 18:29:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KtWyURSM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="h/cAEAJI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBE9420673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6J6oyyv/ErdHKJWzgCODBSy2Zi73SBY5JURziHsZMq0=; b=KtWyURSMwI56Y4 lyLOgVmTzQlSbvF0x6lIGBtEEX6qgQV7pp8/a2XL2cj3wG1fmC19kYNn40Oq/gVHM8qhbR2iBWhSw 5O/Z6u4H7W8pYDinWaM3ojbDB2nKE7aI5Oh4wbhck+c6z492lEWzw/oe1syLb9WNKOJrIdAtKWmHo sScaGol8gVKYaYHyyz4mnkyIP/h8pyA2BG/6gWvK/iPvtlcZwCKkkSH8MJk+g90eSQ2aNvvoPH+oU Ff8/Oj7dWzRRP75nyAvD9E624VTeN3orhqQxut2g1XFG901hK1CZ4AXiHDO1SpRKNTKnnPliuOWjp N2fJNX1DJ4oCSSu39BYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIzf7-000381-Vx; Fri, 11 Oct 2019 18:29:13 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIzf5-00037H-9D for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 18:29:12 +0000 Received: by mail-pg1-x544.google.com with SMTP id b8so6233902pgm.13 for ; Fri, 11 Oct 2019 11:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=O5o9Mqr/OVet2gVtrM7VOhNOSa7DEH704LnRNkVU6nE=; b=h/cAEAJIJooyWocHgl1PJ2HCJ2xWmJqjl4Yy+lENN0kaTpygwmM6fAkXo9ZkNJFHXl WO18mghMidJCCyeelOrzgsZ5ofWXt/t83vZn8t5tq7pCVQcn5ib6ZQ7c5pomT0rMdoWy KuICDhGFSKLrQvKAIMvH3XONwlCL6svgIe5Z4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=O5o9Mqr/OVet2gVtrM7VOhNOSa7DEH704LnRNkVU6nE=; b=Ceco2p9w2wpJRVJbPCwbv5Uvfvt1cY3s9tQzTQWbYu+h7byK0VQfkrff4vV4JdAY1Y QDSWUm+zD3sYotV56vbE8AIQMYflvs18hjR5qlNR9bLakTRCwL880PLI8WDXtwvba+yP 1C3oBB1OXtMSL6brf9URMKOdpf1f8wpOiEtnaQGwpvcMZZreWk8Ersvl/o3uxB0DSc+c 3S9UvvagIsqaAlpK5m8yIYcT1ixuo2dOQX1ysCaIHPPMejYtrfwAVKoLqYQoyouzg25k ZI3ATYHT2J2fplYp2fdCMM6x7CZKKn9OBV1hDYt7D0Z1bK7Vd09z2IzzuVvQtoGSR+03 M7Rw== X-Gm-Message-State: APjAAAX1byyRx+FAtV++dn8b3qGppwROQIn9j8H3+3Y6NW5MV3cYQ9DR kCxd1Q89XNpukLBT+u5sQITAww== X-Google-Smtp-Source: APXvYqwk/t3m0uPwdqj+hc3584RGzLLVJTHZ26WbVC2pBTiJOqUqvSRJZAlb+E/la920VhqnV19zIA== X-Received: by 2002:a62:2643:: with SMTP id m64mr5762842pfm.232.1570818550460; Fri, 11 Oct 2019 11:29:10 -0700 (PDT) Received: from localhost ([2620:15c:202:1:4fff:7a6b:a335:8fde]) by smtp.gmail.com with ESMTPSA id q204sm12835066pfc.11.2019.10.11.11.29.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Oct 2019 11:29:09 -0700 (PDT) Date: Fri, 11 Oct 2019 11:29:07 -0700 From: Matthias Kaehlcke To: MyungJoo Ham , Viresh Kumar Subject: Re: [PATCH v9 6/8] PM / devfreq: Introduce get_freq_range helper Message-ID: <20191011182907.GN87296@google.com> References: <20191003181938.GJ87296@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191003181938.GJ87296@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191011_112911_345494_1DE550FB X-CRM114-Status: GOOD ( 20.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Artur =?utf-8?B?xZp3aWdvxYQ=?= , Abel Vesa , Saravana Kannan , linux-pm@vger.kernel.org, NXP Linux Team , Krzysztof Kozlowski , Lukasz Luba , Chanwoo Choi , Kyungmin Park , Alexandre Bailon , Leonard Crestez , Georgi Djakov , linux-arm-kernel@lists.infradead.org, Jacky Bai Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 03, 2019 at 11:19:38AM -0700, Matthias Kaehlcke wrote: > On Wed, Oct 02, 2019 at 10:25:09PM +0300, Leonard Crestez wrote: > > Moving handling of min/max freq to a single function and call it from > > update_devfreq and for printing min/max freq values in sysfs. > > > > This changes the behavior of out-of-range min_freq/max_freq: clamping > > is now done at evaluation time. This means that if an out-of-range > > constraint is imposed by sysfs and it later becomes valid then it will > > be enforced. > > > > Signed-off-by: Leonard Crestez > > Reviewed-by: Matthias Kaehlcke > > --- > > drivers/devfreq/devfreq.c | 110 +++++++++++++++++++++----------------- > > 1 file changed, 62 insertions(+), 48 deletions(-) > > > > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > > index 87eff789ce24..2d63692903ff 100644 > > --- a/drivers/devfreq/devfreq.c > > +++ b/drivers/devfreq/devfreq.c > > > > ... > > > > static ssize_t min_freq_show(struct device *dev, struct device_attribute *attr, > > char *buf) > > { > > struct devfreq *df = to_devfreq(dev); > > + unsigned long min_freq, max_freq; > > > > - return sprintf(buf, "%lu\n", max(df->scaling_min_freq, df->min_freq)); > > + mutex_lock(&df->lock); > > + get_freq_range(df, &min_freq, &max_freq); > > With this min/max_freq shown aren't necessarily those set through sysfs, > but the aggregated PM QoS values (plus OPP constraints). > > I did some testing with a WIP patch that converts devfreq_cooling.c to > PM QoS. When reading sysfs min/max values to double check the limits > set earlier I found it utterly confusing to see the sysfs min/max values > fluctuating due to thermal throttling, and not being able to see the > configured values. > > Looks like cpufreq does the same, but I'm not convinced this is a good > idea. I think we want to display the values set by userspace, as done > before managing the limits through PM QoS. Viresh, was this change of > userspace visible behavior done intentionally for cpufreq? ping Viresh / devfreq maintainers: Do we really want to expose through sysfs the potentially constantly changing aggregate min/max values, instead of those set by userspace? At least for cpufreq that's a divergence from previous behavior, and from a userspace perspective it seems odd that you can't reliably read back the limit set by userspace. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel