From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nishanth Aravamudan Date: Tue, 03 May 2005 21:40:26 +0000 Subject: Re: [KJ] [PATCH] i386/apm: use wait_event_interruptible_timeout() Message-Id: <20050503214026.GC3372@us.ibm.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============66498951528696582==" List-Id: References: <20050502061824.GC10173@us.ibm.com> In-Reply-To: <20050502061824.GC10173@us.ibm.com> To: kernel-janitors@vger.kernel.org --===============66498951528696582== Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 01.05.2005 [23:18:24 -0700], Nishanth Aravamudan wrote: > Use wait_event_interruptible_timeout() instead of custom wait-queue. > > > Signed-off-by: Nishanth Aravamudan > > --- 2.6.12-rc3/arch/i386/kernel/apm.c 2005-04-29 11:03:03.000000000 -0700 > +++ 2.6.12-rc3-dev/arch/i386/kernel/apm.c 2005-05-01 19:02:48.000000000 -0700 > @@ -224,6 +224,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -1418,22 +1419,15 @@ static void apm_event_handler(void) > > static void apm_mainloop(void) > { > - DECLARE_WAITQUEUE(wait, current); > - > - add_wait_queue(&apm_waitqueue, &wait); > - set_current_state(TASK_INTERRUPTIBLE); > - for (;;) { > - schedule_timeout(APM_CHECK_TIMEOUT); > - if (exit_kapmd) > - break; > + do { > + wait_event_interruptible_timeout(apm_waitqueue, > + exit_kapmd, APM_CHECK_TIMEOUT); Hmm, this will lead to some not so subtle breakage with wait-queues. Please do not apply. Thanks, Nish --===============66498951528696582== Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org http://lists.osdl.org/mailman/listinfo/kernel-janitors --===============66498951528696582==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nishanth Aravamudan Subject: Re: [KJ] [PATCH] i386/apm: use wait_event_interruptible_timeout() Date: Tue, 3 May 2005 14:40:26 -0700 Message-ID: <20050503214026.GC3372@us.ibm.com> References: <20050502061446.GB10173@us.ibm.com> <20050502061824.GC10173@us.ibm.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20050502061824.GC10173@us.ibm.com> Sender: linux-laptop-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: sfr@canb.auug.org.au Cc: Kernel-Janitors , linux-laptop@vger.kernel.org On 01.05.2005 [23:18:24 -0700], Nishanth Aravamudan wrote: > Use wait_event_interruptible_timeout() instead of custom wait-queue. > > > Signed-off-by: Nishanth Aravamudan > > --- 2.6.12-rc3/arch/i386/kernel/apm.c 2005-04-29 11:03:03.000000000 -0700 > +++ 2.6.12-rc3-dev/arch/i386/kernel/apm.c 2005-05-01 19:02:48.000000000 -0700 > @@ -224,6 +224,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -1418,22 +1419,15 @@ static void apm_event_handler(void) > > static void apm_mainloop(void) > { > - DECLARE_WAITQUEUE(wait, current); > - > - add_wait_queue(&apm_waitqueue, &wait); > - set_current_state(TASK_INTERRUPTIBLE); > - for (;;) { > - schedule_timeout(APM_CHECK_TIMEOUT); > - if (exit_kapmd) > - break; > + do { > + wait_event_interruptible_timeout(apm_waitqueue, > + exit_kapmd, APM_CHECK_TIMEOUT); Hmm, this will lead to some not so subtle breakage with wait-queues. Please do not apply. Thanks, Nish