Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
drivers: thermal: Use deferrable work and power efficient workqueue
Browse files Browse the repository at this point in the history
Thermal core uses work events to poll for sensor driver temperature
crossing a threshold. Since it is not using a deferrable workqueue, it
might wake-up the device from sleep.

Use a deferrable work event and post the work in the power efficient
workqueue for estimating virtual sensor temperature.

Change-Id: I9dd21d8fc4e5ca96e06db9ecb57a628618494a01
Signed-off-by: Ram Chandrasekar <[email protected]>
  • Loading branch information
Ram Chandrasekar authored and radcolor committed Jan 12, 2020
1 parent 9fd2399 commit 9a0d087
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,9 @@ static void monitor_thermal_zone(struct thermal_zone_device *tz)
thermal_zone_device_set_polling(thermal_passive_wq,
tz, tz->passive_delay);
else if (tz->polling_delay)
thermal_zone_device_set_polling(system_freezable_wq,
tz, tz->polling_delay);
thermal_zone_device_set_polling(
system_freezable_power_efficient_wq,
tz, tz->polling_delay);
else
thermal_zone_device_set_polling(NULL, tz, 0);

Expand Down Expand Up @@ -2468,7 +2469,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
/* Bind cooling devices for this zone */
bind_tz(tz);

INIT_DELAYED_WORK(&(tz->poll_queue), thermal_zone_device_check);
INIT_DEFERRABLE_WORK(&(tz->poll_queue), thermal_zone_device_check);

thermal_zone_device_reset(tz);
/* Update the new thermal zone and mark it as already updated. */
Expand Down

0 comments on commit 9a0d087

Please sign in to comment.