kernel-hacking-2024-linux-s.../drivers/media
Oleg Nesterov 1e4597e8f0 V4L/DVB (5818): CinergyT2: fix flush_workqueue() vs work->func() deadlock
Spotted and tested by Thomas Sattler <tsattler@gmx.de>.

cinergyT2.c does cancel_delayed_work() + flush_scheduled_work() while
holding cinergyt2->sem. This leads to deadlock because work->func()
needs the same mutex to complete. Another bug is that this code in fact
can't reliably stop the re-arming delayed_work.

Convert this code to use cancel_rearming_delayed_work() and move it
out of ->sem. Another mutex, ->wq_sem, was added to protect against the
concurrent open/resume.

This patch is a horrible hack to fix the lockup which happens in practice.
As Dmitry Torokhov pointed out this driver has other problems and needs
further changes.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-03 15:11:19 -03:00
..
common V4L/DVB (5702): Fix Kconfig items to avoid linkedition errors 2007-06-08 08:21:12 -03:00
dvb V4L/DVB (5818): CinergyT2: fix flush_workqueue() vs work->func() deadlock 2007-07-03 15:11:19 -03:00
radio Fix Kconfig dependency problems wrt boolean menuconfigs 2007-06-28 11:34:53 -07:00
video V4L/DVB (5816): Cx88-blackbird: fix vidioc_g_tuner never ending list of tuners 2007-07-03 15:11:16 -03:00
Kconfig Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb 2007-05-11 12:57:16 -07:00
Makefile V4L/DVB (5599): Use menuconfig objects II - DVB 2007-05-09 10:12:48 -03:00