Skip to content

Commit cb39d26

Browse files
Nishanth Aravamudandavem330
authored andcommitted
[SPARC]: sbus/envctrl: replace schedule_timeout() with msleep_interruptible()
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> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 70c8337 commit cb39d26

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎drivers/sbus/char/envctrl.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ static int kenvctrld(void *__unused)
10071007
return -ENODEV;
10081008
}
10091009

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

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

10171017
printk(KERN_INFO "envctrl: %s starting...\n", current->comm);
10181018
for (;;) {
1019-
current->state = TASK_INTERRUPTIBLE;
1020-
schedule_timeout(poll_interval);
1021-
1022-
if(signal_pending(current))
1019+
if(msleep_interruptible(poll_interval))
10231020
break;
10241021

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

0 commit comments

Comments
 (0)