TTY Core uses flush_buffer to clear out any output data before closing port, whereas UART application can always request to do flush output data before starting data transfer using tty supported ioctl(). receive_tty_flush is used to make decision on completion of any DMA Tx data transfer. Using same approach when there is no DMA Tx transfer is happening, it is breaking next DMA Tx transfer functionality. Hence update receive_tty_flush only when there is any DMA TX transfer active. (cherry picked from commit 53069734628ebce341cf1ef778c91dbcbbcf67db) Change-Id: I26f4ceece422674e1f7647e5dfadb476cec1ef92 CRs-Fixed: 438057 Signed-off-by: Mayank Rana <mrana@codeaurora.org>