aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2018-07-10 22:10:16 -0400
committerVinod Koul <vkoul@kernel.org>2018-07-11 01:17:31 -0400
commit8115ce745fa26ccffe7d1a542ab4322acf4a682d (patch)
tree5c516be732e1479e3d6f37a2a21bd47c6d0f23fe
parent4de1247a9826cec0ba054479124bd9aa60fb71a5 (diff)
dmaengine: sh: rcar-dmac: Add dma_pause operation
This patch adds dma_pause operation. This patch is based on Muhammad Hamza Farooq's patch. After this patch applied, an issue that the sh-sci driver with high baud rate might cause data lost disappeared because the DMAC is possible to transmit between [1] and [2] below, and then the residue of [1] is not true: In rx_timer_fn() of the sh-sci.c: dmaengine_pause(); ... dmaengine_tx_status(); /* [1] */ ... dmaengine_terminate_all(); /* [2] */ Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/sh/rcar-dmac.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index d3b7388645bc..be82d6997a55 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -834,6 +834,17 @@ static void rcar_dmac_stop_all_chan(struct rcar_dmac *dmac)
834 } 834 }
835} 835}
836 836
837static int rcar_dmac_chan_pause(struct dma_chan *chan)
838{
839 unsigned long flags;
840 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan);
841
842 spin_lock_irqsave(&rchan->lock, flags);
843 rcar_dmac_clear_chcr_de(rchan);
844 spin_unlock_irqrestore(&rchan->lock, flags);
845
846 return 0;
847}
837 848
838/* ----------------------------------------------------------------------------- 849/* -----------------------------------------------------------------------------
839 * Descriptors preparation 850 * Descriptors preparation
@@ -1864,6 +1875,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
1864 engine->device_prep_slave_sg = rcar_dmac_prep_slave_sg; 1875 engine->device_prep_slave_sg = rcar_dmac_prep_slave_sg;
1865 engine->device_prep_dma_cyclic = rcar_dmac_prep_dma_cyclic; 1876 engine->device_prep_dma_cyclic = rcar_dmac_prep_dma_cyclic;
1866 engine->device_config = rcar_dmac_device_config; 1877 engine->device_config = rcar_dmac_device_config;
1878 engine->device_pause = rcar_dmac_chan_pause;
1867 engine->device_terminate_all = rcar_dmac_chan_terminate_all; 1879 engine->device_terminate_all = rcar_dmac_chan_terminate_all;
1868 engine->device_tx_status = rcar_dmac_tx_status; 1880 engine->device_tx_status = rcar_dmac_tx_status;
1869 engine->device_issue_pending = rcar_dmac_issue_pending; 1881 engine->device_issue_pending = rcar_dmac_issue_pending;