]> git.baikalelectronics.ru Git - kernel.git/commit
tty: hvc: hvc_poll() fix read loop hang
authorNicholas Piggin <npiggin@gmail.com>
Sun, 9 Sep 2018 05:39:14 +0000 (15:39 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 16:04:31 +0000 (18:04 +0200)
commitb6ca07dec57b0a319e3e5537bef387970c8e3f87
tree379d99391da9a5e9404964b4cf5cd28ec49889dd
parent98d8ef8d1216385375417e11a07c1df549521ab0
tty: hvc: hvc_poll() fix read loop hang

Commit 931c0332ac5a ("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 <mcroce@redhat.com>
Reported-by: Jason Gunthorpe <jgg@mellanox.com>
Tested-by: Matteo Croce <mcroce@redhat.com>
Tested-by: Jason Gunthorpe <jgg@mellanox.com>
Tested-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/hvc/hvc_console.c