public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: dmatest: add a maximum number of test iterations
       [not found] <448c4e65b62b87188ff0beb21133b60435b1f6bd.1246641180.git.nicolas.ferre@atmel.com>
@ 2009-07-03 17:26 ` Nicolas Ferre
  2009-07-23  4:57   ` Dan Williams
  2009-07-07 14:24 ` Sosnowski, Maciej
  1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Ferre @ 2009-07-03 17:26 UTC (permalink / raw)
  To: dan.j.williams, maciej.sosnowski, avictor.za, linux-arm-kernel,
	haavard.skinnemoen
  Cc: patrice.vilchez, linux-kernel, nicolas.ferre

The dmatest usually waits for the killing of its kthreads to stop
running tests.  This patch adds a parameter that sets a maximum
number of test iterations.

This feature is quite interesting for debugging when you set a lot of
traces in your dmaengine controller driver.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 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 fb7da51..0131a1f 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -38,6 +38,11 @@ module_param(max_channels, uint, S_IRUGO);
 MODULE_PARM_DESC(max_channels,
 		"Maximum number of channels to use (default: all)");
 
+static unsigned int iteration_nbr = 0;
+module_param(iteration_nbr, uint, S_IRUGO);
+MODULE_PARM_DESC(iteration_nbr,
+		"Iteration number before stopping test (default: infinite)");
+
 static unsigned int xor_sources = 3;
 module_param(xor_sources, uint, S_IRUGO);
 MODULE_PARM_DESC(xor_sources,
@@ -270,7 +275,8 @@ static int dmatest_func(void *data)
 
 	flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT;
 
-	while (!kthread_should_stop()) {
+	while (!kthread_should_stop()
+	       && !(iteration_nbr && total_tests >= iteration_nbr)) {
 		struct dma_device *dev = chan->device;
 		struct dma_async_tx_descriptor *tx = NULL;
 		dma_addr_t dma_srcs[src_cnt];
@@ -416,6 +422,13 @@ err_srcbuf:
 err_srcs:
 	pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
 			thread_name, total_tests, failed_tests, ret);
+
+	if (iteration_nbr > 0)
+		while (!kthread_should_stop()) {
+			DECLARE_WAIT_QUEUE_HEAD(wait_dmatest_exit);
+			interruptible_sleep_on(&wait_dmatest_exit);
+		}
+
 	return ret;
 }
 
-- 
1.5.3.7


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] dmaengine: dmatest: add a maximum number of test iterations
       [not found] <448c4e65b62b87188ff0beb21133b60435b1f6bd.1246641180.git.nicolas.ferre@atmel.com>
  2009-07-03 17:26 ` [PATCH] dmaengine: dmatest: add a maximum number of test iterations Nicolas Ferre
@ 2009-07-07 14:24 ` Sosnowski, Maciej
  1 sibling, 0 replies; 4+ messages in thread
From: Sosnowski, Maciej @ 2009-07-07 14:24 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Williams, Dan J, avictor.za@gmail.com,
	linux-arm-kernel@lists.arm.linux.org.uk,
	haavard.skinnemoen@atmel.com, patrice.vilchez@atmel.com,
	linux-kernel@vger.kernel.org

Nicolas Ferre wrote:
> The dmatest usually waits for the killing of its kthreads to stop
> running tests.  This patch adds a parameter that sets a maximum
> number of test iterations.
> 
> This feature is quite interesting for debugging when you set a lot of
> traces in your dmaengine controller driver.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dmaengine: dmatest: add a maximum number of test  iterations
  2009-07-03 17:26 ` [PATCH] dmaengine: dmatest: add a maximum number of test iterations Nicolas Ferre
@ 2009-07-23  4:57   ` Dan Williams
  2009-07-23  8:40     ` Nicolas Ferre
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Williams @ 2009-07-23  4:57 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: maciej.sosnowski, avictor.za, linux-arm-kernel,
	haavard.skinnemoen, patrice.vilchez, linux-kernel, Andrew Morton

On Fri, Jul 3, 2009 at 10:26 AM, Nicolas Ferre<nicolas.ferre@atmel.com> wrote:
> The dmatest usually waits for the killing of its kthreads to stop
> running tests.  This patch adds a parameter that sets a maximum
> number of test iterations.
>
> This feature is quite interesting for debugging when you set a lot of
> traces in your dmaengine controller driver.
>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  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 fb7da51..0131a1f 100644
> --- a/drivers/dma/dmatest.c
> +++ b/drivers/dma/dmatest.c
> @@ -38,6 +38,11 @@ module_param(max_channels, uint, S_IRUGO);
>  MODULE_PARM_DESC(max_channels,
>                "Maximum number of channels to use (default: all)");
>
> +static unsigned int iteration_nbr = 0;
> +module_param(iteration_nbr, uint, S_IRUGO);
> +MODULE_PARM_DESC(iteration_nbr,
> +               "Iteration number before stopping test (default: infinite)");
> +

This is a minor nit, but for a user facing interface I don't think we
should export abbreviated variable names.  I'll apply this with the
following fixups:

s/iteration_nbr/iterations/
s/Iteration number/Iterations/

...as well as a fix for the checkpatch violation of initializing a static to 0.

Thanks,
Dan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dmaengine: dmatest: add a maximum number of test  iterations
  2009-07-23  4:57   ` Dan Williams
@ 2009-07-23  8:40     ` Nicolas Ferre
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2009-07-23  8:40 UTC (permalink / raw)
  To: Dan Williams
  Cc: maciej.sosnowski, avictor.za, linux-arm-kernel,
	haavard.skinnemoen, patrice.vilchez, linux-kernel, Andrew Morton

Dan Williams :
> On Fri, Jul 3, 2009 at 10:26 AM, Nicolas Ferre<nicolas.ferre@atmel.com> wrote:
>> The dmatest usually waits for the killing of its kthreads to stop
>> running tests.  This patch adds a parameter that sets a maximum
>> number of test iterations.
>>
>> This feature is quite interesting for debugging when you set a lot of
>> traces in your dmaengine controller driver.
>>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>>  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 fb7da51..0131a1f 100644
>> --- a/drivers/dma/dmatest.c
>> +++ b/drivers/dma/dmatest.c
>> @@ -38,6 +38,11 @@ module_param(max_channels, uint, S_IRUGO);
>>  MODULE_PARM_DESC(max_channels,
>>                "Maximum number of channels to use (default: all)");
>>
>> +static unsigned int iteration_nbr = 0;
>> +module_param(iteration_nbr, uint, S_IRUGO);
>> +MODULE_PARM_DESC(iteration_nbr,
>> +               "Iteration number before stopping test (default: infinite)");
>> +
> 
> This is a minor nit, but for a user facing interface I don't think we
> should export abbreviated variable names.  I'll apply this with the
> following fixups:
> 
> s/iteration_nbr/iterations/
> s/Iteration number/Iterations/
> 
> ...as well as a fix for the checkpatch violation of initializing a static to 0.

Ok fine.
(initialization to 0 has also been corrected by Andrew Morton in his
patch series).

Thanks Dan, Bye,
-- 
Nicolas Ferre


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-23  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <448c4e65b62b87188ff0beb21133b60435b1f6bd.1246641180.git.nicolas.ferre@atmel.com>
2009-07-03 17:26 ` [PATCH] dmaengine: dmatest: add a maximum number of test iterations Nicolas Ferre
2009-07-23  4:57   ` Dan Williams
2009-07-23  8:40     ` Nicolas Ferre
2009-07-07 14:24 ` Sosnowski, Maciej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox