linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Matthias Kaehlcke <mka@chromium.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Qais.Yousef@arm.com, juri.lelli@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 5/5] cpufreq: Add QoS requests for userspace constraints
Date: Mon, 17 Jun 2019 08:37:37 +0530	[thread overview]
Message-ID: <20190617030737.vb4k5g35p4igaq6e@vireshk-i7> (raw)
In-Reply-To: <20190614171450.GQ137143@google.com>

On 14-06-19, 10:14, Matthias Kaehlcke wrote:
> Hi Viresh,
> 
> On Mon, Jun 10, 2019 at 04:21:36PM +0530, Viresh Kumar wrote:
> > This implements QoS requests to manage userspace configuration of min
> > and max frequency.
> > 
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> >  drivers/cpufreq/cpufreq.c | 92 +++++++++++++++++++--------------------
> >  include/linux/cpufreq.h   |  8 +---
> >  2 files changed, 47 insertions(+), 53 deletions(-)
> > 
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 547d221b2ff2..ff754981fcb4 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -720,23 +720,15 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf)
> >  static ssize_t store_##file_name					\
> >  (struct cpufreq_policy *policy, const char *buf, size_t count)		\
> >  {									\
> > -	int ret, temp;							\
> > -	struct cpufreq_policy new_policy;				\
> > +	unsigned long val;						\
> > +	int ret;							\
> >  									\
> > -	memcpy(&new_policy, policy, sizeof(*policy));			\
> > -	new_policy.min = policy->user_policy.min;			\
> > -	new_policy.max = policy->user_policy.max;			\
> > -									\
> > -	ret = sscanf(buf, "%u", &new_policy.object);			\
> > +	ret = sscanf(buf, "%lu", &val);					\
> >  	if (ret != 1)							\
> >  		return -EINVAL;						\
> >  									\
> > -	temp = new_policy.object;					\
> > -	ret = cpufreq_set_policy(policy, &new_policy);		\
> > -	if (!ret)							\
> > -		policy->user_policy.object = temp;			\
> > -									\
> > -	return ret ? ret : count;					\
> > +	ret = dev_pm_qos_update_request(policy->object##_freq_req, val);\
> > +	return ret && ret != 1 ? ret : count;				\
> 
> nit: I wonder if
> 
>   return (ret >= 0) ? count : ret;
> 
> would be clearer.

Done. Thanks.

> Other than that:
> 
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

-- 
viresh

  reply	other threads:[~2019-06-17  3:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 10:51 [PATCH V3 0/5] cpufreq: Use QoS layer to manage freq-constraints Viresh Kumar
2019-06-10 10:51 ` [PATCH V3 1/5] PM / QOS: Pass request type to dev_pm_qos_{add|remove}_notifier() Viresh Kumar
2019-06-11 23:45   ` Matthias Kaehlcke
2019-06-17  9:23   ` Ulf Hansson
2019-06-17 22:52   ` Rafael J. Wysocki
2019-06-10 10:51 ` [PATCH V3 2/5] PM / QOS: Pass request type to dev_pm_qos_read_value() Viresh Kumar
2019-06-12  0:08   ` Matthias Kaehlcke
2019-06-17  9:23   ` Ulf Hansson
2019-06-17 23:14   ` Rafael J. Wysocki
2019-06-10 10:51 ` [PATCH V3 3/5] PM / QoS: Add support for MIN/MAX frequency constraints Viresh Kumar
2019-06-13  0:04   ` Matthias Kaehlcke
2019-06-17  9:23   ` Ulf Hansson
2019-06-10 10:51 ` [PATCH V3 4/5] cpufreq: Register notifiers with the PM QoS framework Viresh Kumar
2019-06-14 16:46   ` Matthias Kaehlcke
2019-06-17  3:02     ` Viresh Kumar
2019-06-17  9:23   ` Ulf Hansson
2019-06-17 23:26   ` Rafael J. Wysocki
2019-06-18 11:25     ` Viresh Kumar
2019-06-18 22:23       ` Rafael J. Wysocki
2019-06-19  6:39         ` Viresh Kumar
2019-06-19  9:15           ` Rafael J. Wysocki
2019-06-17 23:37   ` Rafael J. Wysocki
2019-06-18 11:34     ` Viresh Kumar
2019-06-10 10:51 ` [PATCH V3 5/5] cpufreq: Add QoS requests for userspace constraints Viresh Kumar
2019-06-14 17:14   ` Matthias Kaehlcke
2019-06-17  3:07     ` Viresh Kumar [this message]
2019-06-17  9:23   ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190617030737.vb4k5g35p4igaq6e@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=Qais.Yousef@arm.com \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).