Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected. On Wed, Sep 29, 2004 at 06:10:06PM +0200, Domen Puncer wrote: > On 27/09/04 10:24 -0700, Nishanth Aravamudan wrote: > > - current->state = TASK_INTERRUPTIBLE; > > - schedule_timeout(port->close_delay); > > + msleep_interruptible(port->close_delay); > > I think you forgot jiffies_to_msecs here. Please find the corrected patch below. Thanks for catching this, Domen. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/sbus/char/aurora.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -puN drivers/sbus/char/aurora.c~msleep_interruptible-drivers_sbus_char_aurora drivers/sbus/char/aurora.c --- kj/drivers/sbus/char/aurora.c~msleep_interruptible-drivers_sbus_char_aurora 2004-12-25 01:35:03.000000000 +0100 +++ kj-domen/drivers/sbus/char/aurora.c 2004-12-25 01:35:03.000000000 +0100 @@ -1519,8 +1519,7 @@ static void aurora_close(struct tty_stru */ timeout = jiffies+HZ; while(port->SRER & SRER_TXEMPTY) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(port->timeout); + msleep_interruptible(jiffies_to_msecs(port->timeout)); if (time_after(jiffies, timeout)) break; } @@ -1537,8 +1536,7 @@ static void aurora_close(struct tty_stru port->tty = 0; if (port->blocked_open) { if (port->close_delay) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(port->close_delay); + msleep_interruptible(jiffies_to_msecs(port->close_delay)); } wake_up_interruptible(&port->open_wait); } _