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.2 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 E3F9BC432C1 for ; Mon, 23 Sep 2019 21:42:30 +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 B4E5F206C2 for ; Mon, 23 Sep 2019 21:42:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JcHYjjnK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Ps6OG8v5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4E5F206C2 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=gzC73LpikYE5hykfkLWOHxfWQTHGiyxxur3gZ6v6mMQ=; b=JcHYjjnKct0e/X sqNYCAanc3Wiw/8Mdz0vAjB7IQuzmzY+uidLAktnRNVYE/rI8drRSHmlrIGEHPqLFg+J5A24RD1Pi di7H+OoRVCUPKbddxIlTdTMJIXacZnFBO04Y+eGxwL3qNgv3E9EfZ1CeaGQjnSDpWpQJuCIrDkwz7 driSSmG0gfe6kADDdG/Juc8AemK1mGhGlpvSnniRWbioeZXmsma45hOICdUs95Vp2U2iEO3N2aIQ4 34kS5WO9mGcuJtXGoYTnJIqs4cWiEO9eqVuomYYPf3/kmiP+IkJl6xydXqSK+pH0qgfevMmefptFE dadFiB8pisy4smVOOPfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCW66-0007IH-Pq; Mon, 23 Sep 2019 21:42:18 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCW63-0007HM-Se for linux-arm-kernel@lists.infradead.org; Mon, 23 Sep 2019 21:42:17 +0000 Received: by mail-pl1-x642.google.com with SMTP id e5so7086751pls.9 for ; Mon, 23 Sep 2019 14:42: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=LN2jcukuPHy9o4Jb1zZq4UGAS0V2HgpSfI+T3t4oJ94=; b=Ps6OG8v5rRsTroOwDDLZ4nW8gYvFsQQGX4I82xbw3H2OZQIfJNPNUW9kRrR4dvQzzj Y9CW4mV1mP9FL5g4ZkahEmOdq6uuUoHnIwQkOL3FDp9REe3837X6bLaZZVSTN0vuK/F1 DrA7GS2LGLQaBYQdhBMYzZG0r9mTckUwbSJ30= 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=LN2jcukuPHy9o4Jb1zZq4UGAS0V2HgpSfI+T3t4oJ94=; b=QO/TCn/NMLlYSHgOWTUsUqDqRM5q/aCbrn+3LFuRAvBE+qI1JZeXjIWNpcGt1RZG/1 CZAP4tlRIEPddijtgoSmOitS2auCyeaRgjmWBFiUvQOlRzYKReIM7b7WkJX1D8AbZ+c2 as5hZ1TwsFc2NelwM9le3BPjSle1fbuOO6M61KQxqwmoTXubi/IXU6yZmNr9FmyeIRF/ 3X1Y7e/5HtbD2Q/wFo0vEJnwwr6yiocjMdhDqoYIQQkYOktbmH2KTlSGHq1nfg7SXx7d uFIzh3jBMHGMuzu1HL7Sp2ZIQUjz22WWS/+vK2d4vkAMj8SnaLZjn8mXRFbZTW3iOU00 LPKg== X-Gm-Message-State: APjAAAXtsr8tOgFHZ9jgw9EDm+ji1X4lcv/n5A+1eOLerF8PIV0haqxk GS1kklsTUeMkcpYCx/dYR/6wWQ== X-Google-Smtp-Source: APXvYqwUgQI62mHf0qjDK4hdTJErmArRYu2PmE5qeBv5kbgiK8V+DnhYLpDqt6ga3PV3FxYn+pWvdw== X-Received: by 2002:a17:902:8484:: with SMTP id c4mr1879668plo.223.1569274930403; Mon, 23 Sep 2019 14:42:10 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id k31sm18848493pjb.14.2019.09.23.14.42.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Sep 2019 14:42:09 -0700 (PDT) Date: Mon, 23 Sep 2019 14:42:07 -0700 From: Matthias Kaehlcke To: Leonard Crestez Subject: Re: [PATCH v7 5/6] PM / devfreq: Add PM QoS support Message-ID: <20190923214207.GG133864@google.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20190923_144215_929513_7C589048 X-CRM114-Status: GOOD ( 19.05 ) 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, Viresh Kumar , NXP Linux Team , Krzysztof Kozlowski , Lukasz Luba , Chanwoo Choi , Kyungmin Park , MyungJoo Ham , Alexandre Bailon , Martin Kepplinger , 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 Tue, Sep 24, 2019 at 12:10:33AM +0300, Leonard Crestez wrote: > Register notifiers with the PM QoS framework in order to respond to > requests for DEV_PM_QOS_MIN_FREQUENCY and DEV_PM_QOS_MAX_FREQUENCY. > > No notifiers are added by this patch but PM QoS constraints can be > imposed externally (for example from other devices). > > Signed-off-by: Leonard Crestez > --- > drivers/devfreq/devfreq.c | 76 +++++++++++++++++++++++++++++++++++++++ > include/linux/devfreq.h | 5 +++ > 2 files changed, 81 insertions(+) > > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > index 7f152a582e78..9887408f23bb 100644 > --- a/drivers/devfreq/devfreq.c > +++ b/drivers/devfreq/devfreq.c > @@ -22,17 +22,20 @@ > #include > #include > #include > #include > #include > +#include > #include "governor.h" > > #define HZ_PER_KHZ 1000 > > #define CREATE_TRACE_POINTS > #include > > +#define HZ_PER_KHZ 1000 > + > static struct class *devfreq_class; > > /* > * devfreq core provides delayed work based load monitoring helper > * functions. Governors can use these or can implement their own > @@ -123,10 +126,16 @@ static void devfreq_get_freq_range(struct devfreq *devfreq, > } else { > *min_freq = freq_table[devfreq->profile->max_state - 1]; > *max_freq = freq_table[0]; > } > > + /* constraints from PM QoS */ > + *min_freq = max(*min_freq, HZ_PER_KHZ * (unsigned long)dev_pm_qos_read_value( > + devfreq->dev.parent, DEV_PM_QOS_MIN_FREQUENCY)); > + *max_freq = min(*max_freq, HZ_PER_KHZ * (unsigned long)dev_pm_qos_read_value( > + devfreq->dev.parent, DEV_PM_QOS_MAX_FREQUENCY)); > + > /* constraints from sysfs */ > *min_freq = max(*min_freq, devfreq->min_freq); > *max_freq = min(*max_freq, devfreq->max_freq); > > /* constraints from OPP interface */ > @@ -605,10 +614,53 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type, > mutex_unlock(&devfreq->lock); > > return ret; > } > > +/** > + * devfreq_qos_notifier_call() - Common handler for QoS constraints. > + * @devfreq: the devfreq instance. > + */ > +static int devfreq_qos_notifier_call(struct devfreq *devfreq) > +{ > + int err; > + > + mutex_lock(&devfreq->lock); > + err = update_devfreq(devfreq); > + mutex_unlock(&devfreq->lock); > + if (err) > + dev_err(&devfreq->dev, "dvfs for QoS constraints" > + " failed with (%d) error\n", err); nit: DVFS. devfreq_monitor() also uses the lower-case acronym though, so you can claim this is consistent :) I'd prefer to spare you another trivial re-spin, but unfortunately breaking the log message into multiple lines is a coding style violation: Documentation/process/coding-style.rst 2) Breaking long lines and strings However, never break user-visible strings such as printk messages, because that breaks the ability to grep for them. With that fixed: Reviewed-by: Matthias Kaehlcke _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel