From e5730c4a7338650f363f3c1ce9f5793b512598f1 Mon Sep 17 00:00:00 2001 From: mycroft Date: Sun, 18 Feb 1996 09:10:15 +0000 Subject: [PATCH] Fix a race condition where we might stop outputting if a write follows a flush too closely. --- sys/dev/ic/com.c | 8 +++----- sys/dev/isa/com.c | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 36e3e91f1e91..a9fdcad9fd4a 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.67 1996/02/17 04:51:41 mycroft Exp $ */ +/* $NetBSD: com.c,v 1.68 1996/02/18 09:10:15 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved. @@ -832,7 +832,7 @@ comstart(tp) int s; s = spltty(); - if (ISSET(tp->t_state, TS_TTSTOP | TS_BUSY)) + if (ISSET(tp->t_state, TS_TIMEOUT | TS_TTSTOP | TS_BUSY)) goto out; if (sc->sc_halt > 0) goto out; @@ -1066,11 +1066,9 @@ comintr(arg) } if (ISSET(lsr, LSR_TXRDY) && ISSET(tp->t_state, TS_BUSY)) { - CLR(tp->t_state, TS_BUSY); + CLR(tp->t_state, TS_BUSY | TS_FLUSH); if (sc->sc_halt > 0) wakeup(&tp->t_outq); - else if (ISSET(tp->t_state, TS_FLUSH)) - CLR(tp->t_state, TS_FLUSH); else (*linesw[tp->t_line].l_start)(tp); } diff --git a/sys/dev/isa/com.c b/sys/dev/isa/com.c index 36e3e91f1e91..a9fdcad9fd4a 100644 --- a/sys/dev/isa/com.c +++ b/sys/dev/isa/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.67 1996/02/17 04:51:41 mycroft Exp $ */ +/* $NetBSD: com.c,v 1.68 1996/02/18 09:10:15 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved. @@ -832,7 +832,7 @@ comstart(tp) int s; s = spltty(); - if (ISSET(tp->t_state, TS_TTSTOP | TS_BUSY)) + if (ISSET(tp->t_state, TS_TIMEOUT | TS_TTSTOP | TS_BUSY)) goto out; if (sc->sc_halt > 0) goto out; @@ -1066,11 +1066,9 @@ comintr(arg) } if (ISSET(lsr, LSR_TXRDY) && ISSET(tp->t_state, TS_BUSY)) { - CLR(tp->t_state, TS_BUSY); + CLR(tp->t_state, TS_BUSY | TS_FLUSH); if (sc->sc_halt > 0) wakeup(&tp->t_outq); - else if (ISSET(tp->t_state, TS_FLUSH)) - CLR(tp->t_state, TS_FLUSH); else (*linesw[tp->t_line].l_start)(tp); }