From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Berg Subject: [PATCH] windfarm: proper try_to_freeze / signal_pending handling Date: Fri, 23 Jun 2006 12:05:44 +0200 Message-ID: <1151057144.7608.14.camel@localhost> References: <1150847482.16662.13.camel@johannes> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1150847482.16662.13.camel@johannes> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org Errors-To: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org To: Benjamin Herrenschmidt Cc: linuxppc-dev list , linux-pm List-Id: linux-pm@vger.kernel.org This seems to work for me: --- This patch makes windfarm handle signal_pending()/try_to_freeze() better. Signed-off-by: Johannes Berg --- 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; }