]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - Documentation/dmatest.txt
dmatest: cleanup redundant "dmatest: " prefixes
[mirror_ubuntu-zesty-kernel.git] / Documentation / dmatest.txt
CommitLineData
851b7e16
AS
1 DMA Test Guide
2 ==============
3
4 Andy Shevchenko <andriy.shevchenko@linux.intel.com>
5
6This small document introduces how to test DMA drivers using dmatest module.
7
8 Part 1 - How to build the test module
9
10The menuconfig contains an option that could be found by following path:
11 Device Drivers -> DMA Engine support -> DMA Test client
12
13In the configuration file the option called CONFIG_DMATEST. The dmatest could
14be built as module or inside kernel. Let's consider those cases.
15
16 Part 2 - When dmatest is built as a module...
17
18After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
872f05c6
DW
19folder with a file named 'run' nodes will be created. 'run' controls run and
20stop phases of the test.
851b7e16
AS
21
22Note that in this case test will not run on load automatically.
23
24Example of usage:
a6c268d0
AS
25 % echo dma0chan0 > /sys/module/dmatest/parameters/channel
26 % echo 2000 > /sys/module/dmatest/parameters/timeout
27 % echo 1 > /sys/module/dmatest/parameters/iterations
851b7e16
AS
28 % echo 1 > /sys/kernel/debug/dmatest/run
29
30Hint: available channel list could be extracted by running the following
31command:
32 % ls -1 /sys/class/dma/
33
872f05c6
DW
34Once started a message like "dmatest: Started 1 threads using dma0chan0" is
35emitted. After that only test failure messages are reported until the test
36stops.
851b7e16 37
bcc567e3 38Note that running a new test will not stop any in progress test.
851b7e16 39
3e5ccd86
AS
40The following command should return actual state of the test.
41 % cat /sys/kernel/debug/dmatest/run
42
43To wait for test done the user may perform a busy loop that checks the state.
44
45 % while [ $(cat /sys/kernel/debug/dmatest/run) = "Y" ]
46 > do
47 > echo -n "."
48 > sleep 1
49 > done
50 > echo
51
851b7e16
AS
52 Part 3 - When built-in in the kernel...
53
54The module parameters that is supplied to the kernel command line will be used
55for the first performed test. After user gets a control, the test could be
bcc567e3
AS
56re-run with the same or different parameters. For the details see the above
57section "Part 2 - When dmatest is built as a module..."
851b7e16 58
a6c268d0
AS
59In both cases the module parameters are used as the actual values for the test
60case. You always could check them at run-time by running
851b7e16 61 % grep -H . /sys/module/dmatest/parameters/*
95019c8c
AS
62
63 Part 4 - Gathering the test results
64
872f05c6 65Test results are printed to the kernel log buffer with the format:
95019c8c 66
872f05c6 67"dmatest: result <channel>: <test id>: '<error msg>' with src_off=<val> dst_off=<val> len=<val> (<err code>)"
95019c8c
AS
68
69Example of output:
872f05c6
DW
70 % dmesg | tail -n 1
71 dmatest: result dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
95019c8c
AS
72
73The message format is unified across the different types of errors. A number in
74the parens represents additional information, e.g. error code, error counter,
872f05c6
DW
75or status. A test thread also emits a summary line at completion listing the
76number of tests executed, number that failed, and a result code.
95019c8c 77
872f05c6
DW
78The details of a data miscompare error are also emitted, but do not follow the
79above format.