summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/vivi.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index 30f70c0a1..155c9a75a 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -492,11 +492,12 @@ static void vivi_thread_tick(struct vivi_dmaqueue *dma_q)
/* Fill buffer */
vivi_fillbuff(dev,buf);
- }
- if (list_empty(&dma_q->active)) {
- del_timer(&dma_q->timeout);
- } else {
- mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
+
+ if (list_empty(&dma_q->active)) {
+ del_timer(&dma_q->timeout);
+ } else {
+ mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
+ }
}
if (bc != 1)
dprintk(1,"%s: %d buffers handled (should be 1)\n",__FUNCTION__,bc);
@@ -568,6 +569,8 @@ static int vivi_thread(void *data)
#endif
dprintk(1,"thread started\n");
+ mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
+
for (;;) {
vivi_sleep(dma_q);
@@ -607,10 +610,18 @@ static int vivi_start_thread(struct vivi_dmaqueue *dma_q)
dma_q->kthread = NULL;
dma_q->notify = &sem;
- kernel_thread(vivi_thread, dma_q, 0);
+
+ if (kernel_thread(vivi_thread, dma_q, 0) < 0) {
+ printk (KERN_ERR "sdim: kernel_thread() failed\n");
+ return -EINVAL;
+ }
+
down(&sem);
dma_q->notify = NULL;
#endif
+ /* Wakes thread */
+ wake_up_interruptible(&dma_q->wq);
+
dprintk(1,"returning from %s\n",__FUNCTION__);
return 0;
}