]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
V4L/DVB (6269): V4L: Fix a "scheduling while atomic" bug in saa7134
authorMaxim Levitsky <maximlevitsky@gmail.com>
Thu, 27 Sep 2007 23:34:15 +0000 (20:34 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 03:02:58 +0000 (00:02 -0300)
set_tvnorm can sleep in saa7134_i2c_xfer
(it will be called through tuner code)
but code calls it under spinlock. Fix that

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/saa7134/saa7134-video.c

index cf40a9690a500a0d3f7317d67604b8b94f262a3f..27c659cd0f30db9eaf567aec19fd703960a2c939 100644 (file)
@@ -1834,7 +1834,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
                if (res_check(fh, RESOURCE_OVERLAY)) {
                        spin_lock_irqsave(&dev->slock,flags);
                        stop_preview(dev,fh);
+                       spin_unlock_irqrestore(&dev->slock, flags);
+
                        set_tvnorm(dev,&tvnorms[i]);
+
+                       spin_lock_irqsave(&dev->slock, flags);
                        start_preview(dev,fh);
                        spin_unlock_irqrestore(&dev->slock,flags);
                } else