Skip to content

Commit a310d03

Browse files
committed
dmatest: restore ability to start test at module load and init
1/ move 'run' control to a module parameter so we can do: modprobe dmatest run=1. With this moved the rest of the debugfs boilerplate can go. 2/ Fix parameter initialization. Previously the test was being started without taking the parameters into account in the built-in case. Also killed off the '__' version of some routines. The new rule is just hold the lock when calling a *threaded_test() routine. Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 0adff80 commit a310d03

File tree

2 files changed

+116
-167
lines changed

2 files changed

+116
-167
lines changed

Documentation/dmatest.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ be built as module or inside kernel. Let's consider those cases.
1515

1616
Part 2 - When dmatest is built as a module...
1717

18-
After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
19-
folder with a file named 'run' nodes will be created. 'run' controls run and
20-
stop phases of the test.
21-
22-
Note that in this case test will not run on load automatically.
23-
2418
Example of usage:
19+
% modprobe dmatest channel=dma0chan0 timeout=2000 iterations=1 run=1
20+
21+
...or:
22+
% modprobe dmatest
2523
% echo dma0chan0 > /sys/module/dmatest/parameters/channel
2624
% echo 2000 > /sys/module/dmatest/parameters/timeout
2725
% echo 1 > /sys/module/dmatest/parameters/iterations
28-
% echo 1 > /sys/kernel/debug/dmatest/run
26+
% echo 1 > /sys/module/dmatest/parameters/run
27+
28+
...or on the kernel command line:
29+
30+
dmatest.channel=dma0chan0 dmatest.timeout=2000 dmatest.iterations=1 dmatest.run=1
2931

3032
Hint: available channel list could be extracted by running the following
3133
command:
@@ -42,7 +44,7 @@ The following command should return actual state of the test.
4244

4345
To wait for test done the user may perform a busy loop that checks the state.
4446

45-
% while [ $(cat /sys/kernel/debug/dmatest/run) = "Y" ]
47+
% while [ $(cat /sys/module/dmatest/parameters/run) = "Y" ]
4648
> do
4749
> echo -n "."
4850
> sleep 1

0 commit comments

Comments
 (0)