Skip to contentSkip to conversation

sound/emu8000: replace schedule_timeout() with msleep()

PATCH In review [email protected] 2 participants 3 messages Mar 5, 2005 – Mar 9, 2005 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/emu8000: replace schedule_timeout() with msleep()

Use ssleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code uses TASK_INTERRUPTIBLE, but does not check for signals / early return, so ssleep() should be appropriate. I am fairly certain the time conversion is ok, as well.

---

 kj-domen/sound/isa/sb/emu8000.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/isa/sb/emu8000.c renamed from sound/isa/sb/emu8000.c~ssleep-sound_isa_sb_emu8000 +2 -2
diff -puN sound/isa/sb/emu8000.c~ssleep-sound_isa_sb_emu8000 sound/isa/sb/emu8000.c
@@ -25,6 +25,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
+#include <linux/delay.h>
 #include <sound/core.h>
 #include <sound/emu8000.h>
 #include <sound/emu8000_reg.h>
@@ -355,8 +356,7 @@ init_arrays(emu8000_t *emu)
 {
 	send_array(emu, init1, ARRAY_SIZE(init1)/4);
 
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout((HZ * (44099 + 1024)) / 44100); /* wait for 1024 clocks */
+	msleep(1024 * 1000 / 44100); /* wait for 1024 clocks */
 	send_array(emu, init2, ARRAY_SIZE(init2)/4);
 	send_array(emu, init3, ARRAY_SIZE(init3)/4);
 

_

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#1 lore raw

At Sat, 05 Mar 2005 16:37:03 +0100,

Quoted 9 lines · [email protected] wrote:

Use ssleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code uses TASK_INTERRUPTIBLE, but does not check for signals / early return, so ssleep() should be appropriate. I am fairly certain the time conversion is ok, as well.

This was already in ALSA tree (i.e. mm tree should include it).

Takashi

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#2 lore raw
Quoted 9 lines · Takashi Iwai

At Sat, 05 Mar 2005 16:37:03 +0100,

Quoted 7 lines · [email protected] wrote:

Use ssleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code uses TASK_INTERRUPTIBLE, but does not check for signals / early return, so ssleep() should be appropriate. I am fairly certain the time conversion is ok, as well.

Quoted 4 lines
Quoted 2 lines

This was already in ALSA tree (i.e. mm tree should include it).

A bit different, so it confuzed scripts :-)

Thanks, Takashi.

Quoted 3 lines

Takashi

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click