From b18d541d4ee5568c2ba81bc22d00451824c2e033 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sun, 5 Oct 2003 08:30:02 -0700 Subject: [PATCH] [PATCH] janitor: schedule_timeout sets curr->state (arm) From: Alexey Dobriyan 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. --- arch/arm/common/sa1111-pcipool.c | 1 - drivers/char/cyclades.c | 1 - drivers/char/istallion.c | 1 - drivers/char/rio/rio_linux.c | 2 -- drivers/char/stallion.c | 1 - drivers/sbus/char/bbc_envctrl.c | 1 - drivers/sbus/char/envctrl.c | 2 -- drivers/serial/serial_core.c | 1 - drivers/video/sa1100fb.c | 1 - fs/nfsd/vfs.c | 1 - sound/core/rawmidi.c | 2 -- sound/usb/usbaudio.c | 1 - 12 files changed, 15 deletions(-) diff --git a/arch/arm/common/sa1111-pcipool.c b/arch/arm/common/sa1111-pcipool.c index daf06b580f0d..e0d8d87b3ad3 100644 --- a/arch/arm/common/sa1111-pcipool.c +++ b/arch/arm/common/sa1111-pcipool.c @@ -274,7 +274,6 @@ restart: schedule_timeout (POOL_TIMEOUT_JIFFIES); - current->state = TASK_RUNNING; remove_wait_queue (&pool->waitq, &wait); goto restart; } diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index c23803cc4714..6dcdf81dba8e 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -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 diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index c43a152bc469..9bfce6ec3dee 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c @@ -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); } } diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 1d75ebddeee5..4cab601b962f 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c @@ -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; } diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index cd061d88fad4..a1f6f069064a 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c @@ -1224,7 +1224,6 @@ static void stl_delay(int len) if (len > 0) { current->state = TASK_INTERRUPTIBLE; schedule_timeout(len); - current->state = TASK_RUNNING; } } diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c index a73818991b25..f028b154a95d 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c @@ -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; diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index da05d2635f5e..db6c3307b53d 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -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; } diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 6cf18b46136f..dc0289c7739e 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -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); diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 1631abc4cfe3..926b302f00d9 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -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); } diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index b3bd3e15062c..4fcb7b071f20 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -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); } diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 480e96fc2ffc..83672b44a327 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -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; diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 292f271b9a25..480292321923 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -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); -- 2.39.5