• Stephen Boyd's avatar
    msm_serial: Fix NUL byte output on UARTDM · 4a5662d6
    Stephen Boyd authored
    UARTDM serial devices require us to wait for the entire TX fifo
    to drain before we can change the contents of the NCF_TX
    register. Furthermore, if we write any characters to the TX fifo
    within the same clock cycle of changing the NCF_TX register the
    NCF_TX register won't latch properly.
    
    To fix these issues we should read back the NCF_TX register to
    delay any TX fifo accesses by a clock cycle and we should wait
    for the TX fifo to drain (instead of just waiting for the fifo to
    be ready to receive more characters). Failure to do so leads to
    random NUL bytes interspersed in the output.
    Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
    Acked-by: default avatarDavid Brown <davidb@codeaurora.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    4a5662d6
msm_serial.h 5.39 KB