From: Andy Shevchenko Date: Mon, 4 Mar 2013 09:09:25 +0000 (+0200) Subject: dmatest: cancel thread immediately when asked for X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=77101ce578bb365e44c2944d6c338c68206e6e10;p=linux-beck.git 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 Acked-by: Viresh Kumar Signed-off-by: Vinod Koul --- 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) } 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);