public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.jf.intel.com>,
	linux-kernel@vger.kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 06/10] dmatest: run test via debugfs
Date: Tue, 05 Mar 2013 12:36:44 +0200	[thread overview]
Message-ID: <1362479804.28241.114.camel@smile> (raw)
In-Reply-To: <20130305092649.GD28136@intel.com>

On Tue, 2013-03-05 at 14:56 +0530, Vinod Koul wrote: 
> On Mon, Mar 04, 2013 at 11:09:30AM +0200, Andy Shevchenko wrote:
> > @@ -0,0 +1,48 @@
> > +				DMA Test Guide
> > +				==============
> > +
> > +		Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > +
> > +This small document introduces how to test DMA drivers using dmatest module.
> > +
> > +	Part 1 - How to build the test module
> > +
> > +The menuconfig contains an option that could be found by following path:
> > +	Device Drivers -> DMA Engine support -> DMA Test client
> > +
> > +In the configuration file the option called CONFIG_DMATEST. The dmatest could
> > +be built as module or inside kernel. Let's consider those cases.
> > +
> > +	Part 2 - When dmatest is built as a module...
> > +
> > +After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
> > +folder with nodes will be created. They are the same as module parameters with
> > +addition of the 'run' node that controls run and stop phases of the test.
> > +
> > +Note that in this case test will not run on load automatically.
> > +
> > +Example of usage:
> > +	% echo dma0chan0 > /sys/kernel/debug/dmatest/channel
> > +	% echo 2000 > /sys/kernel/debug/dmatest/timeout
> > +	% echo 1 > /sys/kernel/debug/dmatest/iterations
> > +	% echo 1 > /sys/kernel/debug/dmatest/run
> How do you terminate a test? Esp if you have started bunch of concurent tests
> and want to terminate one of them...

There is only one test in progress is possible.

To stop the test simple echo 0 > run (Probable that should be in
documentation as well)

> >  static struct dmatest_info test_info;
> > @@ -718,7 +729,7 @@ static bool filter(struct dma_chan *chan, void *param)
> >  		return true;
> >  }
> >  
> > -static int run_threaded_test(struct dmatest_info *info)
> > +static int __run_threaded_test(struct dmatest_info *info)
> >  {
> >  	dma_cap_mask_t mask;
> >  	struct dma_chan *chan;
> > @@ -744,7 +755,19 @@ static int run_threaded_test(struct dmatest_info *info)
> >  	return err;
> >  }
> >  
> > -static void stop_threaded_test(struct dmatest_info *info)
> > +#ifndef MODULE
> > +static int run_threaded_test(struct dmatest_info *info)
> > +{
> > +	int ret;
> > +
> > +	mutex_lock(&info->lock);
> > +	ret = __run_threaded_test(info);
> > +	mutex_unlock(&info->lock);
> > +	return ret;
> > +}
> > +#endif
> > +
> > +static void __stop_threaded_test(struct dmatest_info *info)
> >  {
> >  	struct dmatest_chan *dtc, *_dtc;
> >  	struct dma_chan *chan;
> > @@ -760,13 +783,234 @@ static void stop_threaded_test(struct dmatest_info *info)
> >  	info->nr_channels = 0;
> >  }
> >  
> > +static void stop_threaded_test(struct dmatest_info *info)
> > +{
> > +	mutex_lock(&info->lock);
> > +	__stop_threaded_test(info);
> > +	mutex_unlock(&info->lock);
> > +}
> > +
> > +static int __restart_threaded_test(struct dmatest_info *info, bool run)
> > +{
> > +	struct dmatest_params *params = &info->params;
> > +	int ret;
> > +
> > +	/* Stop any running test first */
> > +	__stop_threaded_test(info);
> > +
> > +	if (run == false)
> > +		return 0;
> > +
> > +	/* Copy test parameters */
> > +	memcpy(params, &info->dbgfs_params, sizeof(*params));
> what if the params are not yet filled by user... for module case?

Defaults are provided by constants in the top of file. They are copied
when module_init is called.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2013-03-05 10:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04  9:09 [PATCH 00/10] dmatest: update the module to use debugfs Andy Shevchenko
2013-03-04  9:09 ` [PATCH 01/10] dmatest: cancel thread immediately when asked for Andy Shevchenko
2013-03-05  1:41   ` Viresh Kumar
2013-03-04  9:09 ` [PATCH 02/10] dmatest: allocate memory for pq_coefs from heap Andy Shevchenko
2013-03-05  1:43   ` Viresh Kumar
2013-03-04  9:09 ` [PATCH 03/10] dmatest: create dmatest_info to keep test parameters Andy Shevchenko
2013-03-05  1:47   ` Viresh Kumar
2013-03-04  9:09 ` [PATCH 04/10] dmatest: move dmatest_channels and nr_channels to dmatest_info Andy Shevchenko
2013-03-05  9:03   ` Vinod Koul
2013-03-05  9:12   ` Viresh Kumar
2013-03-05  9:19     ` Andy Shevchenko
2013-03-04  9:09 ` [PATCH 05/10] dmatest: split test parameters to separate structure Andy Shevchenko
2013-03-05  9:16   ` Viresh Kumar
2013-03-08 13:07     ` Andy Shevchenko
2013-03-04  9:09 ` [PATCH 06/10] dmatest: run test via debugfs Andy Shevchenko
2013-03-05  9:26   ` Vinod Koul
2013-03-05 10:36     ` Andy Shevchenko [this message]
2013-03-05 10:35       ` Vinod Koul
     [not found]         ` <CAHp75Vc6KmPQYjSx5m+gEBCe4g2tRgEPKyg4hZx9ytk99pB7Qw@mail.gmail.com>
     [not found]           ` <20130307061143.GD13370@intel.com>
2013-03-07  8:37             ` Andy Shevchenko
2013-03-04  9:09 ` [PATCH 07/10] dmatest: return actual state in 'run' file Andy Shevchenko
2013-03-04  9:09 ` [PATCH 08/10] dmatest: define MAX_ERROR_COUNT constant Andy Shevchenko
2013-03-04  9:09 ` [PATCH 09/10] dmatest: gather test results in the linked list Andy Shevchenko
2013-11-05 19:58   ` Dan Williams
2013-11-06 14:13     ` Andy Shevchenko
2013-11-06 18:11       ` Dan Williams
2013-11-07 14:37         ` Andy Shevchenko
2013-03-04  9:09 ` [PATCH 10/10] dmatest: append verify result to results Andy Shevchenko
2013-03-07  6:20 ` [PATCH 00/10] dmatest: update the module to use debugfs Vinod Koul
2013-03-08 13:11   ` Andy Shevchenko
2013-03-10 13:44     ` Viresh Kumar
2013-03-11  8:12       ` Andy Shevchenko
2013-03-21  5:11 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362479804.28241.114.camel@smile \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.jf.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox