V4L/DVB (6291): Fix: avoid oops on some SMP machines
authorMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 8 Oct 2007 14:48:57 +0000 (11:48 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 03:03:14 +0000 (00:03 -0300)
This workaround fix a bug that happens on some SMP machines. On those machines,
videobuf_iolock is called too soon, before file .mmap handler. This patch calls
the scheduler before iolocking, allowing it to properly call the pending mmap.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/videobuf-core.c

index 8e4026e6fae3c62b2d16ae24ad5b7bbc8c772a3c..aa402abc4b0ced8f9cc3a5f6ddef1f4ac4edb11d 100644 (file)
@@ -94,6 +94,14 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
        MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
        MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
 
+       /* FIXME: This is required to avoid OOPS on some cases, since mmap_mapper()
+          method should be called before _iolock.
+          On some cases, the mmap_mapper() is called only after scheduling.
+
+          However, this way is just too dirty! Better to wait for some event.
+        */
+       schedule_timeout(HZ);
+
        return CALL(q,iolock,q,vb,fbuf);
 }
 
This page took 0.026355 seconds and 5 git commands to generate.