From 4ebddb7c17c4549f04741c7faf8e4ced62391d20 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Fri, 12 Mar 2021 10:05:44 +0100 Subject: 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 Signed-off-by: Mauro Carvalho Chehab --- include/media/media-entity.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/media/media-entity.h') diff --git a/include/media/media-entity.h b/include/media/media-entity.h index a90e2bf6baf7..09737b47881f 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -885,6 +885,11 @@ int media_entity_get_fwnode_pad(struct media_entity *entity, * * @graph: Media graph structure that will be used to walk the graph * @mdev: Pointer to the &media_device that contains the object + * + * The caller is required to hold the media_device graph_mutex during the graph + * walk until the graph state is released. + * + * Returns zero on success or a negative error code otherwise. */ __must_check int media_graph_walk_init( struct media_graph *graph, struct media_device *mdev); -- cgit v1.2.3