From ef66548bf00599d6a40686ea6776cf7f01f3b768 Mon Sep 17 00:00:00 2001 From: Panchajanya1999 Date: Sun, 12 Dec 2021 15:14:43 +0100 Subject: [PATCH] thermal: qcom: bcl: Return before thermal trip evaluates Returning before thermal trips due to lower battery should fix the lag due to restricted thermals. This what BCL does. test: check 2-3 cycles of battery percentage under 10% result: Fixes device lag completely. Maintains constant performance Signed-off-by: azrim --- drivers/thermal/qcom/bcl_soc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/bcl_soc.c b/drivers/thermal/qcom/bcl_soc.c index 29e97e42a3c0..d16c555bd2ec 100644 --- a/drivers/thermal/qcom/bcl_soc.c +++ b/drivers/thermal/qcom/bcl_soc.c @@ -100,9 +100,11 @@ static void bcl_evaluate_soc(struct work_struct *work) bcl_perph->trip_val = battery_percentage; mutex_unlock(&bcl_perph->state_trans_lock); + + return; //return before thermal handle trips with percentage + of_thermal_handle_trip(bcl_perph->tz_dev); - return; eval_exit: mutex_unlock(&bcl_perph->state_trans_lock); }