From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Lukasz Luba <lukasz.luba@arm.com>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Cc: 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: [PATCH 1/2] cpufreq: qcom-hw: Use initialized cpumask for thermal pressure update
Date: Tue, 18 Jan 2022 10:56:11 -0800 [thread overview]
Message-ID: <20220118185612.2067031-1-bjorn.andersson@linaro.org> (raw)
In the event that the SoC is under thermal pressure while booting it's
possible for the dcvs notification to happen inbetween the cpufreq
framework calling init and it actually updating the policy's
related_cpus cpumask.
Prior to the introduction of the thermal pressure update helper an empty
cpumask would simply result in the thermal pressure of no cpus being
updated, but the new code will attempt to dereference an invalid per_cpu
variable.
Avoid this problem by using the policy's cpus cpumask instead of the
related_cpus mask, as this is initialized before the interrupt is
registered.
Fixes: 0258cb19c77d ("cpufreq: qcom-cpufreq-hw: Use new thermal pressure update function")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
drivers/cpufreq/qcom-cpufreq-hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index 05f3d7876e44..866fba3ac6fc 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -297,7 +297,7 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
throttled_freq = freq_hz / HZ_PER_KHZ;
/* Update thermal pressure (the boost frequencies are accepted) */
- arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
+ arch_update_thermal_pressure(policy->cpus, throttled_freq);
/*
* In the unlikely case policy is unregistered do not enable
--
2.33.1
next reply other threads:[~2022-01-18 18:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 18:56 Bjorn Andersson [this message]
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
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=20220118185612.2067031-1-bjorn.andersson@linaro.org \
--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 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®