diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-04-18 05:43:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-26 10:30:12 -0400 |
commit | 2f9a0c880d5c1e159f647950a2eed26618ad2ff1 (patch) | |
tree | 99bc40ffdac05c88f97eb5e49afe01c2a85440a9 /include | |
parent | e631f578048e2afd8bfede2e9dc86aa4592def3a (diff) |
[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')
-rw-r--r-- | include/media/soc_camera.h | 3 |
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 { | |||
59 | struct soc_camera_host { | 59 | struct soc_camera_host { |
60 | struct v4l2_device v4l2_dev; | 60 | struct v4l2_device v4l2_dev; |
61 | struct list_head list; | 61 | struct list_head list; |
62 | unsigned char nr; /* Host number */ | 62 | struct mutex host_lock; /* Protect during probing */ |
63 | unsigned char nr; /* Host number */ | ||
63 | void *priv; | 64 | void *priv; |
64 | const char *drv_name; | 65 | const char *drv_name; |
65 | struct soc_camera_host_ops *ops; | 66 | struct soc_camera_host_ops *ops; |