diff options
author | Christoph Lameter <christoph@lameter.com> | 2005-06-25 02:13:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 20:10:13 -0400 |
commit | 3e1d1d28d99dabe63c64f7f40f1ca1d646de1f73 (patch) | |
tree | d1e7c1e2e8902072042aefc3a7976b271cf76021 /drivers/media | |
parent | b3e112bcc19abd8e9657dca34a87316786e096f3 (diff) |
[PATCH] Cleanup patch for process freezing
1. Establish a simple API for process freezing defined in linux/include/sched.h:
frozen(process) Check for frozen process
freezing(process) Check if a process is being frozen
freeze(process) Tell a process to freeze (go to refrigerator)
thaw_process(process) Restart process
frozen_process(process) Process is frozen now
2. Remove all references to PF_FREEZE and PF_FROZEN from all
kernel sources except sched.h
3. Fix numerous locations where try_to_freeze is manually done by a driver
4. Remove the argument that is no longer necessary from two function calls.
5. Some whitespace cleanup
6. Clear potential race in refrigerator (provides an open window of PF_FREEZE
cleared before setting PF_FROZEN, recalc_sigpending does not check
PF_FROZEN).
This patch does not address the problem of freeze_processes() violating the rule
that a task may only modify its own flags by setting PF_FREEZE. This is not clean
in an SMP environment. freeze(process) is therefore not SMP safe!
Signed-off-by: Christoph Lameter <christoph@lameter.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 3 | ||||
-rw-r--r-- | drivers/media/video/msp3400.c | 3 | ||||
-rw-r--r-- | drivers/media/video/video-buf-dvb.c | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index d6b7a9de471e..f11daae91cd4 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -391,8 +391,7 @@ static int dvb_frontend_thread(void *data) | |||
391 | break; | 391 | break; |
392 | } | 392 | } |
393 | 393 | ||
394 | if (current->flags & PF_FREEZE) | 394 | try_to_freeze(); |
395 | refrigerator(PF_FREEZE); | ||
396 | 395 | ||
397 | if (down_interruptible(&fepriv->sem)) | 396 | if (down_interruptible(&fepriv->sem)) |
398 | break; | 397 | break; |
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 1b7d38e96f14..b4ee9dfe6d42 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c | |||
@@ -750,8 +750,7 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) | |||
750 | #endif | 750 | #endif |
751 | } | 751 | } |
752 | } | 752 | } |
753 | if (current->flags & PF_FREEZE) | 753 | try_to_freeze(); |
754 | refrigerator(PF_FREEZE); | ||
755 | remove_wait_queue(&msp->wq, &wait); | 754 | remove_wait_queue(&msp->wq, &wait); |
756 | return msp->restart; | 755 | return msp->restart; |
757 | } | 756 | } |
diff --git a/drivers/media/video/video-buf-dvb.c b/drivers/media/video/video-buf-dvb.c index 5f870075b55e..15f5bb486963 100644 --- a/drivers/media/video/video-buf-dvb.c +++ b/drivers/media/video/video-buf-dvb.c | |||
@@ -62,8 +62,7 @@ static int videobuf_dvb_thread(void *data) | |||
62 | break; | 62 | break; |
63 | if (kthread_should_stop()) | 63 | if (kthread_should_stop()) |
64 | break; | 64 | break; |
65 | if (current->flags & PF_FREEZE) | 65 | try_to_freeze(); |
66 | refrigerator(PF_FREEZE); | ||
67 | 66 | ||
68 | /* feed buffer data to demux */ | 67 | /* feed buffer data to demux */ |
69 | if (buf->state == STATE_DONE) | 68 | if (buf->state == STATE_DONE) |