diff options
| -rw-r--r-- | drivers/dma/at_hdmac.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 2c6bc3aa3dd0..3134003eec8b 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, | |||
| 933 | dev_vdbg(chan2dev(chan), "atc_control (%d)\n", cmd); | 933 | dev_vdbg(chan2dev(chan), "atc_control (%d)\n", cmd); |
| 934 | 934 | ||
| 935 | if (cmd == DMA_PAUSE) { | 935 | if (cmd == DMA_PAUSE) { |
| 936 | int pause_timeout = 1000; | ||
| 937 | |||
| 938 | spin_lock_bh(&atchan->lock); | 936 | spin_lock_bh(&atchan->lock); |
| 939 | 937 | ||
| 940 | dma_writel(atdma, CHER, AT_DMA_SUSP(chan_id)); | 938 | dma_writel(atdma, CHER, AT_DMA_SUSP(chan_id)); |
| 941 | |||
| 942 | /* wait for FIFO to be empty */ | ||
| 943 | while (!(dma_readl(atdma, CHSR) & AT_DMA_EMPT(chan_id))) { | ||
| 944 | if (pause_timeout-- > 0) { | ||
| 945 | /* the FIFO can only drain if the peripheral | ||
| 946 | * is still requesting data: | ||
| 947 | * -> timeout if it is not the case. */ | ||
| 948 | dma_writel(atdma, CHDR, AT_DMA_RES(chan_id)); | ||
| 949 | spin_unlock_bh(&atchan->lock); | ||
| 950 | return -ETIMEDOUT; | ||
| 951 | } | ||
| 952 | cpu_relax(); | ||
| 953 | } | ||
| 954 | |||
| 955 | set_bit(ATC_IS_PAUSED, &atchan->status); | 939 | set_bit(ATC_IS_PAUSED, &atchan->status); |
| 956 | 940 | ||
| 957 | spin_unlock_bh(&atchan->lock); | 941 | spin_unlock_bh(&atchan->lock); |
