diff options
author | Tejun Heo <tj@kernel.org> | 2011-11-21 15:32:22 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-11-21 15:32:22 -0500 |
commit | 3a7cbd50f74907580eb47a8d08e1f29741b81abf (patch) | |
tree | 515b7d9b9fa85c20ecf6779d563371b666a8b991 | |
parent | 50fb4f7fc907efff65eadb0b74387a9ffed6e849 (diff) |
freezer: don't unnecessarily set PF_NOFREEZE explicitly
Some drivers set PF_NOFREEZE in their kthread functions which is
completely unnecessary and racy - some part of freezer code doesn't
consider cases where PF_NOFREEZE is set asynchronous to freezer
operations.
In general, there's no reason to allow setting PF_NOFREEZE explicitly.
Remove them and change the documentation to note that setting
PF_NOFREEZE directly isn't allowed.
-v2: Dropped change to twl4030-irq.c as it no longer uses PF_NOFREEZE.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: "Gustavo F. Padovan" <padovan@profusion.mobi>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: wwang <wei_wang@realsil.com.cn>
-rw-r--r-- | Documentation/power/freezing-of-tasks.txt | 2 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_main.c | 2 | ||||
-rw-r--r-- | drivers/mfd/twl6030-irq.c | 2 | ||||
-rw-r--r-- | drivers/staging/rts_pstor/rtsx.c | 2 |
4 files changed, 1 insertions, 7 deletions
diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt index 316c2ba187f4..587e0828053f 100644 --- a/Documentation/power/freezing-of-tasks.txt +++ b/Documentation/power/freezing-of-tasks.txt | |||
@@ -67,7 +67,7 @@ III. Which kernel threads are freezable? | |||
67 | 67 | ||
68 | Kernel threads are not freezable by default. However, a kernel thread may clear | 68 | Kernel threads are not freezable by default. However, a kernel thread may clear |
69 | PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE | 69 | PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE |
70 | directly is strongly discouraged). From this point it is regarded as freezable | 70 | directly is not allowed). From this point it is regarded as freezable |
71 | and must call try_to_freeze() in a suitable place. | 71 | and must call try_to_freeze() in a suitable place. |
72 | 72 | ||
73 | IV. Why do we do that? | 73 | IV. Why do we do that? |
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index a88a78c86162..6c3defa50845 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c | |||
@@ -475,8 +475,6 @@ static int btmrvl_service_main_thread(void *data) | |||
475 | 475 | ||
476 | init_waitqueue_entry(&wait, current); | 476 | init_waitqueue_entry(&wait, current); |
477 | 477 | ||
478 | current->flags |= PF_NOFREEZE; | ||
479 | |||
480 | for (;;) { | 478 | for (;;) { |
481 | add_wait_queue(&thread->wait_q, &wait); | 479 | add_wait_queue(&thread->wait_q, &wait); |
482 | 480 | ||
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c index 3eee45ffb096..c6b456ad7342 100644 --- a/drivers/mfd/twl6030-irq.c +++ b/drivers/mfd/twl6030-irq.c | |||
@@ -138,8 +138,6 @@ static int twl6030_irq_thread(void *data) | |||
138 | static const unsigned max_i2c_errors = 100; | 138 | static const unsigned max_i2c_errors = 100; |
139 | int ret; | 139 | int ret; |
140 | 140 | ||
141 | current->flags |= PF_NOFREEZE; | ||
142 | |||
143 | while (!kthread_should_stop()) { | 141 | while (!kthread_should_stop()) { |
144 | int i; | 142 | int i; |
145 | union { | 143 | union { |
diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c index 480b0ed2e4de..8a7803cf88d2 100644 --- a/drivers/staging/rts_pstor/rtsx.c +++ b/drivers/staging/rts_pstor/rtsx.c | |||
@@ -466,8 +466,6 @@ static int rtsx_control_thread(void *__dev) | |||
466 | struct rtsx_chip *chip = dev->chip; | 466 | struct rtsx_chip *chip = dev->chip; |
467 | struct Scsi_Host *host = rtsx_to_host(dev); | 467 | struct Scsi_Host *host = rtsx_to_host(dev); |
468 | 468 | ||
469 | current->flags |= PF_NOFREEZE; | ||
470 | |||
471 | for (;;) { | 469 | for (;;) { |
472 | if (wait_for_completion_interruptible(&dev->cmnd_ready)) | 470 | if (wait_for_completion_interruptible(&dev->cmnd_ready)) |
473 | break; | 471 | break; |