Commits
Vignesh Raghavendra committed e1ec21baa47
serial: 8250: 8250_omap: Fix DMA teardown sequence during RX timeout Calling dmaengine_terminate_async() does not guarantee all the data that is picked up DMA and is in flight to memory is flushed immediately, therefore poll for the in flight data to be flushed before pushing buffer to tty ldisc. Ideal way to solve this without polling is to call dmaengine_synchronize() before pushing data to tty layer, but that cannot be done in interrupt context and code cannot be moved to bottom half as we need to hold rx_dma_lock spinlock. Therefore introduce a bounded polling mechanism to know data has been flushed. Since this is a flush at DMA hardware level, sequence should be quite deterministic and loop upper bound is set to 5 times the observed value. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>