mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
tty: hvc: hvc_poll() fix read loop hang
Commit ec97eaad13 ("tty: hvc: hvc_poll() break hv read loop") causes
the virtio console to hang at times (e.g., if you paste a bunch of
characters to it.
The reason is that get_chars must return 0 before we can be sure the
driver will kick or poll input again, but this change only scheduled a
poll if get_chars had returned a full count. Change this to poll on
any > 0 count.
Reported-by: Matteo Croce <[email protected]>
Reported-by: Jason Gunthorpe <[email protected]>
Tested-by: Matteo Croce <[email protected]>
Tested-by: Jason Gunthorpe <[email protected]>
Tested-by: Leon Romanovsky <[email protected]>
Signed-off-by: Nicholas Piggin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
11da3a7f84
commit
6e7f6b82c6
1 changed files with 5 additions and 2 deletions
|
|
@ -717,10 +717,13 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)
|
|||
#endif /* CONFIG_MAGIC_SYSRQ */
|
||||
tty_insert_flip_char(&hp->port, buf[i], 0);
|
||||
}
|
||||
if (n == count)
|
||||
poll_mask |= HVC_POLL_READ;
|
||||
read_total = n;
|
||||
|
||||
/*
|
||||
* Latency break, schedule another poll immediately.
|
||||
*/
|
||||
poll_mask |= HVC_POLL_READ;
|
||||
|
||||
out:
|
||||
/* Wakeup write queue if necessary */
|
||||
if (hp->do_wakeup) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue