From a92614bf1b57cc3342fe0d0cc21df8390d587b6c Mon Sep 17 00:00:00 2001 From: Kedareswara rao Appana Date: Mon, 16 Oct 2017 14:22:41 +0530 Subject: [PATCH] dma: xilinx: axidmatest: Fix race conditions in the test client This patch does the below --> Test client is limiting the test buffer size to 700 remove the check for the same also this patch increases the default value of test buf size from 64 to 16k. --> Terminate the existing transactions before freeing the dma channel. Signed-off-by: Kedareswara rao Appana Signed-off-by: Michal Simek --- drivers/dma/xilinx/axidmatest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/xilinx/axidmatest.c b/drivers/dma/xilinx/axidmatest.c index 126fa509704b..a750dd38085a 100644 --- a/drivers/dma/xilinx/axidmatest.c +++ b/drivers/dma/xilinx/axidmatest.c @@ -21,7 +21,7 @@ #include #include -static unsigned int test_buf_size = 64; +static unsigned int test_buf_size = 16384; module_param(test_buf_size, uint, S_IRUGO); MODULE_PARM_DESC(test_buf_size, "Size of the memcpy test buffer"); @@ -226,9 +226,6 @@ static int dmatest_slave_func(void *data) ret = -ENOMEM; - /* JZ: limit testing scope here */ - test_buf_size = 700; - smp_rmb(); tx_chan = thread->tx_chan; rx_chan = thread->rx_chan; @@ -627,6 +624,7 @@ static int xilinx_axidmatest_remove(struct platform_device *pdev) dmatest_cleanup_channel(dtc); pr_info("xilinx_dmatest: dropped channel %s\n", dma_chan_name(chan)); + dmaengine_terminate_all(chan); dma_release_channel(chan); } return 0; -- 2.39.2