android_kernel_xiaomi_sm7250/drivers/media/cec
Hans Verkuil 8c473068d2 media: cec-adap.c: fix is_configuring state
[ Upstream commit 59267fc34f4900dcd2ec3295f6be04b79aee2186 ]

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-14 16:59:16 +02:00
..
cec-adap.c media: cec-adap.c: fix is_configuring state 2022-06-14 16:59:16 +02:00
cec-api.c cec-api: prevent leaking memory through hole in structure 2020-09-03 11:24:21 +02:00
cec-core.c
cec-notifier.c media: cec-notifier: clear cec_adap in cec_notifier_unregister 2019-10-05 13:09:49 +02:00
cec-pin-error-inj.c
cec-pin-priv.h
cec-pin.c media: cec-gpio: select correct Signal Free Time 2019-11-24 08:20:25 +01:00
cec-priv.h
Kconfig
Makefile media: cec: remove cec-edid.c 2019-09-16 08:21:46 +02:00