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