]> git.baikalelectronics.ru Git - kernel.git/commit
V4L/DVB (7711): pvrusb2: Fix race on module unload
authorMike Isely <isely@pobox.com>
Mon, 7 Apr 2008 05:22:04 +0000 (02:22 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:09:48 +0000 (14:09 -0300)
commit845a346a9114d1092f06bbb7332777a9f5758d3d
tree4223cab8016088a06d0423e1e41eacb646867c46
parente694863fd96da3f79d3a22ff9478c9be07d4147c
V4L/DVB (7711): pvrusb2: Fix race on module unload

The pvrusb2 driver - for basically forever - was not enforcing a
proper module tear-down.  Kernel threads are used inside the driver
and all must be gone before the module can be safely removed.  This
changeset reimplements a chunk of pvrusb2-context.c to enforce this
correctly.  Unfortunately this is not a simple fix.  The new
implementation also cuts back on kernel thread usage; instead of there
being 1 control thread per instance now it's just 1 control thread
shared by all instances.  (By dropping to a single thread then the
module exit function can block on its shutdown and the thread itself
can monitor and cleanly shut down all of the other instances first.)

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/pvrusb2/pvrusb2-context.c
drivers/media/video/pvrusb2/pvrusb2-context.h
drivers/media/video/pvrusb2/pvrusb2-main.c