diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-31 14:28:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-31 14:28:12 -0400 |
commit | d547d44e5c5dd82b32c2399632b254395a099072 (patch) | |
tree | a828986345b09712ad80052d086e4aefe548c135 | |
parent | 519f64bf15dccb4f64af34b74ed186c32363ab59 (diff) | |
parent | c2b59d279dbbac750958f6a1bc4841e431d934e3 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui:
- Fix a use-after-free issue when unregistering a thermal cooling
device (Dmitry Osipenko)
- use power_efficient_wq for thermal worker to save more power (Jeson
Gao)
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
thermal: core: using power_efficient_wq for thermal worker
thermal: core: Fix use-after-free in thermal_cooling_device_destroy_sysfs
-rw-r--r-- | drivers/thermal/thermal_core.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 6ab982309e6a..d6ebc1cf6aa9 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c | |||
@@ -290,10 +290,12 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz, | |||
290 | int delay) | 290 | int delay) |
291 | { | 291 | { |
292 | if (delay > 1000) | 292 | if (delay > 1000) |
293 | mod_delayed_work(system_freezable_wq, &tz->poll_queue, | 293 | mod_delayed_work(system_freezable_power_efficient_wq, |
294 | &tz->poll_queue, | ||
294 | round_jiffies(msecs_to_jiffies(delay))); | 295 | round_jiffies(msecs_to_jiffies(delay))); |
295 | else if (delay) | 296 | else if (delay) |
296 | mod_delayed_work(system_freezable_wq, &tz->poll_queue, | 297 | mod_delayed_work(system_freezable_power_efficient_wq, |
298 | &tz->poll_queue, | ||
297 | msecs_to_jiffies(delay)); | 299 | msecs_to_jiffies(delay)); |
298 | else | 300 | else |
299 | cancel_delayed_work(&tz->poll_queue); | 301 | cancel_delayed_work(&tz->poll_queue); |
@@ -1102,8 +1104,9 @@ void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) | |||
1102 | mutex_unlock(&thermal_list_lock); | 1104 | mutex_unlock(&thermal_list_lock); |
1103 | 1105 | ||
1104 | ida_simple_remove(&thermal_cdev_ida, cdev->id); | 1106 | ida_simple_remove(&thermal_cdev_ida, cdev->id); |
1105 | device_unregister(&cdev->device); | 1107 | device_del(&cdev->device); |
1106 | thermal_cooling_device_destroy_sysfs(cdev); | 1108 | thermal_cooling_device_destroy_sysfs(cdev); |
1109 | put_device(&cdev->device); | ||
1107 | } | 1110 | } |
1108 | EXPORT_SYMBOL_GPL(thermal_cooling_device_unregister); | 1111 | EXPORT_SYMBOL_GPL(thermal_cooling_device_unregister); |
1109 | 1112 | ||