From patchwork Wed Sep 19 19:52:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10606435 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 4A66D112B for ; Wed, 19 Sep 2018 19:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AB052BA2A for ; Wed, 19 Sep 2018 19:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EB492BAA1; Wed, 19 Sep 2018 19:53:39 +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 90E912BA2A for ; Wed, 19 Sep 2018 19:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731858AbeITBdE (ORCPT ); Wed, 19 Sep 2018 21:33:04 -0400 Received: from mail-eopbgr00060.outbound.protection.outlook.com ([40.107.0.60]:27849 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731823AbeITBdE (ORCPT ); Wed, 19 Sep 2018 21:33:04 -0400 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=sGgma36xLPTvMMql8rDTOhH7NJ/zOzA5VFgKqYUYnMA=; b=CGTUNzvh9LCv/rYBMSZlLjFwO3pt213DDUxRbYBxiG7ig6opJ9n5wPQaGnT2i2FyDiqqeuHKfBb3DDk2RwQD0ZP8JHJAYTsiSKbDosfWXoTecVBG+l+zWLARuTArBJbBX1k2qjXVZfMfwTohqQkogOzgiUcy2EnZRI86oHohKxI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=seraj.mohammed@sondrel.com; Received: from Seraj-pc.hh.imgtec.org (195.88.9.101) by DB6P191MB0245.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Wed, 19 Sep 2018 19:53:29 +0000 From: Seraj Alijan To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, dan.j.williams@intel.com, james.hartley@sondrel.com, sifan.naeem@sondrel.com, ed.blake@sondrel.com, Seraj Alijan Subject: [PATCH V3 5/5] dmaengine: Documentation: Add documentation for multi chan testing Date: Wed, 19 Sep 2018 20:52:54 +0100 Message-Id: <1537386774-20749-6-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537386774-20749-1-git-send-email-seraj.alijan@sondrel.com> References: <1537386774-20749-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: CWLP265CA0040.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:11::28) To DB6P191MB0245.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d25c427c-9dfa-45d1-5ea0-08d61e6992a7 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DB6P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N2awCxNLw88lBU9DncALqUN/MIR1hH8vgJrhQJQ6hAIXqmRR6qMJL04+DL7SkF62Q8o97T1wLw2ljGfzDEX8EagnHwRD+/6u4mCKMPfKtoVvevyfzybpryQTI9O72umWbmMjuusWM0puV6UFbe/n9PVOx+18G8Rt4r3vA/ugqkHh4N+e6NHFwUvwi5qXymsDCSqBaU8uAlmvPGh4nZ8FPwucZXuQmBPbpZiINGPnZocmGzMFQAasxNdooEFQKAkET4mYseJ8b7zwZnwZVPnZmEjPFVjtGhvK6UoVxbsTnF4/iuOuiTsZfvG+vv6Pt07VEknkXpI0C2yBlwACYv3NsQj20iuPqc3hsJwmAM73e3tVb/YZlKhwoqtpq1C3bGAf98dLFNzGpo0xg8xI4Vy0tr7;4:p/eAKSFPQK715pyWaRUjTUZvXT4G0TMpUB6Zbe0ScqswGpIBvbpCe6lyog939ANFxT7N5salmfoGZspkb0Jd/3VQUHnNCJOG5Tz9KDFfNVb54B+WJsOMZ8UvwLSMwAyOgunuKWpkYtPt/bV7yIaPuch/TFYGlbNGB9FBFmN0gXEPTfVov+5GZ4BA1eTd7c3Nz8P6IEBeVrAcPln/lCqCmwonAyi8EBjAYRsA8e7IK590wkNaaDwaqZU7lx4F7uoWjeuzTZwt/pCqOyGgsHEyQw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:DB6P191MB0245;BCL:0;PCL:0;RULEID:;SRVR:DB6P191MB0245; X-Forefront-PRVS: 0800C0C167 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(366004)(396003)(136003)(376002)(346002)(189003)(199004)(316002)(16586007)(53936002)(25786009)(5660300001)(2351001)(76176011)(81166006)(50466002)(52116002)(51416003)(2906002)(36756003)(6916009)(6116002)(3846002)(14444005)(575784001)(48376002)(8936002)(386003)(478600001)(81156014)(6506007)(66066001)(97736004)(486006)(107886003)(2361001)(105586002)(106356001)(6666003)(6486002)(7736002)(6512007)(4326008)(47776003)(50226002)(956004)(16526019)(11346002)(476003)(186003)(2616005)(26005)(44832011)(446003)(68736007)(305945005)(8676002)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6P191MB0245;H:Seraj-pc.hh.imgtec.org;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: sondrel.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0245;23:KUpS3cYVg8aSufoCE8gqoeMmunWs4AEF+e7gYY8Fc0uVeINYtlUoewj2bWummqAIh5QoOz4pjTxoltHyXhcAxgv0mFpK6/e2DEx09DyoWlM+dInr2LPGAac15ML1PVpwz41bVB9YtBAaVzEykrJK2U0yX0dQMQ8g6euPLCNwWynsR5XQi684xmh/CJ2M2P12khtkKfXkGCloDFbzcfHikY18n/PTIxa6inTT/XEelosBoAg2jhfnsfZKfzx4IxsPC7uHtUsSOsc3EL+3vmGUqCf2tZa5+Qq3PXtCtsn3fn63hDtKJyKCID62Vysh2swX+FHj4qJ9MOCFrCvZRIMKsKUYEdfEJHyZ1Dgkb4bYdjC35UGI8p8p0UdX+HfIpVJLbQk2REU6Ly/lP4aBnLqKQeZ+jYcFKrvSEkhpkazr/ppiWBGnPsK/y9PoAMk06rGyhzmAi6lXdag62apVyvafa+NGQGoy6T7qSRNk+1WKncLMl7zT4xv0HfBgdH921Jqca0E3D9zmZwcl17wDBDH69FI+o7PMbMW0MWDnghUN3Kjj7NwbVNTR5EY0c81g8qi/fiQc3NBBimyZK3DyLEvzNDWKAGcqr+Tgo22uizynILV7mHakJqR59ivoFL0w6EPRg048j4kOk68sScxHGdKwDGfzJXxWsywojLdlQuFTCPGIBy/dFgFD2zhvIkjLbR9VBUispFIujGDRtDmG5ywivH1ljauK3QAJiPxdXAKn6umDYngiJBV5eOgqmHfa5ehm7+qak5+CIq9JU/cHHShFSH+ipVxjKVKjcM+Odkrgb4yb/euTEYccG++wG4Riwqt4Q8zy5wDOUd+VIfxMF/49reUcKNUXzZrpDR47Ffi+IevT/urMsSNul9ZIfK518Sp6Vi29q+KR53SB23oD3vQlfFci50k1CdDcBkwm8STrAyHiYjjNHsMQpmNiyBM5dTAT6H7+4DlkYwpUdHysjSPfJUXxTPdYbnzPvhHEfxZLfn56tvlnG1v3PepdUsyn9cnEjgR7lHjfKIRT3rDdOYHSs4bVGGhYv40bs87aI1rOB+QoTManoHnNwQdMikvILhKai6PQotA9GvyojvzhyJ6cB0xInV0NKo4GcHD+LW3xkjOkTlAE6Ob3NcRiuililjT5Jg6ul58DvvM/vXGd5B/HXDf902B4cSMmOW8rCNhazVX3VgeN73pb8MvCN9TvYQ96DLnVBOv5lNLWk2eiZX2jLgxVEnlCVMYwykpYhN63+9fobozFVACFRq9sh9XqadiJtLcrM8Dytvgqut3Hjybbhg== X-Microsoft-Antispam-Message-Info: c1nH9oPmDTo8sezbE0lk7bk1AgA5A0kOLglEELBJLv5htV5WhXgbDCMyCCRbPGwy8+gnVC1jJcw/8laAzpjPG2aRWXoNPwHAW0rWRrqGKLpiSPXAS50jVWLiajXQqi0q2Q4ZQ8Ja2YH7YiCjtisflroXf6YOL8WfDqxf2jDxeN4h+QVxVHe8YG5u21xgN+QMwJlF5EQeH5NBIOCD9czRRWXXrW4SFdXwHYOT0F9w3cS5eEa4Y7UUfRS6nXS+9QlS/W7985gkHexTnDfBRFACVjpjKGdArMSkGmdy7JyzO3TKlh5I14s5pBMO03Ymg0VASwEkIdYJEUKz+25gbd/ctYRxMsECCxf/+eE3Sn8tTTU= X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0245;6:q7e9r6I2FmT1wZvwhwK7My46eaQcaU4zgbj5V4NHOowovUZn0KPAdXgD2B6SHt7oLwlsHbEXndEytLL8lSAZX1NP0EabH2K8y1ljxqBs+UIod7oJ3F3GvqOfJuPCZxQMDdibT1JwUraTMGUcTpnMbl58tmICu7YpxB1iOKGdL9sNRP0BVx3kl5llBgGqubN6OealQtVQjP199A/lVd3dyvSli0Tzqid7d2dQOsjVDpAaJg1q5d76jI+ZmyVEuzzSvPEKkA5xaxRMg20Va74/7DTme59Z+cESjP9WvWAdf+uU9MUbYgfepY5jB6rX49PUSJAEK2HfgpX4sedg0tmDIG2T5HjMLFnCnUO2hOAX4VuOnXsB5NmlUzJkJLjyo5xqCi6kLtkOwHfKPdNBgKJO3E12AE7htODc87joc/U47Uw7zQ4TUyb9qYZh4rUG0cgv2lEqorvav7jkfrn6deFbJg==;5:VicUPCnMfUP/etdwYy6zzQ1xq4O937cVb4NQMvhZI4RHkS9ntuIqaKc5Cnz/pa9hS+02bJmXx0BFL2xNaNb59viDH5nkvrcpRHa9nNTA5dkGY6xfCe0hOgqgLFtM0bO2Ffp9Ox694sKnA6wgdDD3ea3E4agdjTwaHsSkdzeEtoY=;7:ah7b8VmiOKMjEz4RWk/xBTQsWt1Rf7Ybe92KfTtq8zLRMeMVL1BJXfg5PATwSkUEy/PHE+L0BkyoA27zPrOQwU3rUBol9ETg07U3eMRe46Z9fP8OJhOOldwwiKcfMdWtnHvFFRABNIp9Fetogmce5wDS7HIeWY2vnJnpOBt5rXvFspwY6Uo6Vc7o2hOgf1Gy7wyE7NO7CDNNFzSaLPYq4KSz8l41qvj1caNyshQyBIRi6nIl3uvaUXZYafgTFByQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2018 19:53:29.7943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d25c427c-9dfa-45d1-5ea0-08d61e6992a7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P191MB0245 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.