public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Resend 2x] thermal: Prevent polling from happening during system suspend
@ 2011-11-06 13:21 Rafael J. Wysocki
  2011-11-07  1:39 ` Len Brown
  2012-02-17 19:29 ` Pavel Machek
  0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2011-11-06 13:21 UTC (permalink / raw)
  To: Len Brown; +Cc: Len Brown (Intel), LKML, ACPI Devel Mailing List, Linux PM list

From: Rafael J. Wysocki <rjw@sisk.pl>

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>
---
 drivers/thermal/thermal_sys.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux/drivers/thermal/thermal_sys.c
===================================================================
--- linux.orig/drivers/thermal/thermal_sys.c
+++ 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));
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Resend 2x] thermal: Prevent polling from happening during system suspend
  2011-11-06 13:21 [Resend 2x] thermal: Prevent polling from happening during system suspend Rafael J. Wysocki
@ 2011-11-07  1:39 ` Len Brown
  2012-02-17 19:29 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Len Brown @ 2011-11-07  1:39 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: LKML, ACPI Devel Mailing List, Linux PM list

Applied.

thanks,
Len Brown, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Resend 2x] thermal: Prevent polling from happening during system suspend
  2011-11-06 13:21 [Resend 2x] thermal: Prevent polling from happening during system suspend Rafael J. Wysocki
  2011-11-07  1:39 ` Len Brown
@ 2012-02-17 19:29 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2012-02-17 19:29 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Len Brown, Len Brown (Intel), LKML, ACPI Devel Mailing List,
	Linux PM list

On Sun 2011-11-06 14:21:38, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> 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

> @@ -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));
>  }

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-17 19:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-06 13:21 [Resend 2x] thermal: Prevent polling from happening during system suspend Rafael J. Wysocki
2011-11-07  1:39 ` Len Brown
2012-02-17 19:29 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox