From 353c3de3f112132e10d8649a97f0a03fad28c745 Mon Sep 17 00:00:00 2001 From: David Chao Date: Wed, 7 Apr 2021 17:49:53 +0800 Subject: [PATCH] ANDROID: thermal: Add vendor thermal_pm_notify_suspend function Currently, most of the thermal_zones are IRQ capable and they do not need to be updated while resuming. To improve the system performance and reduce the resume time. Add a vendor function to check if the thermal_zone is not IRQ capable and needs to be updated. Bug: 170905417 Bug: 332221925 Test: boot and vendor function worked properly. Change-Id: I9389985bba29b551a7a20b55e1ed26b6c4da9b3d Signed-off-by: David Chao Signed-off-by: Dylan Chang --- drivers/android/vendor_hooks.c | 1 + drivers/thermal/thermal_core.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 96302ea67606..f83f72e0e820 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -138,6 +138,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_oops_exit); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_size_check); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_format_check); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_dump_buffer); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_pm_notify_suspend); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_fill_prdt); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ufs_reprogram_all_keys); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ufs_complete_init); diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index f334960f34e6..fa838001e6a7 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1454,6 +1454,7 @@ static int thermal_pm_notify(struct notifier_block *nb, unsigned long mode, void *_unused) { struct thermal_zone_device *tz; + int irq_wakeable = 0; switch (mode) { case PM_HIBERNATION_PREPARE: @@ -1466,6 +1467,11 @@ static int thermal_pm_notify(struct notifier_block *nb, case PM_POST_SUSPEND: atomic_set(&in_suspend, 0); list_for_each_entry(tz, &thermal_tz_list, node) { + + trace_android_vh_thermal_pm_notify_suspend(tz, &irq_wakeable); + if (irq_wakeable) + continue; + thermal_zone_device_init(tz); thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);