From 01c3246e3842e8ac2ba7023991cc29a38a836e29 Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Wed, 3 Nov 2021 22:05:10 -0700 Subject: [PATCH] thermal: limits-dcvs: 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. [dereference23: Backport to msm-4.14] Change-Id: I4c27c9a952ed556336297eb25e815c848b8266eb Signed-off-by: Abhijeet Dharmapurikar Signed-off-by: Alexander Winkowski Signed-off-by: Richard Raya --- drivers/thermal/qcom/msm_lmh_dcvs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/msm_lmh_dcvs.c b/drivers/thermal/qcom/msm_lmh_dcvs.c index 0dab1783aec7..3a77a717d510 100644 --- a/drivers/thermal/qcom/msm_lmh_dcvs.c +++ b/drivers/thermal/qcom/msm_lmh_dcvs.c @@ -738,7 +738,7 @@ static int limits_dcvs_probe(struct platform_device *pdev) mutex_init(&hw->access_lock); INIT_WORK(&hw->cdev_register_work, register_cooling_device); - INIT_DEFERRABLE_WORK(&hw->freq_poll_work, limits_dcvs_poll); + INIT_DELAYED_WORK(&hw->freq_poll_work, limits_dcvs_poll); hw->osm_hw_reg = devm_ioremap(&pdev->dev, request_reg, 0x4); if (!hw->osm_hw_reg) { pr_err("register remap failed\n");