dmatest.txt 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
  12. folder with nodes will be created. There are two important files located. First
  13. is the 'run' node that controls run and stop phases of the test, and the second
  14. one, 'results', is used to get the test case results.
  15. Note that in this case test will not run on load automatically.
  16. Example of usage:
  17. % echo dma0chan0 > /sys/module/dmatest/parameters/channel
  18. % echo 2000 > /sys/module/dmatest/parameters/timeout
  19. % echo 1 > /sys/module/dmatest/parameters/iterations
  20. % echo 1 > /sys/kernel/debug/dmatest/run
  21. Hint: available channel list could be extracted by running the following
  22. command:
  23. % ls -1 /sys/class/dma/
  24. After a while you will start to get messages about current status or error like
  25. in the original code.
  26. Note that running a new test will not stop any in progress test.
  27. The following command should return actual state of the test.
  28. % cat /sys/kernel/debug/dmatest/run
  29. To wait for test done the user may perform a busy loop that checks the state.
  30. % while [ $(cat /sys/kernel/debug/dmatest/run) = "Y" ]
  31. > do
  32. > echo -n "."
  33. > sleep 1
  34. > done
  35. > echo
  36. Part 3 - When built-in in the kernel...
  37. The module parameters that is supplied to the kernel command line will be used
  38. for the first performed test. After user gets a control, the test could be
  39. re-run with the same or different parameters. For the details see the above
  40. section "Part 2 - When dmatest is built as a module..."
  41. In both cases the module parameters are used as the actual values for the test
  42. case. You always could check them at run-time by running
  43. % grep -H . /sys/module/dmatest/parameters/*
  44. Part 4 - Gathering the test results
  45. The module provides a storage for the test results in the memory. The gathered
  46. data could be used after test is done.
  47. The special file 'results' in the debugfs represents gathered data of the in
  48. progress test. The messages collected are printed to the kernel log as well.
  49. Example of output:
  50. % cat /sys/kernel/debug/dmatest/results
  51. dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
  52. The message format is unified across the different types of errors. A number in
  53. the parens represents additional information, e.g. error code, error counter,
  54. or status.
  55. Comparison between buffers is stored to the dedicated structure.
  56. Note that the verify result is now accessible only via file 'results' in the
  57. debugfs.