• Robert Baldyga's avatar
    serial: samsung: Fix UART status handling in DMA mode · 09557c01
    Robert Baldyga authored
    So far, when interrupt occured in DMA mode, it was handled by terminating
    DMA transfer and draining data remaining in RX FIFO. It worked well
    until interrupt was caused by timeout, but the same interrupt can be
    alse caused by special condition (eg. 'break'), which requires special
    handling. In such case handling mechanism was the same - DMA transaction
    was terminated and FIFO was drained, but any special conditions were
    ingnored. Because of this in DMA mode there was no ability to use,
    for example, Magic SysRq.
    
    This patch fixes this problem by using s3c24xx_serial_rx_drain_fifo()
    function instead of uart_rx_drain_fifo(), which does the same thing
    (drains RX FIFO) plus checks UART status to detect special conditions
    (such as 'break'). Thanks to this we have exactly the same UART status
    handling in both DMA and PIO mode.
    
    This change additionally simplifies RX handling code, as we no longer
    need uart_rx_drain_fifo() function, so we can remove it.
    Reported-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    09557c01
samsung.c 62.7 KB