Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f80f9988 authored by Seraj Alijan's avatar Seraj Alijan Committed by Vinod Koul
Browse files

dmaengine: Documentation: Add documentation for multi chan testing



Modify documentation to add multi channel testing support.

Signed-off-by: default avatarSeraj Alijan <seraj.alijan@sondrel.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 13396a13
Loading
Loading
Loading
Loading
+103 −6
Original line number Diff line number Diff line
@@ -26,28 +26,43 @@ Part 2 - When dmatest is built as a module

Example of usage::

    % modprobe dmatest channel=dma0chan0 timeout=2000 iterations=1 run=1
    % modprobe dmatest timeout=2000 iterations=1 channel=dma0chan0 run=1

...or::

    % modprobe dmatest
    % echo dma0chan0 > /sys/module/dmatest/parameters/channel
    % echo 2000 > /sys/module/dmatest/parameters/timeout
    % echo 1 > /sys/module/dmatest/parameters/iterations
    % echo dma0chan0 > /sys/module/dmatest/parameters/channel
    % echo 1 > /sys/module/dmatest/parameters/run

...or on the kernel command line::

    dmatest.channel=dma0chan0 dmatest.timeout=2000 dmatest.iterations=1 dmatest.run=1
    dmatest.timeout=2000 dmatest.iterations=1 dmatest.channel=dma0chan0 dmatest.run=1

Example of multi-channel test usage:
    % modprobe dmatest
    % echo 2000 > /sys/module/dmatest/parameters/timeout
    % echo 1 > /sys/module/dmatest/parameters/iterations
    % echo dma0chan0 > /sys/module/dmatest/parameters/channel
    % echo dma0chan1 > /sys/module/dmatest/parameters/channel
    % echo dma0chan2 > /sys/module/dmatest/parameters/channel
    % echo 1 > /sys/module/dmatest/parameters/run

Note: the channel parameter should always be the last parameter set prior to
running the test (setting run=1), this is because upon setting the channel
parameter, that specific channel is requested using the dmaengine and a thread
is created with the existing parameters. This thread is set as pending
and will be executed once run is set to 1. Any parameters set after the thread
is created are not applied.
.. hint::
  available channel list could be extracted by running the following command::

    % ls -1 /sys/class/dma/

Once started a message like "dmatest: Started 1 threads using dma0chan0" is
emitted. After that only test failure messages are reported until the test
stops.
Once started a message like " dmatest: Added 1 threads using dma0chan0" is
emitted. A thread for that specific channel is created and is now pending, the
pending thread is started once run is to 1.

Note that running a new test will not stop any in progress test.

@@ -112,3 +127,85 @@ Example::

The details of a data miscompare error are also emitted, but do not follow the
above format.

Part 5 - Handling channel allocation
====================================

Allocating Channels
-------------------

Channels are required to be configured prior to starting the test run.
Attempting to run the test without configuring the channels will fail.

Example::

    % echo 1 > /sys/module/dmatest/parameters/run
    dmatest: Could not start test, no channels configured

Channels are registered using the "channel" parameter. Channels can be requested by their
name, once requested, the channel is registered and a pending thread is added to the test list.

Example::

    % echo dma0chan2 > /sys/module/dmatest/parameters/channel
    dmatest: Added 1 threads using dma0chan2

More channels can be added by repeating the example above.
Reading back the channel parameter will return the name of last channel that was added successfully.

Example::

    % echo dma0chan1 > /sys/module/dmatest/parameters/channel
    dmatest: Added 1 threads using dma0chan1
    % echo dma0chan2 > /sys/module/dmatest/parameters/channel
    dmatest: Added 1 threads using dma0chan2
    % cat /sys/module/dmatest/parameters/channel
    dma0chan2

Another method of requesting channels is to request a channel with an empty string, Doing so
will request all channels available to be tested:

Example::

    % echo "" > /sys/module/dmatest/parameters/channel
    dmatest: Added 1 threads using dma0chan0
    dmatest: Added 1 threads using dma0chan3
    dmatest: Added 1 threads using dma0chan4
    dmatest: Added 1 threads using dma0chan5
    dmatest: Added 1 threads using dma0chan6
    dmatest: Added 1 threads using dma0chan7
    dmatest: Added 1 threads using dma0chan8

At any point during the test configuration, reading the "test_list" parameter will
print the list of currently pending tests.

Example::

    % cat /sys/module/dmatest/parameters/test_list
    dmatest: 1 threads using dma0chan0
    dmatest: 1 threads using dma0chan3
    dmatest: 1 threads using dma0chan4
    dmatest: 1 threads using dma0chan5
    dmatest: 1 threads using dma0chan6
    dmatest: 1 threads using dma0chan7
    dmatest: 1 threads using dma0chan8

Note: Channels will have to be configured for each test run as channel configurations do not
carry across to the next test run.

Releasing Channels
-------------------

Channels can be freed by setting run to 0.

Example::
    % echo dma0chan1 > /sys/module/dmatest/parameters/channel
    dmatest: Added 1 threads using dma0chan1
    % cat /sys/class/dma/dma0chan1/in_use
    1
    % echo 0 > /sys/module/dmatest/parameters/run
    % cat /sys/class/dma/dma0chan1/in_use
    0

Channels allocated by previous test runs are automatically freed when a new
channel is requested after completing a successful test run.