--- ../../alsa-kernel/core/seq/seq_memory.c	2007-12-20 10:19:32.000000000 +0100
+++ seq_memory.c	2007-12-20 10:52:18.000000000 +0100
@@ -1,3 +1,5 @@
+#define __NO_VERSION__
+#include "adriver.h"
 /*
  *  ALSA sequencer Memory Manager
  *  Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
@@ -31,6 +33,10 @@
 #include "seq_info.h"
 #include "seq_lock.h"
 
+/* semaphore in struct file record */
+#define semaphore_of(fp)	((fp)->f_dentry->d_inode->i_sem)
+
+
 static inline int snd_seq_pool_available(struct snd_seq_pool *pool)
 {
 	return pool->total_elements - atomic_read(&pool->counter);
@@ -242,7 +248,18 @@
 		set_current_state(TASK_INTERRUPTIBLE);
 		add_wait_queue(&pool->output_sleep, &wait);
 		spin_unlock_irq(&pool->lock);
+#ifdef LINUX_2_2
+		/* change semaphore to allow other clients
+		   to access device file */
+		if (file)
+			up(&semaphore_of(file));
+#endif
 		schedule();
+#ifdef LINUX_2_2
+		/* restore semaphore again */
+		if (file)
+			down(&semaphore_of(file));
+#endif
 		spin_lock_irq(&pool->lock);
 		remove_wait_queue(&pool->output_sleep, &wait);
 		/* interrupted? */
