Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: dw: don't perform DMA when dmaengine_submit is called

Accordingly to discussion [1] and followed up documentation the DMA controller
driver shouldn't start any DMA operations when dmaengine_submit() is called.

This patch fixes the workflow in dw_dmac driver to follow the documentation.

[1] http://www.spinics.net/lists/arm-kernel/msg125987.html

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Andy Shevchenko and committed by
Vinod Koul
dd8ecfca cba15617

+7 -13
-1
drivers/dma/TODO
··· 7 7 - imx-dma 8 8 - imx-sdma 9 9 - mxs-dma.c 10 - - dw_dmac 11 10 - intel_mid_dma 12 11 4. Check other subsystems for dma drivers and merge/move to dmaengine 13 12 5. Remove dma_slave_config's dma direction.
+7 -12
drivers/dma/dw/core.c
··· 684 684 * possible, perhaps even appending to those already submitted 685 685 * for DMA. But this is hard to do in a race-free manner. 686 686 */ 687 - if (list_empty(&dwc->active_list)) { 688 - dev_vdbg(chan2dev(tx->chan), "%s: started %u\n", __func__, 689 - desc->txd.cookie); 690 - list_add_tail(&desc->desc_node, &dwc->active_list); 691 - dwc_dostart(dwc, dwc_first_active(dwc)); 692 - } else { 693 - dev_vdbg(chan2dev(tx->chan), "%s: queued %u\n", __func__, 694 - desc->txd.cookie); 695 687 696 - list_add_tail(&desc->desc_node, &dwc->queue); 697 - } 688 + dev_vdbg(chan2dev(tx->chan), "%s: queued %u\n", __func__, desc->txd.cookie); 689 + list_add_tail(&desc->desc_node, &dwc->queue); 698 690 699 691 spin_unlock_irqrestore(&dwc->lock, flags); 700 692 ··· 1091 1099 static void dwc_issue_pending(struct dma_chan *chan) 1092 1100 { 1093 1101 struct dw_dma_chan *dwc = to_dw_dma_chan(chan); 1102 + unsigned long flags; 1094 1103 1095 - if (!list_empty(&dwc->queue)) 1096 - dwc_scan_descriptors(to_dw_dma(chan->device), dwc); 1104 + spin_lock_irqsave(&dwc->lock, flags); 1105 + if (list_empty(&dwc->active_list)) 1106 + dwc_dostart_first_queued(dwc); 1107 + spin_unlock_irqrestore(&dwc->lock, flags); 1097 1108 } 1098 1109 1099 1110 static int dwc_alloc_chan_resources(struct dma_chan *chan)