Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273876
b: refs/heads/master
c: 981ed70
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Vinod Koul committed Aug 29, 2011
1 parent 6fdfed1 commit c2cc841
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57001a606f845ce2eda21a0f23e6aab20ee0cb04
refs/heads/master: 981ed70d8e4faf3689dbf3c48868a31d5b004d7a
17 changes: 15 additions & 2 deletions trunk/drivers/dma/dmatest.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/freezer.h>
#include <linux/init.h>
#include <linux/kthread.h>
#include <linux/module.h>
Expand Down Expand Up @@ -251,6 +252,7 @@ static int dmatest_func(void *data)
int i;

thread_name = current->comm;
set_freezable_with_signal();

ret = -ENOMEM;

Expand Down Expand Up @@ -305,7 +307,8 @@ static int dmatest_func(void *data)
dma_addr_t dma_srcs[src_cnt];
dma_addr_t dma_dsts[dst_cnt];
struct completion cmp;
unsigned long tmo = msecs_to_jiffies(timeout);
unsigned long start, tmo, end = 0 /* compiler... */;
bool reload = true;
u8 align = 0;

total_tests++;
Expand Down Expand Up @@ -404,7 +407,17 @@ static int dmatest_func(void *data)
}
dma_async_issue_pending(chan);

tmo = wait_for_completion_timeout(&cmp, tmo);
do {
start = jiffies;
if (reload)
end = start + msecs_to_jiffies(timeout);
else if (end <= start)
end = start + 1;
tmo = wait_for_completion_interruptible_timeout(&cmp,
end - start);
reload = try_to_freeze();
} while (tmo == -ERESTARTSYS);

status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);

if (tmo == 0) {
Expand Down

0 comments on commit c2cc841

Please sign in to comment.