https://github.com/torvalds/linux
Revision 1e4597e8f0049dccedb0e011934007309fa2aeab authored by Oleg Nesterov on 02 July 2007, 15:26:20 UTC, committed by Mauro Carvalho Chehab on 03 July 2007, 18:11:19 UTC
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>
1 parent f057131
History
Tip revision: 1e4597e8f0049dccedb0e011934007309fa2aeab authored by Oleg Nesterov on 02 July 2007, 15:26:20 UTC
V4L/DVB (5818): CinergyT2: fix flush_workqueue() vs work->func() deadlock
Tip revision: 1e4597e
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
scripts
security
sound
usr
.gitignore -rw-r--r-- 572 bytes
.mailmap -rw-r--r-- 3.6 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 89.3 KB
Kbuild -rw-r--r-- 1.5 KB
MAINTAINERS -rw-r--r-- 87.8 KB
Makefile -rw-r--r-- 49.2 KB
README -rw-r--r-- 16.5 KB
REPORTING-BUGS -rw-r--r-- 3.0 KB

README

back to top