media: i2c: ov5648: Fix lockdep error
authorHans de Goede <hdegoede@redhat.com>
Thu, 3 Feb 2022 12:33:12 +0000 (13:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:24:02 +0000 (14:24 +0200)
commit96a7522c72c46f90b2866aa5953ef11b18f9b2fd
tree30da8953dddf41f6322de63364f045a8ebeb068f
parenteae90015d10f0c9a47fc4adccba4cd79dce664e4
media: i2c: ov5648: Fix lockdep error

[ Upstream commit d4cb5d3c4cee28aa89b02bc33d930a6cf75e7f79 ]

ov5648_state_init() calls ov5648_state_mipi_configure() which uses
__v4l2_ctrl_s_ctrl[_int64](). This means that sensor->mutex (which
is also sensor->ctrls.handler.lock) must be locked before calling
ov5648_state_init().

ov5648_state_mipi_configure() is also used in other places where
the lock is already held so it cannot be changed itself.

Note this is based on an identical (tested) fix for the ov8865 driver,
this has only been compile-tested.

Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ov5648.c