summaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmatest.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2011-07-29 06:51:57 -0400
committerVinod Koul <vinod.koul@intel.com>2011-08-08 10:02:01 -0400
commit9704efaa52ab18eb3504c4e0bc421c1d01b7981a (patch)
treea6bc4e37cef1bd805e45a40804dd11ef9493a4c3 /drivers/dma/dmatest.c
parent90b44f8ffdf6c66d190ee71b330009bf7f11a208 (diff)
dmaengine/dmatest: Terminate transfers on all channels in case of error or exit
In case, some error occurs while doing memcpy transfers, we must terminate all transfers physically too. This is achieved by calling device_control() routine with TERMINATE_ALL as parameter. This is also required to be done in case module is removed while we are in middle of some transfers. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dmatest.c')
-rw-r--r--drivers/dma/dmatest.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 765f5ff22304..accc18441b16 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -477,6 +477,8 @@ err_srcs:
477 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n", 477 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
478 thread_name, total_tests, failed_tests, ret); 478 thread_name, total_tests, failed_tests, ret);
479 479
480 /* terminate all transfers on specified channels */
481 chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
480 if (iterations > 0) 482 if (iterations > 0)
481 while (!kthread_should_stop()) { 483 while (!kthread_should_stop()) {
482 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit); 484 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
@@ -499,6 +501,10 @@ static void dmatest_cleanup_channel(struct dmatest_chan *dtc)
499 list_del(&thread->node); 501 list_del(&thread->node);
500 kfree(thread); 502 kfree(thread);
501 } 503 }
504
505 /* terminate all transfers on specified channels */
506 dtc->chan->device->device_control(dtc->chan, DMA_TERMINATE_ALL, 0);
507
502 kfree(dtc); 508 kfree(dtc);
503} 509}
504 510