summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2021-03-12 10:05:44 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-04-06 14:35:14 +0200
commit4ebddb7c17c4549f04741c7faf8e4ced62391d20 (patch)
tree928c1a767c599fc03e08e0b641877ca3e8ab1353 /drivers/media
parentmedia: omap4iss: Acquire graph mutex for graph traversal (diff)
downloadlinux-4ebddb7c17c4549f04741c7faf8e4ced62391d20.tar.xz
linux-4ebddb7c17c4549f04741c7faf8e4ced62391d20.zip
media: entity: Add lockdep check to media graph walk
It was always assumed that walking the media graph would require holding the media_device graph_mutex but this was not documented nor checked for. Add a lockdep check to graph walk init and iter, and document the need for acquiring the graph_mutex. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/mc/mc-entity.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index 12b45e669bcc..678b99771cfa 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -340,6 +340,7 @@ static void media_graph_walk_iter(struct media_graph *graph)
stack_push(graph, next);
dev_dbg(entity->graph_obj.mdev->dev, "walk: pushing '%s' on stack\n",
next->name);
+ lockdep_assert_held(&entity->graph_obj.mdev->graph_mutex);
}
struct media_entity *media_graph_walk_next(struct media_graph *graph)