linux/drivers/media/cec/core
Hans Verkuil 60965c6a19 media: cec-pin.c: disabling the adapter cannot call kthread_stop
When the adap_enable callback is called the adap->lock is held.
When disabling the adapter it attempts to stop the kthread that
deals with receiving and transmitting messages. However, kthread_stop
waits for the thread to stop, so all that time adap->lock is held.

Unfortunately, the kernel thread itself can call functions that take
that same lock, so a deadlock can occur.

Change the logic to keep the kernel thread running and instead when
disabling the adapter, just set the pin to high, go to idle and then
to state OFF and disable the interrupt. Only stop the kernel thread
when the adapter is deleted.

This way disabling the adapter will not wait for anything and the
deadlock is avoided.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-05-13 11:27:19 +02:00
..
cec-adap.c media: cec: add optional adap_configured callback 2022-04-24 07:41:35 +01:00
cec-api.c media: cec: use call_op and check for !unregistered 2022-04-24 07:40:42 +01:00
cec-core.c media: cec: add xfer_timeout_ms field 2022-04-24 07:41:06 +01:00
cec-notifier.c media: cec/core/cec-notifier: use IS_REACHABLE(CONFIG_I2C) 2021-03-22 10:24:44 +01:00
cec-pin-error-inj.c media: cec/core: clarify rx-arb-lost usage message 2021-04-06 16:08:38 +02:00
cec-pin-priv.h media: cec: use call_op and check for !unregistered 2022-04-24 07:40:42 +01:00
cec-pin.c media: cec-pin.c: disabling the adapter cannot call kthread_stop 2022-05-13 11:27:19 +02:00
cec-priv.h media: cec: use call_op and check for !unregistered 2022-04-24 07:40:42 +01:00
Makefile