]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] janitor: schedule_timeout sets curr->state (arm)
authorRandy Dunlap <rddunlap@osdl.org>
Sun, 5 Oct 2003 15:30:02 +0000 (08:30 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 5 Oct 2003 15:30:02 +0000 (08:30 -0700)
From: Alexey Dobriyan <adobriyan@mail.ru>

Don't set process state to TASK_RUNNING after a schedule_timeout(), since
there's no way we will return from the scheduler if we're not running.

12 files changed:
arch/arm/common/sa1111-pcipool.c
drivers/char/cyclades.c
drivers/char/istallion.c
drivers/char/rio/rio_linux.c
drivers/char/stallion.c
drivers/sbus/char/bbc_envctrl.c
drivers/sbus/char/envctrl.c
drivers/serial/serial_core.c
drivers/video/sa1100fb.c
fs/nfsd/vfs.c
sound/core/rawmidi.c
sound/usb/usbaudio.c

index daf06b580f0de6654b17b7325107311eaf613c9f..e0d8d87b3ad31eedc4fa71511cb1950b90cfa839 100644 (file)
@@ -274,7 +274,6 @@ restart:
 
                        schedule_timeout (POOL_TIMEOUT_JIFFIES);
 
-                       current->state = TASK_RUNNING;
                        remove_wait_queue (&pool->waitq, &wait);
                        goto restart;
                }
index c23803cc47149254b959b2a043bb0c5dc8e517fd..6dcdf81dba8eb065a364b4d99ed9bc98ce9f6568 100644 (file)
@@ -2723,7 +2723,6 @@ cy_wait_until_sent(struct tty_struct *tty, int timeout)
     /* Run one more char cycle */
     current->state = TASK_INTERRUPTIBLE;
     schedule_timeout(char_time * 5);
-    current->state = TASK_RUNNING;
 #ifdef CY_DEBUG_WAIT_UNTIL_SENT
     printk("Clean (jiff=%lu)...done\n", jiffies);
 #endif
index c43a152bc469413a8dee71b97c16d96730249599..9bfce6ec3dee656596609d96660f30c885107187 100644 (file)
@@ -1488,7 +1488,6 @@ static void stli_delay(int len)
        if (len > 0) {
                set_current_state(TASK_INTERRUPTIBLE);
                schedule_timeout(len);
-               set_current_state(TASK_RUNNING);
        }
 }
 
index 1d75ebddeee510f00244c65e2b13caf361b0c1c1..4cab601b962f17d1d8e1a54c06514f7dba7a8970 100644 (file)
@@ -332,7 +332,6 @@ int RIODelay (struct Port *PortP, int njiffies)
   rio_dprintk (RIO_DEBUG_DELAY, "delaying %d jiffies\n", njiffies);  
   current->state = TASK_INTERRUPTIBLE;
   schedule_timeout(njiffies);
-  current->state = TASK_RUNNING;
   func_exit();
 
   if (signal_pending(current))
@@ -350,7 +349,6 @@ int RIODelay_ni (struct Port *PortP, int njiffies)
   rio_dprintk (RIO_DEBUG_DELAY, "delaying %d jiffies (ni)\n", njiffies);  
   current->state = TASK_UNINTERRUPTIBLE;
   schedule_timeout(njiffies);
-  current->state = TASK_RUNNING;
   func_exit();
   return !RIO_FAIL;
 }
index cd061d88fad466956d1875e5e1dafef91569ee14..a1f6f069064a34c57a3956c3d4e9805ab5e2591f 100644 (file)
@@ -1224,7 +1224,6 @@ static void stl_delay(int len)
        if (len > 0) {
                current->state = TASK_INTERRUPTIBLE;
                schedule_timeout(len);
-               current->state = TASK_RUNNING;
        }
 }
 
index a73818991b2574671d84ad401bac3651795f9450..f028b154a95d6319d11a9f982bd93ab85eba3475 100644 (file)
@@ -469,7 +469,6 @@ static int kenvctrld(void *__unused)
 
                current->state = TASK_INTERRUPTIBLE;
                schedule_timeout(POLL_INTERVAL);
-               current->state = TASK_RUNNING;
                if (signal_pending(current))
                        break;
 
index da05d2635f5e55b65fbc64e20c1450a75dced7d1..db6c3307b53d575f08c54e7217acc6adf0fafd8b 100644 (file)
@@ -1036,7 +1036,6 @@ static int kenvctrld(void *__unused)
        for (;;) {
                current->state = TASK_INTERRUPTIBLE;
                schedule_timeout(poll_interval);
-               current->state = TASK_RUNNING;
 
                if(signal_pending(current))
                        break;
@@ -1184,7 +1183,6 @@ static void __exit envctrl_cleanup(void)
 
                        current->state = TASK_INTERRUPTIBLE;
                        schedule_timeout(HZ);
-                       current->state = TASK_RUNNING;
                }
                kenvctrld_task = NULL;
        }
index 6cf18b46136fa35be4c2638418080b82d29cafe1..dc0289c7739ef023e08c899c4181a0fd8023f029 100644 (file)
@@ -1277,7 +1277,6 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
                if (state->close_delay) {
                        set_current_state(TASK_INTERRUPTIBLE);
                        schedule_timeout(state->close_delay);
-                       set_current_state(TASK_RUNNING);
                }
        } else if (!uart_console(port)) {
                uart_change_pm(state, 3);
index 1631abc4cfe3408e8ec4e48903ccacd50875d317..926b302f00d9da9f3370a60adc2ffb3ca16efbb5 100644 (file)
@@ -1388,7 +1388,6 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
        LCCR0 &= ~LCCR0_LEN;    /* Disable LCD Controller */
 
        schedule_timeout(20 * HZ / 1000);
-       set_current_state(TASK_RUNNING);
        remove_wait_queue(&fbi->ctrlr_wait, &wait);
 }
 
index b3bd3e15062ce74b1e9b740f2f488b323a2b30d5..4fcb7b071f20df926065a04a0d6d2e7413a92fc7 100644 (file)
@@ -781,7 +781,6 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
                                dprintk("nfsd: write defer %d\n", current->pid);
                                set_current_state(TASK_UNINTERRUPTIBLE);
                                schedule_timeout((HZ+99)/100);
-                               current->state = TASK_RUNNING;
                                dprintk("nfsd: write resume %d\n", current->pid);
                        }
 
index 480e96fc2ffc037fa0da700c9250f453e12ee507..83672b44a32771a7bc31c3aae22ba3df05cd61f3 100644 (file)
@@ -1182,7 +1182,6 @@ static ssize_t snd_rawmidi_write(struct file *file, const char *buf, size_t coun
                        spin_unlock_irq(&runtime->lock);
                        set_current_state(TASK_INTERRUPTIBLE);
                        timeout = schedule_timeout(30 * HZ);
-                       set_current_state(TASK_RUNNING);
                        remove_wait_queue(&runtime->sleep, &wait);
                        if (signal_pending(current))
                                return result > 0 ? result : -ERESTARTSYS;
@@ -1210,7 +1209,6 @@ static ssize_t snd_rawmidi_write(struct file *file, const char *buf, size_t coun
                        spin_unlock_irq(&runtime->lock);
                        set_current_state(TASK_INTERRUPTIBLE);
                        timeout = schedule_timeout(30 * HZ);
-                       set_current_state(TASK_RUNNING);
                        remove_wait_queue(&runtime->sleep, &wait);
                        if (signal_pending(current))
                                return result > 0 ? result : -ERESTARTSYS;
index 292f271b9a25cbc6dc31873b7fbe2179a465246b..480292321923509311a044051fb5108495df7cdb 100644 (file)
@@ -732,7 +732,6 @@ static int wait_clear_urbs(snd_usb_substream_t *subs)
                        break;
                set_current_state(TASK_UNINTERRUPTIBLE);
                schedule_timeout(1);
-               set_current_state(TASK_RUNNING);
        } while (--timeout > 0);
        if (alive)
                snd_printk(KERN_ERR "timeout: still %d active urbs..\n", alive);