Re: [PATCH 4/4] alsa-driver: schedule_timeout() fixes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/18/2007 06:44 PM, Takashi Iwai wrote:

Speaking about that msnd one -- I believe I've seen that driver sitting in isa/ in alsa-drivers ages ago already. Is someone still working on that? (no, I don't have the hardware).

Signed-off-by: Rene Herman <rene.herman@xxxxxxxxx>

Got a compiler error.

alsa-driver/isa/msnd/msnd_pinnacle.c: In function ‘snd_msnd_calibrate_adc’:
alsa-driver/isa/msnd/msnd_pinnacle.c:692: error: implicit declaration of function ‘msecs_to_jiffiies’

What an amazingly perfect example of the problem with noisy builds ;-/

For me, it's a warning, buried just above a string of other warnings:

  CC [M]  /home/rene/src/alsa/alsa-driver/isa/msnd/msnd.o
  CC [M]  /home/rene/src/alsa/alsa-driver/isa/msnd/msnd_pinnacle.o
/home/rene/src/alsa/alsa-driver/isa/msnd/msnd_pinnacle.c: In function 'snd_msnd_calibrate_adc': /home/rene/src/alsa/alsa-driver/isa/msnd/msnd_pinnacle.c:692: warning: implicit declaration of function 'msecs_to_jiffiies'
include/asm/io.h: In function 'memcpy_toio':
include/asm/io.h:208: warning: passing argument 1 of '__memcpy' discards qualifiers from pointer target type
include/asm/io.h: In function 'memset_io':
include/asm/io.h:200: warning: passing argument 1 of '__constant_c_and_count_memset' discards qualifiers from pointer target type include/asm/io.h:200: warning: passing argument 1 of '__constant_c_memset' discards qualifiers from pointer target type include/asm/io.h:200: warning: passing argument 1 of '__memset_generic' discards qualifiers from pointer target type include/asm/io.h:200: warning: passing argument 1 of '__memset_generic' discards qualifiers from pointer target type
  CC [M]  /home/rene/src/alsa/alsa-driver/isa/msnd/msnd_pinnacle_mixer.o
  CC [M]  /home/rene/src/alsa/alsa-driver/isa/msnd/msnd_midi.o
  LD [M]  /home/rene/src/alsa/alsa-driver/isa/msnd/snd-msnd-pinnacle.o
  CC [M]  /home/rene/src/alsa/alsa-driver/isa/opti9xx/miro.o

(and I'm still getting used to this mercurial environment and just building everything with ./hgcompile meaning it's a lot of output).

Anyways, s/jiffiies/jiffies/ and sorry for not noticing. Updated patch attached. Changelog:

===
alsa-driver: use schedule_timeout_{,un}interruptible.

Replace 3 open-coded implementations of schedule_timout_{,un}interruptible and use {u,m}secs_to_jiffies.

Signed-off-by: Rene Herman <rene.herman@xxxxxxxxx>
===

Rene.
diff -r 3fefacd5d76c isa/msnd/msnd_pinnacle.c
--- a/isa/msnd/msnd_pinnacle.c	Mon Sep 17 19:04:40 2007 +0200
+++ b/isa/msnd/msnd_pinnacle.c	Tue Sep 18 18:51:39 2007 +0200
@@ -239,10 +239,8 @@ static void dsp_write_flush(void)
 		&dev.writeflush,
 		get_play_delay_jiffies(dev.DAPF.len));*/
 	clear_bit(F_WRITEFLUSH, &dev.flags);
-	if (!signal_pending(current)) {
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(get_play_delay_jiffies( dev.play_period_bytes));
-	}
+	if (!signal_pending(current)) 
+		schedule_timeout_interruptible(get_play_delay_jiffies(dev.play_period_bytes));
 	clear_bit(F_WRITING, &dev.flags);
 }
 
@@ -691,8 +689,7 @@ static int __init snd_msnd_calibrate_adc
 		       & ~0x0001, dev.SMA + SMA_wCurrHostStatusFlags);
 	if (snd_msnd_send_word(&dev, 0, 0, HDEXAR_CAL_A_TO_D) == 0 &&
 	    snd_msnd_send_dsp_cmd_chk(&dev, HDEX_AUX_REQ) == 0) {
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(HZ / 3);
+		schedule_timeout_interruptible(msecs_to_jiffies(333));
 		return 0;
 	}
 	printk(KERN_WARNING LOGNAME ": ADC calibration failed\n");
diff -r 3fefacd5d76c pci/asihpi/hpios_linux_kernel.c
--- a/pci/asihpi/hpios_linux_kernel.c	Mon Sep 17 19:04:40 2007 +0200
+++ b/pci/asihpi/hpios_linux_kernel.c	Tue Sep 18 18:51:39 2007 +0200
@@ -38,8 +38,7 @@ and the task receives a signal.
 and the task receives a signal.
 Setting the state to UNINTERRUPTIBLE stops it from returning early.
 */
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout((HZ * dwNumMicroSec + (HZ - 1)) / 1000000);
+		schedule_timeout_uninterruptible(usecs_to_jiffies(dwNumMicroSec));
 	} else if (dwNumMicroSec <= 2000)
 		udelay(dwNumMicroSec);
 	else
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux