lkml.org 
[lkml]   [2013]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 01/10] dmatest: cancel thread immediately when asked for
Date
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>
---
drivers/dma/dmatest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index a2c8904..e6b4cfa 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -454,7 +454,8 @@ static int dmatest_func(void *data)
}
dma_async_issue_pending(chan);

- wait_event_freezable_timeout(done_wait, done.done,
+ wait_event_freezable_timeout(done_wait,
+ done.done || kthread_should_stop(),
msecs_to_jiffies(timeout));

status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
--
1.8.2.rc0.22.gb3600c3


\
 
 \ /
  Last update: 2013-03-04 11:01    [W:0.265 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site