diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/drm/drm_lock.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/char/drm/drm_lock.c b/drivers/char/drm/drm_lock.c index b276ae8a6633..b48a595d54ec 100644 --- a/drivers/char/drm/drm_lock.c +++ b/drivers/char/drm/drm_lock.c | |||
@@ -104,6 +104,10 @@ int drm_lock(struct inode *inode, struct file *filp, | |||
104 | __set_current_state(TASK_RUNNING); | 104 | __set_current_state(TASK_RUNNING); |
105 | remove_wait_queue(&dev->lock.lock_queue, &entry); | 105 | remove_wait_queue(&dev->lock.lock_queue, &entry); |
106 | 106 | ||
107 | DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock"); | ||
108 | if (ret) | ||
109 | return ret; | ||
110 | |||
107 | sigemptyset(&dev->sigmask); | 111 | sigemptyset(&dev->sigmask); |
108 | sigaddset(&dev->sigmask, SIGSTOP); | 112 | sigaddset(&dev->sigmask, SIGSTOP); |
109 | sigaddset(&dev->sigmask, SIGTSTP); | 113 | sigaddset(&dev->sigmask, SIGTSTP); |
@@ -116,8 +120,12 @@ int drm_lock(struct inode *inode, struct file *filp, | |||
116 | if (dev->driver->dma_ready && (lock.flags & _DRM_LOCK_READY)) | 120 | if (dev->driver->dma_ready && (lock.flags & _DRM_LOCK_READY)) |
117 | dev->driver->dma_ready(dev); | 121 | dev->driver->dma_ready(dev); |
118 | 122 | ||
119 | if (dev->driver->dma_quiescent && (lock.flags & _DRM_LOCK_QUIESCENT)) | 123 | if (dev->driver->dma_quiescent && (lock.flags & _DRM_LOCK_QUIESCENT)) { |
120 | return dev->driver->dma_quiescent(dev); | 124 | if (dev->driver->dma_quiescent(dev)) { |
125 | DRM_DEBUG("%d waiting for DMA quiescent\n", lock.context); | ||
126 | return DRM_ERR(EBUSY); | ||
127 | } | ||
128 | } | ||
121 | 129 | ||
122 | /* dev->driver->kernel_context_switch isn't used by any of the x86 | 130 | /* dev->driver->kernel_context_switch isn't used by any of the x86 |
123 | * drivers but is used by the Sparc driver. | 131 | * drivers but is used by the Sparc driver. |
@@ -128,9 +136,7 @@ int drm_lock(struct inode *inode, struct file *filp, | |||
128 | dev->driver->kernel_context_switch(dev, dev->last_context, | 136 | dev->driver->kernel_context_switch(dev, dev->last_context, |
129 | lock.context); | 137 | lock.context); |
130 | } | 138 | } |
131 | DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock"); | 139 | return 0; |
132 | |||
133 | return ret; | ||
134 | } | 140 | } |
135 | 141 | ||
136 | /** | 142 | /** |