sbus/aurora: replace schedule_timeout() with msleep_interruptible()
Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected.
Quoted 6 lines · Domen Puncer
Review
Quoted 3 lines · Nishanth Aravamudan
(quoted diff) +1
-2- current->state = TASK_INTERRUPTIBLE; - schedule_timeout(port->close_delay); + msleep_interruptible(port->close_delay);I think you forgot
jiffies_to_msecshere.
Please find the corrected patch below.
Thanks for catching this, Domen.
Signed-off-by Nishanth Aravamudan <[email protected]>
Signed-off-by Maximilian Attems <[email protected]>
Signed-off-by Domen Puncer <[email protected]>
---
kj-domen/drivers/sbus/char/aurora.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/sbus/char/aurora.c renamed from drivers/sbus/char/aurora.c~msleep_interruptible-drivers_sbus_char_aurora +2 -4
@@ -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); }
_