aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/dmatest.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index fc31542e7200..d19234b08342 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -93,6 +93,7 @@ struct dmatest_thread {
93 u8 **srcs; 93 u8 **srcs;
94 u8 **dsts; 94 u8 **dsts;
95 enum dma_transaction_type type; 95 enum dma_transaction_type type;
96 bool done;
96}; 97};
97 98
98struct dmatest_chan { 99struct dmatest_chan {
@@ -603,6 +604,8 @@ err_thread_type:
603 if (ret) 604 if (ret)
604 dmaengine_terminate_all(chan); 605 dmaengine_terminate_all(chan);
605 606
607 thread->done = true;
608
606 if (params->iterations > 0) 609 if (params->iterations > 0)
607 while (!kthread_should_stop()) { 610 while (!kthread_should_stop()) {
608 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit); 611 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
@@ -884,12 +887,28 @@ static ssize_t dtf_read_run(struct file *file, char __user *user_buf,
884{ 887{
885 struct dmatest_info *info = file->private_data; 888 struct dmatest_info *info = file->private_data;
886 char buf[3]; 889 char buf[3];
890 struct dmatest_chan *dtc;
891 bool alive = false;
887 892
888 mutex_lock(&info->lock); 893 mutex_lock(&info->lock);
889 if (info->nr_channels) 894 list_for_each_entry(dtc, &info->channels, node) {
895 struct dmatest_thread *thread;
896
897 list_for_each_entry(thread, &dtc->threads, node) {
898 if (!thread->done) {
899 alive = true;
900 break;
901 }
902 }
903 }
904
905 if (alive) {
890 buf[0] = 'Y'; 906 buf[0] = 'Y';
891 else 907 } else {
908 __stop_threaded_test(info);
892 buf[0] = 'N'; 909 buf[0] = 'N';
910 }
911
893 mutex_unlock(&info->lock); 912 mutex_unlock(&info->lock);
894 buf[1] = '\n'; 913 buf[1] = '\n';
895 buf[2] = 0x00; 914 buf[2] = 0x00;