From 42f752b3fbcfee9c27e4f6f6216e60e130ba98c8 Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Tue, 9 Dec 2014 18:11:28 +0900 Subject: [PATCH] serial: imx: use dma_is_txing to synchronize dma_tx_callback and imx_dma_tx To synchronize between dma_tx_callback() and imx_dma_tx() use the same variable, dma_is_txing. This prevents any race between these two functions and ensures that a new DMA can start only after the first has been finished. Before the new DMA can be set up, update the circular buffer logic, first. Therefore, change dma_is_txing after that update, instead of before. While doing this, in dma_tx_callback() extend the locking to dma_unmap_sg() and the update of dma_is_txing. Signed-off-by: Dirk Behme Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed