mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: "Wangtao (Kevin, Kirin)" <kevin.wangtao@hisilicon.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	gengyanping@hisilicon.com, sunzhaosheng@hisilicon.com
Subject: Re: [PATCH] cpufreq: reinitialize new policy min/max when writing scaling_(max|min)_freq
Date: Tue, 29 May 2018 10:45:57 +0200	[thread overview]
Message-ID: <3949526.VSbr9bPLlU@aspire.rjw.lan> (raw)
In-Reply-To: <7700fad7-211d-d8b2-e4ee-975c1cf1f9dc@hisilicon.com>

On Friday, May 25, 2018 4:54:04 AM CEST Wangtao (Kevin, Kirin) wrote:
> 
> 在 2018/5/24 15:45, Rafael J. Wysocki 写道:
> > On Thu, May 24, 2018 at 8:43 AM, Kevin Wangtao
> > <kevin.wangtao@hisilicon.com> wrote:
> >> consider such situation, current user_policy.min is 1000000,
> >> current user_policy.max is 1200000, in cpufreq_set_policy,
> >> other driver may update policy.min to 1200000, policy.max to
> >> 1300000. After that, If we input "echo 1300000 > scaling_min_freq",
> >> then user_policy.min will be 1300000, and user_policy.max is
> >> still 1200000, because the input value is checked with policy.max
> >> not user_policy.max. if we get all related cpus offline and
> >> online again, it will cause cpufreq_init_policy fail because
> >> user_policy.min is higher than user_policy.max.
> > 
> > How do you reproduce this, exactly?
>
> I write a driver register CPUFREQ_POLICY_NOTIFIER, and when event is CPUFREQ_ADJUST,
> it will modify policy's min/max according to some conditions, I test it with writing
> scaling_(max|min)_freq to traverse all frequencies repeatly, and also repeat hotplug
> as background.

You are expected to use cpufreq_update_policy() to update the limits in policy
notifiers.  Do you use it in your driver?

  reply	other threads:[~2018-05-29  8:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24  6:43 Kevin Wangtao
2018-05-24  7:45 ` Rafael J. Wysocki
2018-05-25  2:54   ` Wangtao (Kevin, Kirin)
2018-05-29  8:45     ` Rafael J. Wysocki [this message]
2018-05-26  6:50   ` Wangtao (Kevin, Kirin)
2018-05-29  8:47     ` Rafael J. Wysocki
2018-05-26  7:16 ` [PATCH V2] " Kevin Wangtao
2018-05-29 10:26   ` Viresh Kumar
2018-05-30  8:03     ` Wangtao (Kevin, Kirin)
2018-05-30  7:56   ` [PATCH V3] " Kevin Wangtao
2018-05-30 11:10     ` Rafael J. Wysocki
2018-05-27  6:15 ` [PATCH] " kbuild test robot

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=3949526.VSbr9bPLlU@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=gengyanping@hisilicon.com \
    --cc=kevin.wangtao@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sunzhaosheng@hisilicon.com \
    --cc=viresh.kumar@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

all inboxes | Powered by JetHome®