linux/drivers/media
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 media: cec-pin.c: disabling the adapter cannot call kthread_stop 2022-05-13 11:27:19 +02:00
common media: videobuf2-dma-sg.c: kvmalloc_array -> kvcalloc 2022-05-13 11:02:22 +02:00
dvb-core media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
dvb-frontends media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
firewire media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00
i2c media: s5k6a3: add missing clk_disable_unprepare 2022-05-13 11:02:22 +02:00
mc media: mc: delete redundant code in __media_device_unregister_entity 2022-04-24 08:14:19 +01:00
mmc media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
pci media: cx25821: request_irq -> devm_request_irq 2022-05-13 11:02:22 +02:00
platform media: amphion: G/S_PARM only for encoder's output queue 2022-05-13 11:02:22 +02:00
radio media: make RADIO_ADAPTERS tristate 2022-05-13 11:02:19 +02:00
rc media: imon: reorganize serialization 2022-05-13 11:23:38 +02:00
spi media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
test-drivers media: vidtv: use vfree() for memory allocated with vzalloc() 2022-03-18 07:28:17 +01:00
tuners media: si2157: unknown chip version Si2147-A30 ROM 0x50 2022-04-09 17:45:49 +02:00
usb media: stkwebcam: move stk_camera_read_reg() scratch buffer to struct stk_camera 2022-05-13 11:02:20 +02:00
v4l2-core media: v4l2-ctls-core.c: kvmalloc_array -> kvcalloc 2022-05-13 11:02:22 +02:00
Kconfig media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00