summaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2011-05-09 18:11:37 +0200
committerVinod Koul <vinod.koul@intel.com>2011-05-12 13:55:34 +0530
commitde7a2f9f7b6f5b48d8531ff4c9c9b95cab8a8ce8 (patch)
tree87aed80faacde3ecf9a84a3e57e9445626064fb1 /drivers/dma
parenteb8590b504caacb029dea4540e0b0dcc98da4381 (diff)
dmaengine: at_hdmac: pause: no need to wait for FIFO empty
With the addition of the "pause" feature, an active wait was introduced to check the "FIFO empty" event. This event was not always happening and a timout contition was needed. But, in some cases, this event depend on the peripheral connected to the channel that is paused: FIFO becomes empty if the peripheral consumes data. The timeout is pretty difficult to evaluate. Moreover, this check is not needed. In conclusion, it seems sensible to entirely remove the checking of "FIFO empty" status when pausing. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> [commit msg edited for grammer] Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/at_hdmac.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 2c6bc3aa3dd..3134003eec8 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -933,25 +933,9 @@ static int atc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
dev_vdbg(chan2dev(chan), "atc_control (%d)\n", cmd);
if (cmd == DMA_PAUSE) {
- int pause_timeout = 1000;
-
spin_lock_bh(&atchan->lock);
dma_writel(atdma, CHER, AT_DMA_SUSP(chan_id));
-
- /* wait for FIFO to be empty */
- while (!(dma_readl(atdma, CHSR) & AT_DMA_EMPT(chan_id))) {
- if (pause_timeout-- > 0) {
- /* the FIFO can only drain if the peripheral
- * is still requesting data:
- * -> timeout if it is not the case. */
- dma_writel(atdma, CHDR, AT_DMA_RES(chan_id));
- spin_unlock_bh(&atchan->lock);
- return -ETIMEDOUT;
- }
- cpu_relax();
- }
-
set_bit(ATC_IS_PAUSED, &atchan->status);
spin_unlock_bh(&atchan->lock);