• Johan Hovold's avatar
    TTY: fix tty_wait_until_sent maximum timeout · c37bc682
    Johan Hovold authored
    Currently tty_wait_until_sent may take up to twice as long as the
    requested timeout while waiting for driver and hardware buffers to
    drain.
    
    Fix this by taking the remaining number of jiffies after waiting for
    driver buffers to drain into account so that the timeout actually
    becomes a maximum timeout as it is documented to be.
    
    Note that this specifically implies tighter timings when closing a port
    as a consequence of actually honouring the port closing-wait setting
    for drivers relying on tty_wait_until_sent_from_close (e.g. via
    tty_port_close_start).
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    Reviewed-by: default avatarPeter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c37bc682
tty_ioctl.c 30.4 KB