From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 62E96DDEFD for ; Wed, 24 Jan 2007 17:32:31 +1100 (EST) Subject: Re: [PATCH 1/3] windfarm: dont die on suspend thread signal From: Benjamin Herrenschmidt To: Johannes Berg In-Reply-To: <20061213123944.747406000@sipsolutions.net>> References: <20061213123819.403286000@sipsolutions.net> > <20061213123944.747406000@sipsolutions.net>> Content-Type: text/plain Date: Wed, 24 Jan 2007 17:32:24 +1100 Message-Id: <1169620344.18754.64.camel@localhost.localdomain> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2006-12-13 at 13:38 +0100, Johannes Berg wrote: > plain text document attachment (windfarm-dont-die-on-signals.patch) > When the windfarm thread gets a suspend signal it will die instead of > freezing. This fixes it. > > Signed-off-by: Johannes Berg Acked-by: Benjamin Herrenschmidt > --- linux-2.6-git.orig/drivers/macintosh/windfarm_core.c 2006-12-11 23:34:47.082716759 +0100 > +++ linux-2.6-git/drivers/macintosh/windfarm_core.c 2006-12-11 23:37:58.181716759 +0100 > @@ -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; > } > > --