]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit172c46ee06ba47dc7b5c7a08181f8bfdff71773c
tree30da8953dddf41f6322de63364f045a8ebeb068f
parent65c4a55eadd92b6a3cc30a9eb7c96042843ef346
media: i2c: ov5648: Fix lockdep error

[ Upstream commit 84c6095d28e62ce097da0ae6f994e833aef4012d ]

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