media: omap3isp: Acquire graph mutex for graph traversal
Acquire the graph_mutex for traversing the media graph. This seems to have been missing all the time. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
a1946caf02
commit
ba689d9333
1 changed files with 14 additions and 2 deletions
|
@ -691,6 +691,8 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
|
||||||
|
|
||||||
pipe->do_propagation = false;
|
pipe->do_propagation = false;
|
||||||
|
|
||||||
|
mutex_lock(&isp->media_dev.graph_mutex);
|
||||||
|
|
||||||
entity = &pipe->output->video.entity;
|
entity = &pipe->output->video.entity;
|
||||||
while (1) {
|
while (1) {
|
||||||
pad = &entity->pads[0];
|
pad = &entity->pads[0];
|
||||||
|
@ -705,8 +707,10 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
|
||||||
subdev = media_entity_to_v4l2_subdev(entity);
|
subdev = media_entity_to_v4l2_subdev(entity);
|
||||||
|
|
||||||
ret = v4l2_subdev_call(subdev, video, s_stream, mode);
|
ret = v4l2_subdev_call(subdev, video, s_stream, mode);
|
||||||
if (ret < 0 && ret != -ENOIOCTLCMD)
|
if (ret < 0 && ret != -ENOIOCTLCMD) {
|
||||||
|
mutex_unlock(&isp->media_dev.graph_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (subdev == &isp->isp_ccdc.subdev) {
|
if (subdev == &isp->isp_ccdc.subdev) {
|
||||||
v4l2_subdev_call(&isp->isp_aewb.subdev, video,
|
v4l2_subdev_call(&isp->isp_aewb.subdev, video,
|
||||||
|
@ -723,6 +727,8 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_unlock(&isp->media_dev.graph_mutex);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2028,6 +2034,8 @@ static int isp_subdev_notifier_complete(struct v4l2_async_notifier *async)
|
||||||
struct v4l2_subdev *sd;
|
struct v4l2_subdev *sd;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
mutex_lock(&isp->media_dev.graph_mutex);
|
||||||
|
|
||||||
ret = media_entity_enum_init(&isp->crashed, &isp->media_dev);
|
ret = media_entity_enum_init(&isp->crashed, &isp->media_dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2038,9 +2046,13 @@ static int isp_subdev_notifier_complete(struct v4l2_async_notifier *async)
|
||||||
|
|
||||||
ret = isp_link_entity(isp, &sd->entity,
|
ret = isp_link_entity(isp, &sd->entity,
|
||||||
v4l2_subdev_to_bus_cfg(sd)->interface);
|
v4l2_subdev_to_bus_cfg(sd)->interface);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
mutex_unlock(&isp->media_dev.graph_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mutex_unlock(&isp->media_dev.graph_mutex);
|
||||||
|
|
||||||
ret = v4l2_device_register_subdev_nodes(&isp->v4l2_dev);
|
ret = v4l2_device_register_subdev_nodes(&isp->v4l2_dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue