From alsa-devel-owner@alsa.jcu.cz  Mon Nov  9 00:39:02 1998
Received: from penguin.e-mind.com (penguin.e-mind.com [195.223.140.120])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id AAA25661
	for <alsa-devel@alsa.jcu.cz>; Mon, 9 Nov 1998 00:38:57 +0100
Received: from dragon.bogus (andrea@isdn46-imo.e-mind.com [195.223.140.56])
	by penguin.e-mind.com (8.9.1a/8.9.1/Debian/GNU) with ESMTP id BAA11709;
	Mon, 9 Nov 1998 01:38:16 +0100
Received: from localhost (andrea@localhost)
	by dragon.bogus (8.9.1a/8.9.1/Debian/GNU) with SMTP id AAA17329;
	Mon, 9 Nov 1998 00:06:18 +0100
Date: Mon, 9 Nov 1998 00:06:18 +0100 (CET)
From: Andrea Arcangeli <andrea@e-mind.com>
To: Michael Harnois <mharnois@willinet.net>
cc: ALSA devel <alsa-devel@alsa.jcu.cz>, Jaroslav Kysela <perex@jcu.cz>,
        Anders Semb Hermansen <ahermans@vf.telia.no>
Subject: Re: [Anders Semb Hermansen <ahermans@vf.telia.no>] Re: [patch] Compiling ALSA with 2.1.127
In-Reply-To: <87ogqhvrrz.fsf@mharnois.workgroup.net>
Message-ID: <Pine.LNX.3.96.981108235739.17146D-100000@dragon.bogus>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On 8 Nov 1998, Michael Harnois wrote:

>This patch was just posted to alsa-devel; does it look right to you?

The schedule_timeout() is misused:

diff -uNr alsa-driver.orig/lowlevel/gus/gus_reset.c alsa-driver/lowlevel/gus/gus_reset.c
--- alsa-driver.orig/lowlevel/gus/gus_reset.c	Sun Nov  8 13:02:03 1998
+++ alsa-driver/lowlevel/gus/gus_reset.c	Sun Nov  8 15:16:05 1998
@@ -224,7 +224,11 @@
 		}
 		time = jiffies + (HZ / 20);
 		while ((signed long) (time - jiffies) >= 0)
+#ifdef SND_NEW_SCHEDULER_TIMEOUT_INTERFACE
+			schedule_timeout(0);
+#else
 			schedule();
+#endif
 	}
 	snd_gf1_clear_voices(gus, v_min, v_max);
 }

The right implementation for what can I see above should be this (but I
can' t be completly sure because I don' t see the other code):

#ifdef SND_NEW_SCHEDULER_TIMEOUT_INTERFACE
		long timeout = (HZ+19)/20;
		do {
			current->state = TASK_INTERRUPTIBLE;
			timeout = schedule_timeout(timeout);
		while (timeout);
#else
		I don' t care ;->.
#endif

diff -uNr alsa-driver.orig/lowlevel/isa/ad1848.c alsa-driver/lowlevel/isa/ad1848.c
--- alsa-driver.orig/lowlevel/isa/ad1848.c	Sun Nov  8 13:02:09 1998
+++ alsa-driver/lowlevel/isa/ad1848.c	Sun Nov  8 15:18:05 1998
@@ -226,7 +226,11 @@
 			snd_printk("ad1848_mce_down - auto calibration time out (2)\n");
 			return;
 		}
+#ifdef SND_NEW_SCHEDULER_TIMEOUT_INTERFACE
+		schedule_timeout(0);
+#else
 		schedule();
+#endif
 		snd_spin_lock(codec, reg, &flags);
 	}
 #if 0


For this I don' t know (since I can' t see the other code), but I can
guess that the right implementation should probably be this:

	current->state = TASK_RUNNING;
	schedule();

The same for the other similar diff.

Andrea Arcangeli





