diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2022-05-06 09:15:40 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-05-13 11:27:19 +0200 |
commit | 60965c6a1960988bcb5ad3b530ccd133af5cc85d (patch) | |
tree | 7a508d0238bc08a9537eecc79da4ad04d58c511e /mm/memblock.c | |
parent | db264d4c66c0fe007b5d19fd007707cd0697603d (diff) | |
download | linux-stable-60965c6a1960988bcb5ad3b530ccd133af5cc85d.tar.gz linux-stable-60965c6a1960988bcb5ad3b530ccd133af5cc85d.tar.bz2 linux-stable-60965c6a1960988bcb5ad3b530ccd133af5cc85d.zip |
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>
Diffstat (limited to 'mm/memblock.c')
0 files changed, 0 insertions, 0 deletions