]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] Fix Oops with ALSA timer event notification
authortiwai@suse.de <tiwai@suse.de>
Thu, 7 Apr 2005 18:15:10 +0000 (11:15 -0700)
committerGreg KH <gregkh@suse.de>
Thu, 12 May 2005 17:00:18 +0000 (10:00 -0700)
the patch below fixes the bug of ALSA timer notification, which is
used in the recent ALSA dmix plugin.

 - fixed Oops in read()
 - fixed wake-up polls and signals with new events

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/core/timer.c

index f5ef7f5be53ae2ebaad6c42399e82e3426a3cee7..67baf1ecc3437cd8f0703c0a73bb2e2f4c3046ad 100644 (file)
@@ -1117,7 +1117,8 @@ static void snd_timer_user_append_to_tqueue(snd_timer_user_t *tu, snd_timer_trea
        if (tu->qused >= tu->queue_size) {
                tu->overrun++;
        } else {
-               memcpy(&tu->queue[tu->qtail++], tread, sizeof(*tread));
+               memcpy(&tu->tqueue[tu->qtail++], tread, sizeof(*tread));
+               tu->qtail %= tu->queue_size;
                tu->qused++;
        }
 }
@@ -1140,6 +1141,8 @@ static void snd_timer_user_ccallback(snd_timer_instance_t *timeri,
        spin_lock(&tu->qlock);
        snd_timer_user_append_to_tqueue(tu, &r1);
        spin_unlock(&tu->qlock);
+       kill_fasync(&tu->fasync, SIGIO, POLL_IN);
+       wake_up(&tu->qchange_sleep);
 }
 
 static void snd_timer_user_tinterrupt(snd_timer_instance_t *timeri,