Skip to contentSkip to conversation

tc/zs: replace schedule_timeout() with msleep_interruptible()

PATCH In review [email protected] 1 participant 1 message Mar 6, 2005 Turbochannel

lore
Share & tools
lore
#0 lore raw

PATCH 9/14 tc/zs: replace schedule_timeout() with msleep_interruptible()

Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected.

---

 kj-domen/drivers/tc/zs.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/tc/zs.c renamed from drivers/tc/zs.c~msleep_interruptible-drivers_tc_zs +2 -4
diff -puN drivers/tc/zs.c~msleep_interruptible-drivers_tc_zs drivers/tc/zs.c
@@ -1368,8 +1368,7 @@ static void rs_close(struct tty_struct *
 	info->tty = 0;
 	if (info->blocked_open) {
 		if (info->close_delay) {
-			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(info->close_delay);
+			msleep_interruptible(jiffies_to_msecs(info->close_delay));
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
@@ -1403,8 +1402,7 @@ static void rs_wait_until_sent(struct tt
 	if (timeout)
 		char_time = min(char_time, timeout);
 	while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) {
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(char_time);
+		msleep_interruptible(jiffies_to_msecs(char_time));
 		if (signal_pending(current))
 			break;
 		if (timeout && time_after(jiffies, orig_jiffies + timeout))

_