From: Dirk Behme Date: Tue, 9 Dec 2014 09:11:28 +0000 (+0900) Subject: serial: imx: use dma_is_txing to synchronize dma_tx_callback and imx_dma_tx X-Git-Tag: fixes-v4.0-rc1~98^2~92 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42f752b3fbcfee9c27e4f6f6216e60e130ba98c8;p=pandora-kernel.git 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-diff-tree failed