Commit 5bf2c8b6 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: omap4iss: 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: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent ba689d93
......@@ -456,6 +456,8 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
pipe->do_propagation = false;
mutex_lock(&iss->media_dev.graph_mutex);
entity = &pipe->output->video.entity;
while (1) {
pad = &entity->pads[0];
......@@ -472,6 +474,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
ret = v4l2_subdev_call(subdev, video, s_stream, mode);
if (ret < 0 && ret != -ENOIOCTLCMD) {
iss_pipeline_disable(pipe, entity);
mutex_unlock(&iss->media_dev.graph_mutex);
return ret;
}
......@@ -480,7 +483,9 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
pipe->do_propagation = true;
}
mutex_unlock(&iss->media_dev.graph_mutex);
iss_print_status(pipe->output->iss);
return 0;
}
......
......@@ -854,6 +854,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
struct iss_video *video = video_drvdata(file);
struct media_graph graph;
struct media_entity *entity = &video->video.entity;
struct media_device *mdev = entity->graph_obj.mdev;
enum iss_pipeline_state state;
struct iss_pipeline *pipe;
struct iss_video *far_end;
......@@ -890,9 +891,11 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
if (ret < 0)
goto err_media_pipeline_start;
mutex_lock(&mdev->graph_mutex);
media_graph_walk_start(&graph, entity);
while ((entity = media_graph_walk_next(&graph)))
media_entity_enum_set(&pipe->ent_enum, entity);
mutex_unlock(&mdev->graph_mutex);
/*
* Verify that the currently configured format matches the output of
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment