ANDROID: thermal: Add logic for filter on-die tz genl event.
Add logic in enable_thermal_genl_check to avoid thermal-hal being woken up all the time by on-die sensor. When the temperature of the on-die sensor thermal_zone updates, the thermal_zone_device_update() will be called to handle thermal and then the netlink events will be sent through thermal_notify_tz_trip_(). But there is currently no way to filter thermal_zone in the thermal_netlink, so many netlink events will be sent in a short amount of time. Because the on-die sensors are very sensitive. Their temperature may jump up and down quickly in a few ms. Bug: 170682696 Test: boot and thermal-hal can receive thermal genl events from kernel Change-Id: Idb3f4b07a2a2740c01d8785910878bfe6edc832d Signed-off-by: davidchao <davidchao@google.com>
This commit is contained in:
@@ -232,7 +232,7 @@ static int thermal_genl_send_event(enum thermal_genl_event event,
|
||||
void *hdr;
|
||||
int enable_thermal_genl = 1;
|
||||
|
||||
trace_android_vh_enable_thermal_genl_check(event, &enable_thermal_genl);
|
||||
trace_android_vh_enable_thermal_genl_check(event, p->tz_id, &enable_thermal_genl);
|
||||
if (!enable_thermal_genl)
|
||||
return 0;
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
DECLARE_HOOK(android_vh_enable_thermal_genl_check,
|
||||
TP_PROTO(int event, int *enable_thermal_genl),
|
||||
TP_ARGS(event, enable_thermal_genl));
|
||||
TP_PROTO(int event, int tz_id, int *enable_thermal_genl),
|
||||
TP_ARGS(event, tz_id, enable_thermal_genl));
|
||||
|
||||
#endif /* _TRACE_HOOK_THERMAL_H */
|
||||
/* This part must be outside protection */
|
||||
|
Reference in New Issue
Block a user