diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2021-03-19 19:31:08 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-04-06 15:34:38 +0300 |
commit | 5bf2c8b66e4eb47f16ce41b936be699d07256b76 (patch) | |
tree | 8a3330155b3ac2a10d7c3c7d7eace120ca87ae1b /drivers/staging/media/omap4iss | |
parent | ba689d93336161f195258ccf9333f0e51ce6e85f (diff) | |
download | linux-5bf2c8b66e4eb47f16ce41b936be699d07256b76.tar.xz |
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: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/omap4iss')
-rw-r--r-- | drivers/staging/media/omap4iss/iss.c | 5 | ||||
-rw-r--r-- | drivers/staging/media/omap4iss/iss_video.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c index 085397045b36..ac8a96be3e30 100644 --- a/drivers/staging/media/omap4iss/iss.c +++ b/drivers/staging/media/omap4iss/iss.c @@ -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; } diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c index 66975a37dc85..930f638f51eb 100644 --- a/drivers/staging/media/omap4iss/iss_video.c +++ b/drivers/staging/media/omap4iss/iss_video.c @@ -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 |