]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
freezer: don't unnecessarily set PF_NOFREEZE explicitly
authorTejun Heo <tj@kernel.org>
Sat, 20 Aug 2011 09:31:39 +0000 (11:31 +0200)
committerTejun Heo <tj@kernel.org>
Sat, 20 Aug 2011 09:31:39 +0000 (11:31 +0200)
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.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: "Gustavo F. Padovan" <padovan@profusion.mobi>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: wwang <wei_wang@realsil.com.cn>
Documentation/power/freezing-of-tasks.txt
drivers/bluetooth/btmrvl_main.c
drivers/mfd/twl4030-irq.c
drivers/mfd/twl6030-irq.c
drivers/staging/rts_pstor/rtsx.c

index 38b57248fd61f5755528837145052c5c998c17b7..710c96584d6f6009a95518f2723782867e60e271 100644 (file)
@@ -67,7 +67,7 @@ III. Which kernel threads are freezable?
 
 Kernel threads are not freezable by default.  However, a kernel thread may clear
 PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE
-directly is strongly discouraged).  From this point it is regarded as freezable
+directly is not allowed).  From this point it is regarded as freezable
 and must call try_to_freeze() in a suitable place.
 
 IV. Why do we do that?
index 548d1d9e4ddad7328c2ac9d68ec7d17de949d15a..57312d44db54f4b1b61a1e47b37f77c67d7961c2 100644 (file)
@@ -473,8 +473,6 @@ static int btmrvl_service_main_thread(void *data)
 
        init_waitqueue_entry(&wait, current);
 
-       current->flags |= PF_NOFREEZE;
-
        for (;;) {
                add_wait_queue(&thread->wait_q, &wait);
 
index 8a7ee3139b86fda3bded6748e572893d37b577fb..6aae8312019d599899aabeb2881eb2fbcda6b922 100644 (file)
@@ -289,9 +289,6 @@ static int twl4030_irq_thread(void *data)
        static unsigned i2c_errors;
        static const unsigned max_i2c_errors = 100;
 
-
-       current->flags |= PF_NOFREEZE;
-
        while (!kthread_should_stop()) {
                int ret;
                int module_irq;
index eb3b5f88e566c73e6599705649c83ec9b2758f2d..6fd7795fa0e29daea9ebcf36b3f415cfa9bc77a2 100644 (file)
@@ -96,8 +96,6 @@ static int twl6030_irq_thread(void *data)
        static const unsigned max_i2c_errors = 100;
        int ret;
 
-       current->flags |= PF_NOFREEZE;
-
        while (!kthread_should_stop()) {
                int i;
                union {
index 16c73fbff51fe52d9bd3b11d5e91a39a1654c573..a1b909345020fd80e55faba7ab9d409d02acadeb 100644 (file)
@@ -466,8 +466,6 @@ static int rtsx_control_thread(void *__dev)
        struct rtsx_chip *chip = dev->chip;
        struct Scsi_Host *host = rtsx_to_host(dev);
 
-       current->flags |= PF_NOFREEZE;
-
        for (;;) {
                if (wait_for_completion_interruptible(&dev->cmnd_ready))
                        break;