From cdef2e5f358db5fd27eec4c72eb295c232287813 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 2 Jan 2014 13:07:51 +0100 Subject: sound: oss: remove last sleep_on users There are three files in oss for which I could not find an easy way to replace interruptible_sleep_on_timeout with a non-racy version. This patch instead just adds a private implementation of the function, now named oss_broken_sleep_on, and changes over the remaining users in sound/oss/ so we can remove the global interface. [fixed coding style warnings by tiwai] Signed-off-by: Arnd Bergmann Signed-off-by: Takashi Iwai --- sound/oss/dmabuf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sound/oss/dmabuf.c') diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c index 461d94cfecbe..e3f29132d3ac 100644 --- a/sound/oss/dmabuf.c +++ b/sound/oss/dmabuf.c @@ -28,6 +28,7 @@ #include #include #include "sound_config.h" +#include "sleep.h" #define DMAP_FREE_ON_CLOSE 0 #define DMAP_KEEP_ON_CLOSE 1 @@ -351,8 +352,7 @@ static void dma_reset_output(int dev) if (!signal_pending(current) && adev->dmap_out->qlen && adev->dmap_out->underrun_count == 0){ spin_unlock_irqrestore(&dmap->lock,flags); - interruptible_sleep_on_timeout(&adev->out_sleeper, - dmabuf_timeout(dmap)); + oss_broken_sleep_on(&adev->out_sleeper, dmabuf_timeout(dmap)); spin_lock_irqsave(&dmap->lock,flags); } adev->dmap_out->flags &= ~(DMA_SYNCING | DMA_ACTIVE); @@ -446,7 +446,7 @@ int DMAbuf_sync(int dev) long t = dmabuf_timeout(dmap); spin_unlock_irqrestore(&dmap->lock,flags); /* FIXME: not safe may miss events */ - t = interruptible_sleep_on_timeout(&adev->out_sleeper, t); + t = oss_broken_sleep_on(&adev->out_sleeper, t); spin_lock_irqsave(&dmap->lock,flags); if (!t) { adev->dmap_out->flags &= ~DMA_SYNCING; @@ -466,7 +466,7 @@ int DMAbuf_sync(int dev) while (!signal_pending(current) && adev->d->local_qlen(dev)){ spin_unlock_irqrestore(&dmap->lock,flags); - interruptible_sleep_on_timeout(&adev->out_sleeper, + oss_broken_sleep_on(&adev->out_sleeper, dmabuf_timeout(dmap)); spin_lock_irqsave(&dmap->lock,flags); } @@ -587,8 +587,7 @@ int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock) timeout = dmabuf_timeout(dmap); spin_unlock_irqrestore(&dmap->lock,flags); - timeout = interruptible_sleep_on_timeout(&adev->in_sleeper, - timeout); + timeout = oss_broken_sleep_on(&adev->in_sleeper, timeout); if (!timeout) { /* FIXME: include device name */ err = -EIO; @@ -768,8 +767,7 @@ static int output_sleep(int dev, int dontblock) timeout_value = dmabuf_timeout(dmap); else timeout_value = MAX_SCHEDULE_TIMEOUT; - timeout_value = interruptible_sleep_on_timeout(&adev->out_sleeper, - timeout_value); + timeout_value = oss_broken_sleep_on(&adev->out_sleeper, timeout_value); if (timeout != MAX_SCHEDULE_TIMEOUT && !timeout_value) { printk(KERN_WARNING "Sound: DMA (output) timed out - IRQ/DRQ config error?\n"); dma_reset_output(dev); -- cgit v1.2.3