aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/driver-api/dmaengine/dmatest.rst109
1 files changed, 103 insertions, 6 deletions
diff --git a/Documentation/driver-api/dmaengine/dmatest.rst b/Documentation/driver-api/dmaengine/dmatest.rst
index 7ce5e71c353e..dd5263a19c7b 100644
--- a/Documentation/driver-api/dmaengine/dmatest.rst
+++ b/Documentation/driver-api/dmaengine/dmatest.rst
@@ -26,28 +26,43 @@ Part 2 - When dmatest is built as a module
26 26
27Example of usage:: 27Example of usage::
28 28
29 % modprobe dmatest channel=dma0chan0 timeout=2000 iterations=1 run=1 29 % modprobe dmatest timeout=2000 iterations=1 channel=dma0chan0 run=1
30 30
31...or:: 31...or::
32 32
33 % modprobe dmatest 33 % modprobe dmatest
34 % echo dma0chan0 > /sys/module/dmatest/parameters/channel
35 % echo 2000 > /sys/module/dmatest/parameters/timeout 34 % echo 2000 > /sys/module/dmatest/parameters/timeout
36 % echo 1 > /sys/module/dmatest/parameters/iterations 35 % echo 1 > /sys/module/dmatest/parameters/iterations
36 % echo dma0chan0 > /sys/module/dmatest/parameters/channel
37 % echo 1 > /sys/module/dmatest/parameters/run 37 % echo 1 > /sys/module/dmatest/parameters/run
38 38
39...or on the kernel command line:: 39...or on the kernel command line::
40 40
41 dmatest.channel=dma0chan0 dmatest.timeout=2000 dmatest.iterations=1 dmatest.run=1 41 dmatest.timeout=2000 dmatest.iterations=1 dmatest.channel=dma0chan0 dmatest.run=1
42
43Example of multi-channel test usage:
44 % modprobe dmatest
45 % echo 2000 > /sys/module/dmatest/parameters/timeout
46 % echo 1 > /sys/module/dmatest/parameters/iterations
47 % echo dma0chan0 > /sys/module/dmatest/parameters/channel
48 % echo dma0chan1 > /sys/module/dmatest/parameters/channel
49 % echo dma0chan2 > /sys/module/dmatest/parameters/channel
50 % echo 1 > /sys/module/dmatest/parameters/run
42 51
52Note: the channel parameter should always be the last parameter set prior to
53running the test (setting run=1), this is because upon setting the channel
54parameter, that specific channel is requested using the dmaengine and a thread
55is created with the existing parameters. This thread is set as pending
56and will be executed once run is set to 1. Any parameters set after the thread
57is created are not applied.
43.. hint:: 58.. hint::
44 available channel list could be extracted by running the following command:: 59 available channel list could be extracted by running the following command::
45 60
46 % ls -1 /sys/class/dma/ 61 % ls -1 /sys/class/dma/
47 62
48Once started a message like "dmatest: Started 1 threads using dma0chan0" is 63Once started a message like " dmatest: Added 1 threads using dma0chan0" is
49emitted. After that only test failure messages are reported until the test 64emitted. A thread for that specific channel is created and is now pending, the
50stops. 65pending thread is started once run is to 1.
51 66
52Note that running a new test will not stop any in progress test. 67Note that running a new test will not stop any in progress test.
53 68
@@ -112,3 +127,85 @@ Example::
112 127
113The details of a data miscompare error are also emitted, but do not follow the 128The details of a data miscompare error are also emitted, but do not follow the
114above format. 129above format.
130
131Part 5 - Handling channel allocation
132====================================
133
134Allocating Channels
135-------------------
136
137Channels are required to be configured prior to starting the test run.
138Attempting to run the test without configuring the channels will fail.
139
140Example::
141
142 % echo 1 > /sys/module/dmatest/parameters/run
143 dmatest: Could not start test, no channels configured
144
145Channels are registered using the "channel" parameter. Channels can be requested by their
146name, once requested, the channel is registered and a pending thread is added to the test list.
147
148Example::
149
150 % echo dma0chan2 > /sys/module/dmatest/parameters/channel
151 dmatest: Added 1 threads using dma0chan2
152
153More channels can be added by repeating the example above.
154Reading back the channel parameter will return the name of last channel that was added successfully.
155
156Example::
157
158 % echo dma0chan1 > /sys/module/dmatest/parameters/channel
159 dmatest: Added 1 threads using dma0chan1
160 % echo dma0chan2 > /sys/module/dmatest/parameters/channel
161 dmatest: Added 1 threads using dma0chan2
162 % cat /sys/module/dmatest/parameters/channel
163 dma0chan2
164
165Another method of requesting channels is to request a channel with an empty string, Doing so
166will request all channels available to be tested:
167
168Example::
169
170 % echo "" > /sys/module/dmatest/parameters/channel
171 dmatest: Added 1 threads using dma0chan0
172 dmatest: Added 1 threads using dma0chan3
173 dmatest: Added 1 threads using dma0chan4
174 dmatest: Added 1 threads using dma0chan5
175 dmatest: Added 1 threads using dma0chan6
176 dmatest: Added 1 threads using dma0chan7
177 dmatest: Added 1 threads using dma0chan8
178
179At any point during the test configuration, reading the "test_list" parameter will
180print the list of currently pending tests.
181
182Example::
183
184 % cat /sys/module/dmatest/parameters/test_list
185 dmatest: 1 threads using dma0chan0
186 dmatest: 1 threads using dma0chan3
187 dmatest: 1 threads using dma0chan4
188 dmatest: 1 threads using dma0chan5
189 dmatest: 1 threads using dma0chan6
190 dmatest: 1 threads using dma0chan7
191 dmatest: 1 threads using dma0chan8
192
193Note: Channels will have to be configured for each test run as channel configurations do not
194carry across to the next test run.
195
196Releasing Channels
197-------------------
198
199Channels can be freed by setting run to 0.
200
201Example::
202 % echo dma0chan1 > /sys/module/dmatest/parameters/channel
203 dmatest: Added 1 threads using dma0chan1
204 % cat /sys/class/dma/dma0chan1/in_use
205 1
206 % echo 0 > /sys/module/dmatest/parameters/run
207 % cat /sys/class/dma/dma0chan1/in_use
208 0
209
210Channels allocated by previous test runs are automatically freed when a new
211channel is requested after completing a successful test run.