On Wed, Feb 09, 2005 at 08:13:13PM +0100, Bernhard Praschinger wrote: > Hallo > > > > > Please consider applying. > > > > > > > > Description: Remove deprecated interruptible_sleep_on_timeout() > > > > function calls > > > > and replace with direct wait-queue usage. Patch is compile-tested. > > > I have tested the patch and recorded for some time. Does not seem to > > > cause any problems on my machine. > > > > > > There are still 4 time the call to the interruptible_sleep_on_timeout() > > > function: > > > > grep interruptible_sleep_on_timeout *.c > > > zoran.c: timeout = > > > interruptible_sleep_on_timeout(&zr->jpg_capq, 10 * HZ); > > > zoran.c: timeout = interruptible_sleep_on_timeout(&zr->test_q, 1 > > > * HZ); > > > zoran_driver.c: if > > > (!interruptible_sleep_on_timeout(&zr->v4l_capq, 10 * HZ)) > > > zoran_driver.c: > > > interruptible_sleep_on_timeout(&zr->jpg_capq, 10 * H Z); > > > > > > Does it make sense changing them too ? > > > > Thanks for the testing! I believe all of those were changed in separate > > patches. I'll give them some time to get pushed upstream and if I still > > don't see the changes after a while, I'll push again :) > Only in the saa7110.c > > In zoran_device.c your first patch was replacing the > interruptible_sleep_on with wait_event_interruptible. > > And zoran_driver.c did only shop up because I only comented out the > parts, sorry.
I'm not sure if I understand you, but of the 4 calls you mention: 1) I don't have a file called zoran.c in my kernel tree under 2.6.11-rc3. Is this specific to the media/zoran tree? Once that's in mainline, I'll take care of it. 2) zoran_driver.c calls should be taken care of by "[PATCH 24/34] media/zoran_driver: replace interruptible_sleep_on_timeout() with wait_event_interruptible_timeout()," sent on Jan 25 to both the mjpeg list and kernel-janitors [1]. Are you seeing other calls that need to be replaced? Thanks, Nish [1] Patch attached for reference... --- 2.6.11-rc2-kj-v/drivers/media/video/zoran_driver.c 2005-01-24 09:34:08.000000000 -0800 +++ 2.6.11-rc2-kj/drivers/media/video/zoran_driver.c 2005-01-25 16:20:39.000000000 -0800 @@ -52,6 +52,7 @@ #include <linux/slab.h> #include <linux/pci.h> #include <linux/vmalloc.h> +#include <linux/wait.h> #include <linux/byteorder/generic.h> #include <linux/interrupt.h> @@ -918,12 +919,12 @@ v4l_sync (struct file *file, } /* wait on this buffer to get ready */ - while (zr->v4l_buffers.buffer[frame].state == BUZ_STATE_PEND) { - if (!interruptible_sleep_on_timeout(&zr->v4l_capq, 10 * HZ)) - return -ETIME; - else if (signal_pending(current)) - return -ERESTARTSYS; - } + if (!wait_event_interruptible_timeout(zr->v4l_capq, + (zr->v4l_buffers.buffer[frame].state != BUZ_STATE_PEND), + 10*HZ)) + return -ETIME; + if (signal_pending(current)) + return -ERESTARTSYS; /* buffer should now be in BUZ_STATE_DONE */ if (zr->v4l_buffers.buffer[frame].state != BUZ_STATE_DONE) @@ -1107,7 +1108,7 @@ jpg_sync (struct file *file, struct zoran_fh *fh = file->private_data; struct zoran *zr = fh->zr; unsigned long flags; - int frame, timeout; + int frame; if (fh->jpg_buffers.active == ZORAN_FREE) { dprintk(1, @@ -1124,29 +1125,26 @@ jpg_sync (struct file *file, ZR_DEVNAME(zr)); return -EINVAL; } - while (zr->jpg_que_tail == zr->jpg_dma_tail) { - if (zr->jpg_dma_tail == zr->jpg_dma_head) - break; - - timeout = - interruptible_sleep_on_timeout(&zr->jpg_capq, 10 * HZ); - if (!timeout) { - int isr; - - btand(~ZR36057_JMC_Go_en, ZR36057_JMC); - udelay(1); - zr->codec->control(zr->codec, CODEC_G_STATUS, + if (!wait_event_interruptible_timeout(zr->jpg_capq, + (zr->jpg_que_tail != zr->jpg_dma_tail || + zr->jpg_dma_tail == zr->jpg_dma_head), + 10*HZ)) { + int isr; + + btand(~ZR36057_JMC_Go_en, ZR36057_JMC); + udelay(1); + zr->codec->control(zr->codec, CODEC_G_STATUS, sizeof(isr), &isr); - dprintk(1, - KERN_ERR - "%s: jpg_sync() - timeout: codec isr=0x%02x\n", - ZR_DEVNAME(zr), isr); + dprintk(1, + KERN_ERR + "%s: jpg_sync() - timeout: codec isr=0x%02x\n", + ZR_DEVNAME(zr), isr); - return -ETIME; + return -ETIME; - } else if (signal_pending(current)) - return -ERESTARTSYS; } + if (signal_pending(current)) + return -ERESTARTSYS; spin_lock_irqsave(&zr->spinlock, flags); ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Mjpeg-users mailing list Mjpeg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mjpeg-users