dmatest.txt 2.8 KB

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