Skip to contentSkip to conversation

sbus/envctrl: replace schedule_timeout() with msleep_interruptible()

PATCH In review [email protected] 1 participant 1 message Jun 20, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 sbus/envctrl: replace schedule_timeout() with msleep_interruptible()

From: Nishanth Aravamudan <[email protected]>

Use msleep_interruptible() instead of
schedule_timeout() to guarantee the task delays as expected. Change the units of poll_interval to msecs as it is only used in this delay.

---
 envctrl.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Index: quilt/drivers/sbus/char/envctrl.c =================================--- quilt.orig/drivers/sbus/char/envctrl.c +++ quilt/drivers/sbus/char/envctrl.c
@@ -1007,7 +1007,7 @@ static int kenvctrld(void *__unused)
return -ENODEV;
}

- poll_interval = 5 * HZ; /* TODO env_mon_interval */
+ poll_interval = 5000; /* TODO env_mon_interval */

daemonize("kenvctrld"); allow_signal(SIGKILL);
@@ -1016,10 +1016,7 @@ static int kenvctrld(void *__unused)

printk(KERN_INFO "envctrl: %s starting...\n", current->comm); for (;;) {
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(poll_interval);
-
- if(signal_pending(current))
+ if(msleep_interruptible(poll_interval))
break;

for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) {

--