• Jeremy Kerr's avatar
    serial/aspeed-vuart: Implement quick throttle mechanism · 5909c0bf
    Jeremy Kerr authored
    Although we populate the ->throttle and ->unthrottle UART operations,
    these may not be called until the ldisc has had a chance to schedule and
    check buffer space. This means that we may overflow the flip buffers
    without ever hitting the ldisc's throttle threshold.
    
    This change implements an interrupt-based throttle, where we check for
    space in the flip buffers before reading characters from the UART's
    FIFO. If there's no space available, we disable the RX interrupt and
    schedule a timer to check for space later.
    
    For this, we need an unlocked version of the set_throttle function to be
    able to change throttle state from the irq_handler, which already holds
    port->lock.
    
    This prevents a case where we drop characters under heavy RX load.
    Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
    Tested-by: default avatarEddie James <eajames@linux.vnet.ibm.com>
    Tested-by: default avatarJoel Stanley <joel@jms.id.au>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    5909c0bf
8250_aspeed_vuart.c 11.6 KB