Skip to content

Commit

Permalink
dmatest: cancel thread immediately when asked for
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Vinod Koul committed Apr 15, 2013
1 parent 9a37f64 commit 77101ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/dma/dmatest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 77101ce

Please sign in to comment.