aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-04-18 06:43:09 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-04-26 11:30:12 -0300
commit2f9a0c880d5c1e159f647950a2eed26618ad2ff1 (patch)
tree99bc40ffdac05c88f97eb5e49afe01c2a85440a9 /include/media
parent[media] xc5000: support 32MHz & 31.875MHz xtal using the 41.024.5 firmware (diff)
downloadlinux-dev-2f9a0c880d5c1e159f647950a2eed26618ad2ff1.tar.xz
linux-dev-2f9a0c880d5c1e159f647950a2eed26618ad2ff1.zip
[media] V4L: soc-camera: protect hosts during probing from overzealous user-space
If multiple clients are registered on a single camera host interface, the user-space hot-plug software can try to access the one, that probed first, before probing of the second one has completed. This can be handled by individual host drivers, but it is even better to hold back the user-space until all the probing on this host has completed. This fixes a race on ecovec with two clients registered on the CEU1 host, which otherwise triggers a BUG() in sh_mobile_ceu_remove_device(). Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/soc_camera.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index b5c2b6cb0d81..cad374bdcf4b 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -59,7 +59,8 @@ struct soc_camera_device {
struct soc_camera_host {
struct v4l2_device v4l2_dev;
struct list_head list;
- unsigned char nr; /* Host number */
+ struct mutex host_lock; /* Protect during probing */
+ unsigned char nr; /* Host number */
void *priv;
const char *drv_name;
struct soc_camera_host_ops *ops;