linux-stable/drivers/media/cec
Hans Verkuil 0794db7ca7 media: cec-adap.c: fix is_configuring state
[ Upstream commit 59267fc34f ]

If an adapter is trying to claim a free logical address then it is
in the 'is_configuring' state. If during that process the cable is
disconnected (HPD goes low, which in turn invalidates the physical
address), then cec_adap_unconfigure() is called, and that set the
is_configuring boolean to false, even though the thread that's
trying to claim an LA is still running.

Don't touch the is_configuring bool in cec_adap_unconfigure(), it
will eventually be cleared by the thread. By making that change
the cec_config_log_addr() function also had to change: it was
aborting if is_configuring became false (since that is what
cec_adap_unconfigure() did), but that no longer works. Instead
check if the physical address is invalid. That is a much
more appropriate check anyway.

This fixes a bug where the the adapter could be disabled even
though the device was still configuring. This could cause POLL
transmits to time out.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:25:27 +02:00
..
core media: cec-adap.c: fix is_configuring state 2022-06-09 10:25:27 +02:00
i2c media: cec: i2c: ch7322: Add ch7322 CEC controller driver 2020-07-04 12:16:18 +02:00
platform media: stm32-cec: Make use of the helper function devm_platform_ioremap_resource() 2021-09-30 10:07:52 +02:00
usb media: pulse8-cec: add support for FW v10 and up 2020-12-01 16:20:02 +01:00
Kconfig media: CEC: keep related menu entries together 2021-10-05 09:39:32 +02:00
Makefile media: cec: i2c: ch7322: Add ch7322 CEC controller driver 2020-07-04 12:16:18 +02:00