]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MLK-10423: Capture: System hang if capture test app been killed
authorSandor Yu <R01008@freescale.com>
Sun, 15 Mar 2015 07:23:15 +0000 (15:23 +0800)
committerSandor Yu <R01008@freescale.com>
Mon, 16 Mar 2015 02:08:39 +0000 (10:08 +0800)
System will hang if csi unit test mx6s_v4l2_capture.out process
been killed.

In csi capture driver function mx6s_csi_enable/disable is called
by vidioc_streamon/streamoff function.
But when csi unit test process is killed, vidioc_streamon/streamoff
will not been called, and csi function still working even the csi
clock is gated.

Move mx6s_csi_enable/disable function from
mx6s_vidioc_streamon/streamoff function to
mx6s_start_streaming/ mx6s_stop_streaming function to resolve the
issue.

Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit fe3700b2dc97952ef5a055a48e1d5ba89e11b7dd)

drivers/media/platform/mxc/subdev/mx6s_capture.c

index 8cb1c1d14cf5dd0ba416a20de7d08973d0886e4a..ff7d01c2edef789159e7488fc3381dd643d52a1b 100644 (file)
@@ -816,6 +816,8 @@ static int mx6s_start_streaming(struct vb2_queue *vq, unsigned int count)
 
        spin_unlock_irqrestore(&csi_dev->slock, flags);
 
+       mx6s_csi_enable(csi_dev);
+
        return 0;
 }
 
@@ -826,6 +828,8 @@ static int mx6s_stop_streaming(struct vb2_queue *vq)
        struct mx6s_buffer *buf, *tmp;
        void *b;
 
+       mx6s_csi_disable(csi_dev);
+
        spin_lock_irqsave(&csi_dev->slock, flags);
 
 
@@ -1378,8 +1382,6 @@ static int mx6s_vidioc_streamon(struct file *file, void *priv,
 
        ret = vb2_streamon(&csi_dev->vb2_vidq, i);
 
-       mx6s_csi_enable(csi_dev);
-
        if (!ret)
                v4l2_subdev_call(sd, video, s_stream, 1);
 
@@ -1405,8 +1407,6 @@ static int mx6s_vidioc_streamoff(struct file *file, void *priv,
 
        v4l2_subdev_call(sd, video, s_stream, 0);
 
-       mx6s_csi_disable(csi_dev);
-
        return 0;
 }