From: Viresh Kumar <viresh.kumar@linaro.org>
To: Xuewen Yan <xuewen.yan94@gmail.com>
Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, xuewyan@foxmail.com,
Xuewen.Yan@unisoc.com
Subject: Re: [PATCH] cpufreq: Judging new_policy before update related_cpus
Date: Tue, 2 Feb 2021 15:11:56 +0530 [thread overview]
Message-ID: <20210202094156.tb27lpq2nfzvbxgi@vireshk-i7> (raw)
In-Reply-To: <20210202093619.543-1-xuewen.yan94@gmail.com>
On 02-02-21, 17:36, Xuewen Yan wrote:
> From: Xuewen Yan <xuewen.yan@unisoc.com>
>
> When the policy->related_cpus are all offline, and then
> bring up one cpu, this time, if the ->online is NULL,
> the code would update the ->related_cpus with ->cpus,
> and now ->cpus is only one online cpu, as a result, the
> ->related_cpus is different from the origion ->related_cpus.
>
> Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
> ---
> drivers/cpufreq/cpufreq.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index d0a3525ce27f..3d512ac463a5 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1374,8 +1374,10 @@ static int cpufreq_online(unsigned int cpu)
> if (ret)
> goto out_exit_policy;
>
> - /* related_cpus should at least include policy->cpus. */
> - cpumask_copy(policy->related_cpus, policy->cpus);
> + if (new_policy) {
> + /* related_cpus should at least include policy->cpus. */
> + cpumask_copy(policy->related_cpus, policy->cpus);
> + }
> }
The driver's ->init() callback is responsible for filling policy->cpus
here.
--
viresh
prev parent reply other threads:[~2021-02-02 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 9:36 Xuewen Yan
2021-02-02 9:41 ` Viresh Kumar [this message]
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=20210202094156.tb27lpq2nfzvbxgi@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=Xuewen.Yan@unisoc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=xuewen.yan94@gmail.com \
--cc=xuewyan@foxmail.com \
/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®