thermal: Prevent polling from happening during system suspend
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 6 Nov 2011 13:21:38 +0000 (14:21 +0100)
committerLen Brown <len.brown@intel.com>
Mon, 7 Nov 2011 01:38:49 +0000 (20:38 -0500)
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.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/thermal/thermal_sys.c

index 708f8e92771a6d03c6ef3615571898da0cd1321e..dd9a5743fa991f3fb789d2e17d12563deaead0cd 100644 (file)
@@ -678,10 +678,10 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
                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));
 }