aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2013-03-04 04:09:25 -0500
committerVinod Koul <vinod.koul@intel.com>2013-04-15 00:21:16 -0400
commit77101ce578bb365e44c2944d6c338c68206e6e10 (patch)
tree2d8e089799af23ddaacd0fc401deb3d119a4b635 /drivers
parent9a37f644046c2f5b7889be642487e6f9dd58c5d7 (diff)
dmatest: cancel thread immediately when asked for
If user have the timeout alike issues and wants to cancel the thread immediately, the current call of wait_event_freezable_timeout is preventing to this until timeout is expired. Thus, user will experience the unnecessary delays. Adding kthread_should_stop() check inside wait_event_freezable_timeout() solves that. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/dmatest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index a2c8904b63ea..e6b4cfa1eb7f 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -454,7 +454,8 @@ static int dmatest_func(void *data)
454 } 454 }
455 dma_async_issue_pending(chan); 455 dma_async_issue_pending(chan);
456 456
457 wait_event_freezable_timeout(done_wait, done.done, 457 wait_event_freezable_timeout(done_wait,
458 done.done || kthread_should_stop(),
458 msecs_to_jiffies(timeout)); 459 msecs_to_jiffies(timeout));
459 460
460 status = dma_async_is_tx_complete(chan, cookie, NULL, NULL); 461 status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);