]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: tc358746: fix locking issue
authorMatthias Fend <matthias.fend@emfend.at>
Tue, 21 Jan 2025 09:56:55 +0000 (10:56 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 25 Feb 2025 08:07:25 +0000 (09:07 +0100)
commit7d8fa0ee43e57c629de2c13f23397f0c394655e9
treedb1b56feb3af579d3341bcd29c1c66346c1e6965
parent78d7265e2e1ce349e7f3c6a085f2b66d7b73f4ca
media: tc358746: fix locking issue

In tc358746_link_validate() an attempt is made to get the state lock of the
subdev, but since this is already held by the calling function
v4l2_subdev_link_validate(), this leads to a deadlock.
Another problem is that this function queries the link frequency of the
source device. Since some image sensors use the lock of the v4l2 control
handler as a state lock, which is already held at this point, a deadlock
can also occur here.
Move the calculation of the FIFO size from tc358746_link_validate() to
tc358746_apply_misc_config() to avoid the deadlocks mentioned.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/tc358746.c