From 48acc4c51909b0f22676eb409a90b0383809afae Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Wed, 3 Nov 2021 22:05:10 -0700 Subject: [PATCH] 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 Signed-off-by: Vivek Aknurwar --- 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 a63c58cf8408..cb172d17437f 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -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,