kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ] [PATCH 30/39] sound/vx_core: replace schedule_timeout() with
@ 2005-01-21 19:47 Nishanth Aravamudan
  2005-01-24 14:10 ` [KJ] Re: [Alsa-devel] [PATCH 30/39] sound/vx_core: replace Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Aravamudan @ 2005-01-21 19:47 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

Hi,

Please consider applying.

Description: Use msleep() instead of schedule_timeout() to guarantee the task
delays as expected. The check for xmsec >= 1000 / HZ seems wrong to me, as well,
since if HZ==100, that means we could mdelay() for 9 msecs! msleep() should be
usable in all cases when not in an interrupt handler.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

--- 2.6.11-rc1-kj-v/sound/drivers/vx/vx_core.c	2005-01-15 16:55:45.000000000 -0800
+++ 2.6.11-rc1-kj/sound/drivers/vx/vx_core.c	2005-01-18 13:26:06.000000000 -0800
@@ -45,9 +45,8 @@ MODULE_LICENSE("GPL");
  */
 void snd_vx_delay(vx_core_t *chip, int xmsec)
 {
-	if (! in_interrupt() && xmsec >= 1000 / HZ) {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout((xmsec * HZ + 999) / 1000);
+	if (!in_interrupt()) {
+		msleep(xmsec);
 	} else {
 		mdelay(xmsec);
 	}

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] Re: [Alsa-devel] [PATCH 30/39] sound/vx_core: replace
  2005-01-21 19:47 [KJ] [PATCH 30/39] sound/vx_core: replace schedule_timeout() with Nishanth Aravamudan
@ 2005-01-24 14:10 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2005-01-24 14:10 UTC (permalink / raw)
  To: Nishanth Aravamudan; +Cc: perex, alsa-devel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

At Fri, 21 Jan 2005 11:47:31 -0800,
Nishanth Aravamudan wrote:
> 
> Hi,
> 
> Please consider applying.
> 
> Description: Use msleep() instead of schedule_timeout() to guarantee the task
> delays as expected. The check for xmsec >= 1000 / HZ seems wrong to me, as well,
> since if HZ==100, that means we could mdelay() for 9 msecs!

Yes, and that's intentional.  Originally there were places to call
like snd_vx_delay(1) for just 1 or 2 ms in a long loop.  The loop
calls schedule() occasionally to take control back.
So, we didn't want to do schedule_timeout(1) for HZ=100 in such a
case.  This results in 10 times longer loop execution.

>  msleep() should be
> usable in all cases when not in an interrupt handler.

I agree in general, but, msleep() isn't always a replacement of
mdelay() if the delay time really matters.


Takashi

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-01-24 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-21 19:47 [KJ] [PATCH 30/39] sound/vx_core: replace schedule_timeout() with Nishanth Aravamudan
2005-01-24 14:10 ` [KJ] Re: [Alsa-devel] [PATCH 30/39] sound/vx_core: replace Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).