From patchwork Mon Dec 10 08:52:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10720859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10C4A91E for ; Mon, 10 Dec 2018 08:55:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01B2329C90 for ; Mon, 10 Dec 2018 08:55:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9C5129CD4; Mon, 10 Dec 2018 08:55:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 399B329C90 for ; Mon, 10 Dec 2018 08:55:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726572AbeLJIzn (ORCPT ); Mon, 10 Dec 2018 03:55:43 -0500 Received: from mail-eopbgr20076.outbound.protection.outlook.com ([40.107.2.76]:43088 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726531AbeLJIzm (ORCPT ); Mon, 10 Dec 2018 03:55:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sondrel.onmicrosoft.com; s=selector1-sondrel-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=axnPeyhnA/VQdCzNRHwE0tURHhSrIsmYNQS274xsGAE=; b=g6G0D5m6/AI2+gksfUrxTMuzGHppEmPbzzoscAqEpBmDANMNN3GiR9LFh6Wc0P87G5sHU/XYmwrwC2qxMFuLG48hymbBrvojljsJoAV4z64eWQROtp2qdjd4fY5/o2763tohSX/GOkhgNpn/NXjK8r9HP81ESFtOry7lAl4mFKY= Received: from VI1P191MB0255.EURP191.PROD.OUTLOOK.COM (10.172.82.20) by VI1P191MB0045.EURP191.PROD.OUTLOOK.COM (10.172.11.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Mon, 10 Dec 2018 08:52:42 +0000 Received: from VI1P191MB0255.EURP191.PROD.OUTLOOK.COM ([fe80::cc1:80a8:5ce5:9674]) by VI1P191MB0255.EURP191.PROD.OUTLOOK.COM ([fe80::cc1:80a8:5ce5:9674%2]) with mapi id 15.20.1404.025; Mon, 10 Dec 2018 08:52:42 +0000 From: Seraj Alijan To: "vkoul@kernel.org" CC: "dmaengine@vger.kernel.org" , "dan.j.williams@intel.com" , James Hartley , Sifan Naeem , Ed Blake , Seraj Mohammed Subject: [PATCH V4 5/5] dmaengine: Documentation: Add documentation for multi chan testing Thread-Topic: [PATCH V4 5/5] dmaengine: Documentation: Add documentation for multi chan testing Thread-Index: AQHUkGW2Mw3Pfp108kGrKVtXCO0U9A== Date: Mon, 10 Dec 2018 08:52:42 +0000 Message-ID: <1544431926-8662-6-git-send-email-seraj.alijan@sondrel.com> References: <1544431926-8662-1-git-send-email-seraj.alijan@sondrel.com> In-Reply-To: <1544431926-8662-1-git-send-email-seraj.alijan@sondrel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LNXP265CA0077.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::17) To VI1P191MB0255.EURP191.PROD.OUTLOOK.COM (2603:10a6:800:a7::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=seraj.mohammed@sondrel.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.88.9.101] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1P191MB0045;6:V98eyMMXLl4+WfIMQIejxRuSwGXJPkO2oTkU734DPmIvnkEqajF9tyc2azlMF8ztSASOqkiaomgfceU8+mVGozHTE344XITsVCGZSE5LRAELhND/gprFGawGR8kdQFWA3Ee0T7cbvm8bYkNw2t+nIIDOqUtjWcCEF2Nfvj8LasNvlj8mU602UzTfAoQRnaKzDNVam58DjKJKacGn7xilpx07Ps0hdlJ4Br97SVGJ6CguM1e+Bk7jxEo1VH/FHUbyXmwjMbjKbC4fxVXitDZ0+wuQIlMN+NXOA5VtEpaTXUBw7xUSp+1Oy1bwJ68LvAs70Z7xUssy8AIvzsOtaM+5wfq/f0Zd2jx9c7hEicgQ3k2ETRK1lR7hEa8KMkJE1NtmtbumsiDpGzF8u4v9HmHY9JtMym8WssgC8ymWUqfrMsg2iMsFNUGnXljy4qgK5J2V0Rar/cYG057NuZdfUVN4pg==;5:2ULaLCMyyD3Tk8STjgG8ekCR0qXFlom1YK6BsJrrXZK25hLun9gg/jKO64shPkP2ZOCn527pKE6cPNCtG/9hTxE5mldtVqxg7qFPKg6yWzM395CgMSfUSdqp/brZ/c44WFDwaQhNPTSCdk4n8TaKmvTu7crQef9wJ7+r6eGKsCk=;7:HTBWsySBxyKXEW1Wvg0dr/3M70AAh0jWPufpIO/rRsGSwpwdBkMjR3tUehJXQcSiW8nKux/0HQ4o+QOsuIX+04Bc+mwtd6cbhzK6C7fR7KqOvS3oVacrHypXjBRqLjQI1p5AO1TWIjJyUkQOazVcdw== x-ms-office365-filtering-correlation-id: 86cf25a4-e7ba-47a4-1b7c-08d65e7cd875 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1P191MB0045; x-ms-traffictypediagnostic: VI1P191MB0045: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231455)(999002)(944501520)(52105112)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:VI1P191MB0045;BCL:0;PCL:0;RULEID:;SRVR:VI1P191MB0045; x-forefront-prvs: 08828D20BC x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(39840400004)(366004)(346002)(376002)(199004)(189003)(26005)(25786009)(186003)(81166006)(8936002)(14444005)(36756003)(256004)(2616005)(1730700003)(11346002)(81156014)(446003)(2906002)(105586002)(8676002)(54906003)(106356001)(4326008)(2351001)(6116002)(99286004)(3846002)(97736004)(6916009)(6486002)(76176011)(53936002)(316002)(102836004)(478600001)(5640700003)(476003)(2501003)(107886003)(6506007)(386003)(52116002)(68736007)(7736002)(14454004)(6436002)(66066001)(575784001)(5660300001)(305945005)(6512007)(71200400001)(71190400001)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1P191MB0045;H:VI1P191MB0255.EURP191.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: sondrel.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: PBb9m6Kd9Bl761ZnBO0bM3axCkoE3CvtyZsXQC/s8cOrlrYJBmGagJnw4YPFjnY1XhsPAVUWLimFd45Yt3RXxj30DT32v6n+W0+nX4tC1gfELV5k30wWP4r6lqP1ptkxWh7+0yhM6DcM/aTOTIpF4OdkxMPYDNRRnIszWKwQhgykEUPEaNaljK3G6zBKBFfgFY/uqGM67ow/Su+HDul/bvScY1Hllm1KQGr9XqKjG46CsKTCZmgC4Wf6v6Ct4GfWaiOYEvCEyhxfGmizqhHUL2dcUN3zVebvblXhW2qy0i9C0tlFkFveDVqGucvH8iJ8 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86cf25a4-e7ba-47a4-1b7c-08d65e7cd875 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Dec 2018 08:52:42.3015 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P191MB0045 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Modify documentation to add multi channel testing support. Signed-off-by: Seraj Alijan --- Documentation/driver-api/dmaengine/dmatest.rst | 109 +++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 6 deletions(-) diff --git a/Documentation/driver-api/dmaengine/dmatest.rst b/Documentation/driver-api/dmaengine/dmatest.rst index 7ce5e71..dd5263a 100644 --- a/Documentation/driver-api/dmaengine/dmatest.rst +++ b/Documentation/driver-api/dmaengine/dmatest.rst @@ -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.