diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2017-09-27 10:48:34 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2017-09-27 10:48:34 +0200 |
commit | 3f5660b1cbb09c65319c452ca9dc26a572aacc6d (patch) | |
tree | a64b5100d2b8a50176a998657b7cc142d48c4c2f /drivers/dma | |
parent | 3f68dc7c600c0354f5df7f06b931661319addafb (diff) | |
parent | 346ae4600d05c8488abcda40bb4ca8dbcbbeacc0 (diff) |
Merge remote-tracking branch 'fslc/4.1-2.0.x-imx' into toradex_4.1-2.0.x-imx
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/ep93xx_dma.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index 1638d39af595..023c08708b56 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c @@ -201,7 +201,6 @@ struct ep93xx_dma_engine { struct dma_device dma_dev; bool m2m; int (*hw_setup)(struct ep93xx_dma_chan *); - void (*hw_synchronize)(struct ep93xx_dma_chan *); void (*hw_shutdown)(struct ep93xx_dma_chan *); void (*hw_submit)(struct ep93xx_dma_chan *); int (*hw_interrupt)(struct ep93xx_dma_chan *); @@ -336,27 +335,21 @@ static inline u32 m2p_channel_state(struct ep93xx_dma_chan *edmac) return (readl(edmac->regs + M2P_STATUS) >> 4) & 0x3; } -static void m2p_hw_synchronize(struct ep93xx_dma_chan *edmac) +static void m2p_hw_shutdown(struct ep93xx_dma_chan *edmac) { - unsigned long flags; u32 control; - spin_lock_irqsave(&edmac->lock, flags); control = readl(edmac->regs + M2P_CONTROL); control &= ~(M2P_CONTROL_STALLINT | M2P_CONTROL_NFBINT); m2p_set_control(edmac, control); - spin_unlock_irqrestore(&edmac->lock, flags); while (m2p_channel_state(edmac) >= M2P_STATE_ON) - schedule(); -} + cpu_relax(); -static void m2p_hw_shutdown(struct ep93xx_dma_chan *edmac) -{ m2p_set_control(edmac, 0); - while (m2p_channel_state(edmac) != M2P_STATE_IDLE) - dev_warn(chan2dev(edmac), "M2P: Not yet IDLE\n"); + while (m2p_channel_state(edmac) == M2P_STATE_STALL) + cpu_relax(); } static void m2p_fill_desc(struct ep93xx_dma_chan *edmac) @@ -1172,26 +1165,6 @@ fail: } /** - * ep93xx_dma_synchronize - Synchronizes the termination of transfers to the - * current context. - * @chan: channel - * - * Synchronizes the DMA channel termination to the current context. When this - * function returns it is guaranteed that all transfers for previously issued - * descriptors have stopped and and it is safe to free the memory associated - * with them. Furthermore it is guaranteed that all complete callback functions - * for a previously submitted descriptor have finished running and it is safe to - * free resources accessed from within the complete callbacks. - */ -static void ep93xx_dma_synchronize(struct dma_chan *chan) -{ - struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); - - if (edmac->edma->hw_synchronize) - edmac->edma->hw_synchronize(edmac); -} - -/** * ep93xx_dma_terminate_all - terminate all transactions * @chan: channel * @@ -1354,7 +1327,6 @@ static int __init ep93xx_dma_probe(struct platform_device *pdev) dma_dev->device_prep_slave_sg = ep93xx_dma_prep_slave_sg; dma_dev->device_prep_dma_cyclic = ep93xx_dma_prep_dma_cyclic; dma_dev->device_config = ep93xx_dma_slave_config; - dma_dev->device_synchronize = ep93xx_dma_synchronize; dma_dev->device_terminate_all = ep93xx_dma_terminate_all; dma_dev->device_issue_pending = ep93xx_dma_issue_pending; dma_dev->device_tx_status = ep93xx_dma_tx_status; @@ -1372,7 +1344,6 @@ static int __init ep93xx_dma_probe(struct platform_device *pdev) } else { dma_cap_set(DMA_PRIVATE, dma_dev->cap_mask); - edma->hw_synchronize = m2p_hw_synchronize; edma->hw_setup = m2p_hw_setup; edma->hw_shutdown = m2p_hw_shutdown; edma->hw_submit = m2p_hw_submit; |