From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lukasz Luba <lukasz.luba@arm.com>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Thara Gopinath <thara.gopinath@gmail.com>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] cpufreq: qcom-hw: Use initialized cpumask for thermal pressure update
Date: Wed, 19 Jan 2022 07:05:52 -0800 [thread overview]
Message-ID: <Yego0BwrVXkqqJOm@ripper> (raw)
In-Reply-To: <20220119064029.b2yhqcazhpdbhasc@vireshk-i7>
On Tue 18 Jan 22:40 PST 2022, Viresh Kumar wrote:
> On 19-01-22, 12:05, Viresh Kumar wrote:
> > policy->cpus keeps on changing with CPU hotplug and this can leave
> > your platform in an inconsistent state. For example, in case where you
> > offline a CPU from policy, other CPUs get their thermal pressure
> > updated, online the CPU back and all CPUs of a policy don't have the
> > same settings anymore.
> >
Oh, I didn't know that. Then my proposal doesn't seem that awesome.
> > There are few things we can do here now:
> >
> > - Check for empty related_cpus and return early. Since related_cpus is
> > updated only once, this shall work just fine and must not be racy.
> >
> > While at it, I think we can also do something like this in
> > topology_update_thermal_pressure() instead:
> >
> > cpu = cpumask_first(cpus);
> > if (unlikely(cpu >= NR_CPUS))
> > return;
> >
> > - And while writing this email, I dropped all other ideas in favor of
> > change to topology_update_thermal_pressure() :)
>
> And then I saw your second patch, which looks good as otherwise we
> will not be able to catch the bug in our system where we are sending
> the empty cpumask :)
>
> So the other idea is:
>
> - Revert, or bring back a new version of this and register the
> interrupt from there. But that is also not a very clean solution.
>
> commit 4bf8e582119e ("cpufreq: Remove ready() callback")
>
We could do this and keep the interrupt disabled until we hit ready().
But I found the resulting issue non-trivial to debug, so I would prefer
if arch_update_thermal_pressure() dealt with the empty cpumask. So as
you suggest in your first reply, I'll respin the second patch alone,
without the WARN_ON().
Thanks,
Bjorn
prev parent reply other threads:[~2022-01-19 15:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 18:56 [PATCH 1/2] cpufreq: qcom-hw: Use initialized cpumask for thermal pressure update Bjorn Andersson
2022-01-18 18:56 ` [PATCH 2/2] arch_topology: Sanity check cpumask in " Bjorn Andersson
2022-01-19 10:25 ` Greg Kroah-Hartman
2022-01-19 14:43 ` Sudeep Holla
2022-01-19 15:21 ` Bjorn Andersson
2022-01-19 6:35 ` [PATCH 1/2] cpufreq: qcom-hw: Use initialized cpumask for " Viresh Kumar
2022-01-19 6:40 ` Viresh Kumar
2022-01-19 15:05 ` Bjorn Andersson [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=Yego0BwrVXkqqJOm@ripper \
--to=bjorn.andersson@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=thara.gopinath@gmail.com \
--cc=viresh.kumar@linaro.org \
--cc=vladimir.zapolskiy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.