Skip to content

Commit 535ba45

Browse files
Vogtinatorgregkh
authored andcommitted
tty: hvc_console: Call hvc_kick in hvc_write unconditionally
commit cfd956d upstream. After hvc_write completes, call hvc_kick also in the case the output buffer has been drained, to ensure tty_wakeup gets called. This fixes that functions which wait for a drained buffer got stuck occasionally. Cc: stable <stable@kernel.org> Closes: https://bugzilla.opensuse.org/show_bug.cgi?id=1230062 Signed-off-by: Fabian Vogt <fvogt@suse.de> Link: https://lore.kernel.org/r/2011735.PYKUYFuaPT@fvogt-thinkpad Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 02468e9 commit 535ba45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/tty/hvc/hvc_console.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count
543543
}
544544

545545
/*
546-
* Racy, but harmless, kick thread if there is still pending data.
546+
* Kick thread to flush if there's still pending data
547+
* or to wakeup the write queue.
547548
*/
548-
if (hp->n_outbuf)
549-
hvc_kick();
549+
hvc_kick();
550550

551551
return written;
552552
}

0 commit comments

Comments
 (0)