diff options
author | Wei Wang <wvw@google.com> | 2019-04-16 10:07:01 -0700 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2019-05-06 20:35:11 +0800 |
commit | ff54bbd1beb24224e82cfe3e76668ee79ff32945 (patch) | |
tree | 18b38abef42f263cbc90c04739c322ff8f25e52d | |
parent | f991de53a8abef21fae3e31967cb4f6a75c070b5 (diff) | |
download | linux-stable-ff54bbd1beb24224e82cfe3e76668ee79ff32945.tar.gz linux-stable-ff54bbd1beb24224e82cfe3e76668ee79ff32945.tar.bz2 linux-stable-ff54bbd1beb24224e82cfe3e76668ee79ff32945.zip |
thermal: core: skip update disabled thermal zones after suspend
It is unnecessary to update disabled thermal zones post suspend and
sometimes leads error/warning in bad behaved thermal drivers.
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r-- | drivers/thermal/thermal_core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index b708b66fef94..a2c0ce65bfa4 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1494,6 +1494,7 @@ static int thermal_pm_notify(struct notifier_block *nb, unsigned long mode, void *_unused) { struct thermal_zone_device *tz; + enum thermal_device_mode tz_mode; switch (mode) { case PM_HIBERNATION_PREPARE: @@ -1506,6 +1507,13 @@ 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) { + tz_mode = THERMAL_DEVICE_ENABLED; + if (tz->ops->get_mode) + tz->ops->get_mode(tz, &tz_mode); + + if (tz_mode == THERMAL_DEVICE_DISABLED) + continue; + thermal_zone_device_init(tz); thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); |