]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
media: cec-adap.c: fix is_configuring state
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 6 May 2022 07:43:25 +0000 (09:43 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:49 +0000 (09:23 +0200)
commit9615a39aeb00ed55a96358d7715b4eabdf8be72d
tree9e571eb6b16066c28ef9b05ac282e426f4f7312b
parentbd0a41728e0aca50712f3e644c4471e7c23cbbd7
media: cec-adap.c: fix is_configuring state

BugLink: https://bugs.launchpad.net/bugs/1981864
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/media/cec/core/cec-adap.c