[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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
Guennadi Liakhovetski 2012-04-18 06:43:09 -03:00 • committed by Mauro Carvalho Chehab
commit 2f9a0c880d
2 changed files with 8 additions and 3 deletions

View file

@ -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;