1
0
Fork 0
alistair23-linux/drivers/media
Hans Verkuil 80d9e63714 media: cec: check 'transmit_in_progress', not 'transmitting'
commit ac479b51f3 upstream.

Currently wait_event_interruptible_timeout is called in cec_thread_func()
when adap->transmitting is set. But if the adapter is unconfigured
while transmitting, then adap->transmitting is set to NULL. But the
hardware is still actually transmitting the message, and that's
indicated by adap->transmit_in_progress and we should wait until that
is finished or times out before transmitting new messages.

As the original commit says: adap->transmitting is the userspace view,
adap->transmit_in_progress reflects the hardware state.

However, if adap->transmitting is NULL and adap->transmit_in_progress
is true, then wait_event_interruptible is called (no timeout), which
can get stuck indefinitely if the CEC driver is flaky and never marks
the transmit-in-progress as 'done'.

So test against transmit_in_progress when deciding whether to use
the timeout variant or not, instead of testing against adap->transmitting.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: 32804fcb61 ("media: cec: keep track of outstanding transmits")
Cc: <stable@vger.kernel.org>      # for v4.19 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-09 10:19:56 +01:00
..
cec media: cec: check 'transmit_in_progress', not 'transmitting' 2020-01-09 10:19:56 +01:00
common media: v4l2-tpg: add support for new pixelformats 2019-07-30 12:16:45 -04:00
dvb-core media: dvb-core: fix a memory leak bug 2019-08-21 18:39:54 -03:00
dvb-frontends media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
firewire media: firewire: Make structure fdtv_ca constant 2019-08-21 18:39:55 -03:00
i2c media: smiapp: Register sensor after enabling runtime PM on the device 2019-12-31 16:44:19 +01:00
mc Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
mmc treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pci media: cx88: Fix some error handling path in 'cx8800_initdev()' 2019-12-31 16:43:55 +01:00
platform media: vim2m: media_device_cleanup was called too early 2019-12-31 16:45:17 +01:00
radio media: si470x-i2c: add missed operations in remove 2019-12-31 16:45:13 +01:00
rc media: rc: mark input device as pointing stick 2019-12-13 08:42:45 +01:00
spi media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
tuners media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
usb media: pulse8-cec: fix lost cec_transmit_attempt_done() call 2020-01-09 10:19:56 +01:00
v4l2-core media: v4l2-ctrl: Lock main_hdl on operations of requests_queued. 2019-12-31 16:45:14 +01:00
Kconfig media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
Makefile media: move drivers/media/media-* to drivers/media/mc/mc-* 2019-05-28 12:15:46 -04:00