[PATCH] windfarm: proper try_to_freeze / signal_pending handling

Johannes Berg johannes at sipsolutions.net
Fri Jun 23 20:05:44 EST 2006


This seems to work for me:
---
This patch makes windfarm handle signal_pending()/try_to_freeze()
better.

Signed-off-by: Johannes Berg <johannes at sipsolutions.net>

--- linux-2.6-git.orig/drivers/macintosh/windfarm_core.c	2006-06-22 16:41:18.182172154 +0200
+++ linux-2.6-git/drivers/macintosh/windfarm_core.c	2006-06-22 16:42:49.045354378 +0200
@@ -93,8 +93,6 @@ static int wf_thread_func(void *data)
 	DBG("wf: thread started\n");
 
 	while(!kthread_should_stop()) {
-		try_to_freeze();
-
 		if (time_after_eq(jiffies, next)) {
 			wf_notify(WF_EVENT_TICK, NULL);
 			if (wf_overtemp) {
@@ -117,8 +115,8 @@ static int wf_thread_func(void *data)
 		if (delay <= HZ)
 			schedule_timeout_interruptible(delay);
 
-		/* there should be no signal, but oh well */
-		if (signal_pending(current)) {
+		/* there should be no non-suspend signal, but oh well */
+		if (signal_pending(current) && !try_to_freeze()) {
 			printk(KERN_WARNING "windfarm: thread got sigl !\n");
 			break;
 		}





More information about the Linuxppc-dev mailing list