cpufreq: qcom-hw: Delay enabling throttle_irq
authorBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 28 Jan 2022 03:25:54 +0000 (19:25 -0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Wed, 9 Feb 2022 07:48:49 +0000 (13:18 +0530)
commitef8ee1cb8fc8976a68f5e89cd5f7b6f7de80c66f
tree005a02244cc4753b973132bf86610628fd200d33
parent4f774c4a65bf3987d1a95c966e884f38c8a942af
cpufreq: qcom-hw: Delay enabling throttle_irq

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 newly reintroduced "ready" callback, to
postpone enabling the IRQ until the related_cpus cpumask is filled in.

Fixes: 0258cb19c77d ("cpufreq: qcom-cpufreq-hw: Use new thermal pressure update function")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/qcom-cpufreq-hw.c