All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH 13/20] sound/gus_pcm: remove
@ 2005-02-02 19:50 Nishanth Aravamudan
  2005-02-04 15:33 ` [KJ] Re: [Alsa-devel] " Takashi Iwai
  2005-02-04 15:33 ` [PATCH 13/20] sound/gus_pcm: remove interruptible_sleep_on_timeout() usage Takashi Iwai
  0 siblings, 2 replies; 5+ messages in thread
From: Nishanth Aravamudan @ 2005-02-02 19:50 UTC (permalink / raw)
  To: kernel-janitors

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

Hello,

Please consider applying.

Description: Replace deprecated interruptible_sleep_on_timeout() with
wait_event_timeout(). Code is not identical, as the current sleeping system is 1
jiffy at a time checking atomic_read()'s return every iteration. Patch is
compile-tested.

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

--- 2.6.11-rc2-kj-v/sound/isa/gus/gus_pcm.c	2005-01-26 11:19:06.000000000 -0800
+++ 2.6.11-rc2-kj/sound/isa/gus/gus_pcm.c	2005-02-02 11:34:20.000000000 -0800
@@ -697,16 +697,10 @@ static int snd_gf1_pcm_playback_close(sn
 	snd_gus_card_t *gus = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	gus_pcm_private_t *pcmp = runtime->private_data;
-	unsigned long jiffies_old;
+	
+	if (!wait_event_timeout(pcmp->sleep, (atomic_read(&pcmp->dma_count) <= 0), 2*HZ))
+		snd_printk("gf1 pcm - serious DMA problem\n");
 
-	jiffies_old = jiffies;
-	while (atomic_read(&pcmp->dma_count) > 0) {
-		interruptible_sleep_on_timeout(&pcmp->sleep, 1);
-		if ((signed long)(jiffies - jiffies_old) > 2*HZ) {
-			snd_printk("gf1 pcm - serious DMA problem\n");
-			break;
-		}
-	}
 	snd_gf1_dma_done(gus);	
 	return 0;
 }

[-- 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] 5+ messages in thread

end of thread, other threads:[~2005-02-04 17:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-02 19:50 [KJ] [PATCH 13/20] sound/gus_pcm: remove Nishanth Aravamudan
2005-02-04 15:33 ` [KJ] Re: [Alsa-devel] " Takashi Iwai
2005-02-04 17:02   ` [PATCH 13/20] sound/gus_pcm: remove interruptible_sleep_on_timeout() usage Nishanth Aravamudan
2005-02-04 17:02   ` [KJ] Re: [Alsa-devel] [PATCH 13/20] sound/gus_pcm: remove Nishanth Aravamudan
2005-02-04 15:33 ` [PATCH 13/20] sound/gus_pcm: remove interruptible_sleep_on_timeout() usage Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.