diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 37aa4bba1726..badd371e142d 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -291,6 +291,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_register); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_unregister); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_thermal_zone_device); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_power_cap); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_enable_thermal_power_throttle); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_madvise_pageout_swap_entry); diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 5471c9091f5f..b851d7cf0968 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -704,6 +704,7 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip) int switch_on_temp, control_temp; struct power_allocator_params *params = tz->governor_data; bool update; + bool enable = true; lockdep_assert_held(&tz->lock); @@ -714,9 +715,11 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip) if (trip != params->trip_max_desired_temperature) return 0; + trace_android_vh_enable_thermal_power_throttle(&enable); + ret = tz->ops->get_trip_temp(tz, params->trip_switch_on, &switch_on_temp); - if (!ret && (tz->temperature < switch_on_temp)) { + if ((!ret && (tz->temperature < switch_on_temp)) || !enable) { update = (tz->last_temperature >= switch_on_temp); tz->passive = 0; reset_pid_controller(params); diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h index dd42f1d6766a..3e928aa1920d 100644 --- a/include/trace/hooks/thermal.h +++ b/include/trace/hooks/thermal.h @@ -48,6 +48,10 @@ DECLARE_HOOK(android_vh_thermal_power_cap, TP_PROTO(u32 *power_range), TP_ARGS(power_range)); +DECLARE_HOOK(android_vh_enable_thermal_power_throttle, + TP_PROTO(bool *enable), + TP_ARGS(enable)); + #endif /* _TRACE_HOOK_THERMAL_H */ /* This part must be outside protection */ #include