summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/msp3400-kthreads.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-07-19 12:09:42 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-19 12:09:42 -0300
commitd36c36c111fbbc58f065d0bde02cd2685daddc01 (patch)
treef550f55b584d847de4a9d6bd5a17a08899cdd3a6 /linux/drivers/media/video/msp3400-kthreads.c
parent9e503f7f1dbe325edf739b32136d74774c6e8ae2 (diff)
downloadmediapointer-dvb-s2-d36c36c111fbbc58f065d0bde02cd2685daddc01.tar.gz
mediapointer-dvb-s2-d36c36c111fbbc58f065d0bde02cd2685daddc01.tar.bz2
backport kernel changeset 831441862956fffa17b9801db37e6ea1650b0f69
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Original patch description from the patch by Rafael J. Wysocki <rjw@sisk.pl>: Freezer: make kernel threads nonfreezable by default Currently, the freezer treats all tasks as freezable, except for the kernel threads that explicitly set the PF_NOFREEZE flag for themselves. This approach is problematic, since it requires every kernel thread to either set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't care for the freezing of tasks at all. It seems better to only require the kernel threads that want to or need to be frozen to use some freezer-related code and to remove any freezer-related code from the other (nonfreezable) kernel threads, which is done in this patch. The patch causes all kernel threads to be nonfreezable by default (ie. to have PF_NOFREEZE set by default) and introduces the set_freezable() function that should be called by the freezable kernel threads in order to unset PF_NOFREEZE. It also makes all of the currently freezable kernel threads call set_freezable(), so it shouldn't cause any (intentional) change of behaviour to appear. Additionally, it updates documentation to describe the freezing of tasks more accurately. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/msp3400-kthreads.c')
-rw-r--r--linux/drivers/media/video/msp3400-kthreads.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linux/drivers/media/video/msp3400-kthreads.c b/linux/drivers/media/video/msp3400-kthreads.c
index 041ad89c6..d10f683d9 100644
--- a/linux/drivers/media/video/msp3400-kthreads.c
+++ b/linux/drivers/media/video/msp3400-kthreads.c
@@ -23,6 +23,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
+#include <linux/freezer.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
@@ -477,6 +478,7 @@ int msp3400c_thread(void *data)
#endif
v4l_dbg(1, msp_debug, client, "msp3400 daemon started\n");
+ set_freezable();
for (;;) {
v4l_dbg(2, msp_debug, client, "msp3400 thread: sleep\n");
msp_sleep(state, -1);
@@ -668,7 +670,7 @@ int msp3410d_thread(void *data)
msp_setup_thread(state);
#endif
v4l_dbg(1, msp_debug, client, "msp3410 daemon started\n");
-
+ set_freezable();
for (;;) {
v4l_dbg(2, msp_debug, client, "msp3410 thread: sleep\n");
msp_sleep(state,-1);
@@ -975,7 +977,7 @@ int msp34xxg_thread(void *data)
msp_setup_thread(state);
#endif
v4l_dbg(1, msp_debug, client, "msp34xxg daemon started\n");
-
+ set_freezable();
for (;;) {
v4l_dbg(2, msp_debug, client, "msp34xxg thread: sleep\n");
msp_sleep(state, -1);