brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0133-V4L2-Fix-issue-of-driver-jamming-if-STREAMON-failed.patch
1 From 3e5851305b45a4dac66bd49529e511d1334a08fc Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Mon, 9 Dec 2013 11:05:24 +0000
4 Subject: [PATCH 133/196] V4L2: Fix issue of driver jamming if STREAMON failed.
5
6 Fix issue where the driver was left in a partially enabled
7 state if STREAMON failed, and would then reject many IOCTLs
8 as it thought it was streaming.
9
10 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
11 ---
12 drivers/media/platform/bcm2835/bcm2835-camera.c | 10 +++++++++-
13 1 file changed, 9 insertions(+), 1 deletion(-)
14
15 diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c
16 index 47fe45d..2743074 100644
17 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
18 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
19 @@ -425,7 +425,15 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
20 vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb);
21 if (ret) {
22 v4l2_err(&dev->v4l2_dev,
23 - "Failed to enable capture port - error %d\n", ret);
24 + "Failed to enable capture port - error %d. "
25 + "Disabling camera port again\n", ret);
26 +
27 + vchiq_mmal_port_disable(dev->instance,
28 + dev->capture.camera_port);
29 + if (disable_camera(dev) < 0) {
30 + v4l2_err(&dev->v4l2_dev, "Failed to disable camera");
31 + return -EINVAL;
32 + }
33 return -1;
34 }
35
36 --
37 1.9.1
38