cpufreq: qcom-hw: switch to non deferrable work

Currently, when lmh interrupt fires we notify the scheduler about
thermal pressure. The scheduler reduces the capacity of the cpu(s)
for which the interrupt fired, while we requeue our deferrable work.

This leads to an interesting deadlock, since the cpu is running with
reduced capacity, the scheduler does not put any task on it,
extending the idle time and causing it to remain at reduced capacity -
leading to severe underutilization of the cpu(s).

Switch to using delayed work instead of deferrable work. This will cause
us to exit idle until the thermal condition is recovered.

Change-Id: I4c27c9a952ed556336297eb25e815c848b8266eb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
This commit is contained in:
Abhijeet Dharmapurikar 2021-11-03 22:05:10 -07:00 committed by Mike Tipton
parent b67959cb83
commit 48acc4c519

View File

@ -491,7 +491,7 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)
data->policy = policy;
mutex_init(&data->throttle_lock);
INIT_DEFERRABLE_WORK(&data->throttle_work, qcom_lmh_dcvs_poll);
INIT_DELAYED_WORK(&data->throttle_work, qcom_lmh_dcvs_poll);
snprintf(data->irq_name, sizeof(data->irq_name), "dcvsh-irq-%u", policy->cpu);
ret = request_threaded_irq(data->throttle_irq, NULL, qcom_lmh_dcvs_handle_irq,