patch-2.2.6 linux/drivers/sound/dmabuf.c

Next file: linux/drivers/sound/es1370.c
Previous file: linux/drivers/sound/dev_table.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.5/linux/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c
@@ -935,6 +935,7 @@
 	if (dmap->audio_callback != NULL)
 		dmap->audio_callback(dev, dmap->callback_parm);
 	wake_up(&adev->out_sleeper);
+	wake_up(&adev->poll_sleeper);
 }
 
 static void do_outputintr(int dev, int dummy)
@@ -1103,7 +1104,10 @@
 	}
 	dmap->flags |= DMA_ACTIVE;
 	if (dmap->qlen > 0)
+	{
 		wake_up(&adev->in_sleeper);
+		wake_up(&adev->poll_sleeper);
+	}
 }
 
 void DMAbuf_inputintr(int dev)
@@ -1217,7 +1221,6 @@
 	if (!(adev->open_mode & OPEN_READ))
 		return 0;
 	if (dmap->mapping_flags & DMA_MAP_MAPPED) {
-		poll_wait(file, &adev->in_sleeper, wait);
 		if (dmap->qlen)
 			return POLLIN | POLLRDNORM;
 		return 0;
@@ -1228,7 +1231,6 @@
 		    !dmap->qlen && adev->go) {
 			unsigned long flags;
 			
-			poll_wait(file, &adev->in_sleeper, wait);
 			save_flags(flags);
 			cli();
 			DMAbuf_activate_recording(dev, dmap);
@@ -1236,7 +1238,6 @@
 		}
 		return 0;
 	}
-	poll_wait(file, &adev->in_sleeper, wait);
 	if (!dmap->qlen)
 		return 0;
 	return POLLIN | POLLRDNORM;
@@ -1250,14 +1251,12 @@
 	if (!(adev->open_mode & OPEN_WRITE))
 		return 0;
 	if (dmap->mapping_flags & DMA_MAP_MAPPED) {
-		poll_wait(file, &adev->out_sleeper, wait);
 		if (dmap->qlen)
 			return POLLOUT | POLLWRNORM;
 		return 0;
 	}
 	if (dmap->dma_mode == DMODE_INPUT)
 		return 0;
-	poll_wait(file, &adev->out_sleeper, wait);
 	if (dmap->dma_mode == DMODE_NONE)
 		return POLLOUT | POLLWRNORM;
 	if (!DMAbuf_space_in_queue(dev))
@@ -1267,6 +1266,8 @@
 
 unsigned int DMAbuf_poll(struct file * file, int dev, poll_table *wait)
 {
+	struct audio_operations *adev = audio_devs[dev];
+	poll_wait(file, &adev->poll_sleeper, wait);
 	return poll_input(file, dev, wait) | poll_output(file, dev, wait);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)