diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index bb2f17f9a32f..3714a17963d9 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -377,3 +377,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sound_usb_support_cpu_suspend); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snd_compr_use_pause_in_drain); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_request_freq); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_target_freq); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_enable_thermal_power_throttle); diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index ab0be26f0816..fee3a301e902 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -14,6 +14,8 @@ #define CREATE_TRACE_POINTS #include +#undef CREATE_TRACE_POINTS +#include #include "thermal_core.h" @@ -607,6 +609,7 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip) int ret; int switch_on_temp, control_temp; struct power_allocator_params *params = tz->governor_data; + int enable = 1; /* * We get called for every trip point but we only need to do @@ -615,9 +618,11 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip) if (trip != params->trip_max_desired_temperature) return 0; - ret = tz->ops->get_trip_temp(tz, params->trip_switch_on, - &switch_on_temp); - if (!ret && (tz->temperature < switch_on_temp)) { + trace_android_vh_enable_thermal_power_throttle(&enable); + if (enable) + ret = tz->ops->get_trip_temp(tz, params->trip_switch_on, + &switch_on_temp); + if (!enable || (!ret && (tz->temperature < switch_on_temp))) { tz->passive = 0; reset_pid_controller(params); allow_maximum_power(tz); diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h index 97be2675f3b8..3de589459b36 100644 --- a/include/trace/hooks/thermal.h +++ b/include/trace/hooks/thermal.h @@ -27,6 +27,10 @@ DECLARE_HOOK(android_vh_modify_thermal_target_freq, TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq), TP_ARGS(policy, target_freq)); +DECLARE_HOOK(android_vh_enable_thermal_power_throttle, + TP_PROTO(int *enable), + TP_ARGS(enable)); + #endif /* _TRACE_HOOK_THERMAL_H */ /* This part must be outside protection */ #include