diff options
| -rw-r--r-- | drivers/dma/dmatest.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index cec1ec0b7d00..2d973d60e7b9 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
| @@ -38,6 +38,11 @@ module_param(max_channels, uint, S_IRUGO); | |||
| 38 | MODULE_PARM_DESC(max_channels, | 38 | MODULE_PARM_DESC(max_channels, |
| 39 | "Maximum number of channels to use (default: all)"); | 39 | "Maximum number of channels to use (default: all)"); |
| 40 | 40 | ||
| 41 | static unsigned int iterations; | ||
| 42 | module_param(iterations, uint, S_IRUGO); | ||
| 43 | MODULE_PARM_DESC(iterations, | ||
| 44 | "Iterations before stopping test (default: infinite)"); | ||
| 45 | |||
| 41 | static unsigned int xor_sources = 3; | 46 | static unsigned int xor_sources = 3; |
| 42 | module_param(xor_sources, uint, S_IRUGO); | 47 | module_param(xor_sources, uint, S_IRUGO); |
| 43 | MODULE_PARM_DESC(xor_sources, | 48 | MODULE_PARM_DESC(xor_sources, |
| @@ -270,7 +275,8 @@ static int dmatest_func(void *data) | |||
| 270 | 275 | ||
| 271 | flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT; | 276 | flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT; |
| 272 | 277 | ||
| 273 | while (!kthread_should_stop()) { | 278 | while (!kthread_should_stop() |
| 279 | && !(iterations && total_tests >= iterations)) { | ||
| 274 | struct dma_device *dev = chan->device; | 280 | struct dma_device *dev = chan->device; |
| 275 | struct dma_async_tx_descriptor *tx = NULL; | 281 | struct dma_async_tx_descriptor *tx = NULL; |
| 276 | dma_addr_t dma_srcs[src_cnt]; | 282 | dma_addr_t dma_srcs[src_cnt]; |
| @@ -416,6 +422,13 @@ err_srcbuf: | |||
| 416 | err_srcs: | 422 | err_srcs: |
| 417 | pr_notice("%s: terminating after %u tests, %u failures (status %d)\n", | 423 | pr_notice("%s: terminating after %u tests, %u failures (status %d)\n", |
| 418 | thread_name, total_tests, failed_tests, ret); | 424 | thread_name, total_tests, failed_tests, ret); |
| 425 | |||
| 426 | if (iterations > 0) | ||
| 427 | while (!kthread_should_stop()) { | ||
| 428 | DECLARE_WAIT_QUEUE_HEAD(wait_dmatest_exit); | ||
| 429 | interruptible_sleep_on(&wait_dmatest_exit); | ||
| 430 | } | ||
| 431 | |||
| 419 | return ret; | 432 | return ret; |
| 420 | } | 433 | } |
| 421 | 434 | ||
