All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH 13/20] sound/gus_pcm: remove
Date: Wed, 02 Feb 2005 19:50:13 +0000	[thread overview]
Message-ID: <20050202195013.GR2546@us.ibm.com> (raw)

[-- 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

             reply	other threads:[~2005-02-02 19:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-02 19:50 Nishanth Aravamudan [this message]
2005-02-04 15:33 ` [PATCH 13/20] sound/gus_pcm: remove interruptible_sleep_on_timeout() usage Takashi Iwai
2005-02-04 15:33 ` [KJ] Re: [Alsa-devel] [PATCH 13/20] sound/gus_pcm: remove Takashi Iwai
2005-02-04 17:02   ` Nishanth Aravamudan
2005-02-04 17:02   ` [PATCH 13/20] sound/gus_pcm: remove interruptible_sleep_on_timeout() usage Nishanth Aravamudan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050202195013.GR2546@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.