diff options
Diffstat (limited to 'linux/gamma_dma.c')
-rw-r--r-- | linux/gamma_dma.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/linux/gamma_dma.c b/linux/gamma_dma.c index 79433387..4ab67281 100644 --- a/linux/gamma_dma.c +++ b/linux/gamma_dma.c @@ -542,10 +542,9 @@ static int gamma_dma_send_buffers(drm_device_t *dev, drm_dma_t *d) if (d->flags & _DRM_DMA_BLOCK) { DRM_DEBUG("%d waiting\n", current->pid); - current->state = TASK_INTERRUPTIBLE; for (;;) { - if (!last_buf->waiting - && !last_buf->pending) + current->state = TASK_INTERRUPTIBLE; + if (!last_buf->waiting && !last_buf->pending) break; /* finished */ schedule(); if (signal_pending(current)) { @@ -778,6 +777,7 @@ int gamma_lock(struct inode *inode, struct file *filp, unsigned int cmd, } add_wait_queue(&dev->lock.lock_queue, &entry); for (;;) { + current->state = TASK_INTERRUPTIBLE; if (!dev->lock.hw_lock) { /* Device has been unregistered */ ret = -EINTR; @@ -794,7 +794,6 @@ int gamma_lock(struct inode *inode, struct file *filp, unsigned int cmd, /* Contention */ atomic_inc(&dev->total_sleeps); - current->state = TASK_INTERRUPTIBLE; schedule(); if (signal_pending(current)) { ret = -ERESTARTSYS; |