[media] Revert "[media] tw5864: remove double irq lock code"
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 5 Sep 2016 13:09:17 +0000 (10:09 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 6 Sep 2016 19:45:06 +0000 (16:45 -0300)
This reverts commit 617e901a12ad ("[media] tw5864: remove double irq lock code").

That commit was rejected by Andrey Utkin <andrey_utkin@fastmail.com>,
but it had already been merged. Revert and apply Andrey's corrected
patch next.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/tw5864/tw5864-core.c

index e3d884e963c09fd7977363efab7ba1b611f945ce..440cd7bb8d04d173c9c205ee555660801177b31a 100644 (file)
@@ -157,10 +157,12 @@ static void tw5864_h264_isr(struct tw5864_dev *dev)
 
                cur_frame = next_frame;
 
+               spin_lock_irqsave(&input->slock, flags);
                input->frame_seqno++;
                input->frame_gop_seqno++;
                if (input->frame_gop_seqno >= input->gop)
                        input->frame_gop_seqno = 0;
+               spin_unlock_irqrestore(&input->slock, flags);
        } else {
                dev_err(&dev->pci->dev,
                        "Skipped frame on input %d because all buffers busy\n",