[PATCH / 2.6.14] prevent dmesg warning in zr36067 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

attached patch fixes the warning "Debug: sleeping function called from
invalid context at include/asm/semaphore.h:102" that the zr36067 driver
emits every time an application using JPEG capture starts up (e.g.
mjpegtools' lavrec). The warning is harmless, but clogs up the dmesg
output. This was logged as bugzilla #5403. (Thanks to Christian Casteyde
for helping me in fixing this long-standing annoyance.)

Signed-off-by: Ronald S. Bultje <[email protected]>

Cheers,
Ronald
--- linux-2.6.14/drivers/media/video/zoran_driver.c.old	2005-10-29 20:36:24.000000000 -0400
+++ linux-2.6.14/drivers/media/video/zoran_driver.c	2005-10-29 20:36:48.000000000 -0400
@@ -996,8 +996,6 @@
 		return -EINVAL;
 	}
 
-	spin_lock_irqsave(&zr->spinlock, flags);
-
 	if (fh->jpg_buffers.active == ZORAN_FREE) {
 		if (zr->jpg_buffers.active == ZORAN_FREE) {
 			zr->jpg_buffers = fh->jpg_buffers;
@@ -1016,6 +1014,8 @@
 		zr36057_enable_jpg(zr, mode);
 	}
 
+	spin_lock_irqsave(&zr->spinlock, flags);
+
 	if (!res) {
 		switch (zr->jpg_buffers.buffer[num].state) {
 		case BUZ_STATE_DONE:

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux