[UPDATE PATCH] sbus/envctrl: replace schedule_timeout() with msleep_interruptible()

Nishanth Aravamudan
2005-01-11T01:03:25Z

> msleep_interruptible-drivers_sbus_char_envctrl.patch

Please consider updating to the following patch:

Description: 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.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

--- 2.6.10-v/drivers/sbus/char/envctrl.c 2004-12-24 13:34:01.000000000 -0800
+++ 2.6.10/drivers/sbus/char/envctrl.c 2005-01-05 14:23:05.000000000 -0800
@@ -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) {