Skip to contentSkip to conversation

thermal: Prevent polling from happening during system suspend

PATCH RESEND Applied Rafael J. Wysocki 3 participants 3 messages Nov 6, 2011 – Feb 17, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 thermal: Prevent polling from happening during system suspend

From: Rafael J. Wysocki <[email protected]>

The thermal driver should use a freezable workqueue to schedule polling to prevent thermal_zone_device_update() from being run during system suspend, when the devices it relies on may be inactive. Make it use the system freezable workqueue for this purpose.

---
 drivers/thermal/thermal_sys.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/thermal_sys.c +2 -2
Index: linux/drivers/thermal/thermal_sys.c
===================================================================
@@ -678,10 +678,10 @@ static void thermal_zone_device_set_poll
 		return;
 
 	if (delay > 1000)
-		schedule_delayed_work(&(tz->poll_queue),
+		queue_delayed_work(system_freezable_wq, &(tz->poll_queue),
 				      round_jiffies(msecs_to_jiffies(delay)));
 	else
-		schedule_delayed_work(&(tz->poll_queue),
+		queue_delayed_work(system_freezable_wq, &(tz->poll_queue),
 				      msecs_to_jiffies(delay));
 }
 
reviewer Applied
#1 lore raw

Applied.

thanks,
Len Brown, Intel Open Source Technology Center

#2 lore raw
In reply to Rafael J. Wysocki
Quoted 6 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

The thermal driver should use a freezable workqueue to schedule polling to prevent thermal_zone_device_update() from being run during system suspend, when the devices it relies on may be inactive. Make it use the system freezable workqueue for this purpose.

Umm. hibernation can take long time and (with latest compression patches) can be CPU intensive.

Is it good idea to disable thermal management?

Should we kick fans to full speed before starting hibernation?
Pavel

Quoted 12 lines
drivers/thermal/thermal_sys.c +2 -2
@@ -678,10 +678,10 @@ static void thermal_zone_device_set_poll
 		return;
 
 	if (delay > 1000)
-		schedule_delayed_work(&(tz->poll_queue),
+		queue_delayed_work(system_freezable_wq, &(tz->poll_queue),
 				      round_jiffies(msecs_to_jiffies(delay)));
 	else
-		schedule_delayed_work(&(tz->poll_queue),
+		queue_delayed_work(system_freezable_wq, &(tz->poll_queue),
 				      msecs_to_jiffies(delay));
 }
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html