From patchwork Fri Aug 31 11:03:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10583611 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 6709B112B for ; Fri, 31 Aug 2018 11:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5437D2B486 for ; Fri, 31 Aug 2018 11:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 463C62B55E; Fri, 31 Aug 2018 11:04:23 +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 92A3E2B486 for ; Fri, 31 Aug 2018 11:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbeHaPLS (ORCPT ); Fri, 31 Aug 2018 11:11:18 -0400 Received: from mail-eopbgr70079.outbound.protection.outlook.com ([40.107.7.79]:53464 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726990AbeHaPLS (ORCPT ); Fri, 31 Aug 2018 11:11:18 -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=H7x+bM4a3havTmfBhWKTjWCm4ace46kVb16R64lKuVk=; b=MOmnjQmfG6MJNlCwFfFsorJHGRNqqCWHqLgzEiJMUC8P3uJTzi90wiHxGrfvZ1go+U6UewHu0G61PAXfU1KDs6ZTSEUWnm49Y0E7ebRoftEU0jX7RM03mBZuuLqaVwbNrLKENyHnAnjjS/OVWocfET42vtBkozLxzzeTtvhyv2w= 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 AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Fri, 31 Aug 2018 11:04:15 +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 V2 1/5] dmaengine: dmatest: Add support for multi channel testing Date: Fri, 31 Aug 2018 12:03:40 +0100 Message-Id: <1535713424-11322-2-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> References: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: VI1P195CA0048.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::37) To AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 64a2e904-ef71-48ba-a35d-08d60f317dfc X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM4P191MB0243; X-Microso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ZTsfuCfEcKfQtXCylSl3XRSvsVg97nJGfmAcZAB+z4O+SwRSG564KQN+T3SVcxciGh0Fz8VN+xZaQFyTG8wruSI4Dz1eQz1Q/HKuhLZa/qj9I/tQQvL24rI6gJ2gmdpdHaBc4FZqUzNJCD4JvJwuW4y+oX+XtYjHwp5LM+UEeiKlzQh1HnLxt4BCRNHLMqq8n4PYH2jLG/Od6XoAyBlQT0u5IB/b0Qarb+DBORCBDYstUBg3Ly00HMXdT9QIyAKLMYQ2mCRHK1dRIOPOo2zvEwh1G00vr4ZwfiHPfO7mtBx1bxtdMbGaX+g7TFech3ftr0pxBe7O9gU0T47z5yNeEgHjOCzZV18zfMZCEui2SJD0C2jUBMwUb;4:GP9C340j9cwlBUI8EIJ7B2SKxgzMsyeNDw+vGx0+qstHQs3oZ5pKTsiz7UkJoNYRXMOaRU1xzej60tJCLPXWP9WFu89NeRD0n9ONSBUTTfIjUQuzV9mDAjBndVh93KNeeI5v3d/F+YLhGMe3wFx5sSJe8U9rc35SlZqynLwm3p+1B2Ztkrs9eOFRh+OON2kjPKGWnhcD4mm45ImpyxGlDESH6UpjIqdUrTMJbAjWkMBqc0Oaq5jXHKKwl5ymZBS1irDCT76KLTVL+P5sxaSJyA== 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699016);SRVR:AM4P191MB0243;BCL:0;PCL:0;RULEID:;SRVR:AM4P191MB0243; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(396003)(346002)(366004)(376002)(136003)(199004)(189003)(6916009)(6486002)(386003)(5660300001)(6666003)(53936002)(478600001)(6506007)(4326008)(16586007)(6512007)(25786009)(97736004)(14444005)(305945005)(107886003)(52116002)(51416003)(48376002)(76176011)(7736002)(50466002)(81166006)(36756003)(81156014)(8936002)(3846002)(16526019)(316002)(66066001)(26005)(2351001)(6116002)(50226002)(2906002)(106356001)(446003)(68736007)(11346002)(186003)(105586002)(2361001)(486006)(47776003)(8676002)(2616005)(956004)(476003)(44832011)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4P191MB0243;H:Seraj-pc.hh.imgtec.org;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-Exchange-Diagnostics: 1;AM4P191MB0243;23:HOyV3F1ST5gw5YrsN7/cYV5ULD504IL9hFDUbJDcbG/viyWbafMxLcBWIwGr0J31JlYLzcvdOKemhhhm3PmNTqnyYvNgLxC3Q7VUY7sajRVA8R5oEzvBpjDBe+mcQaEduL12uC91jUvYn1OMhU6RudBhQhEquKTRCoJjc3jPpyxbq2kyYtH/QE/O+GT+EpSAQExMlEmuxv1gvj0j0chnoenV/+qzaJrVqqHBBvoDYumqyWj9zEzVGirobCDjVhmkM6z9h19vyW03HV8Y8WS5ezAhN3bwW9m14RfUGeOpDHOA4gEuIjbdG40wfC5DH3aPqAubQeU3153nxtAvmN4B2EhzWIgLvZRxKiUYFGbJXwPSs8yQ/7g2pwrUZzRtmoeGrfnXU8/TKSsdQ/MzEIdAx5p4YXf2ISb6tVfcF7YMdNFPaQAcKUrFORpzwLAlTGdexvwg9FubjoWxTQmGO66jBVUjUwYoe66rJ1/PRfdrBaERC2B1v8Qf8FNzZPw7rJj3FS8JBmWEoPEeQU1iexw9IzVxZ/GSwVqbDlVa+88+W3BizUe5q1p6LiwhV/ABiRFNItLS8n2Vx/CTKvRINIOYaZYAKlVP+Q3UvBRTaNm9FZZDXMZRPxgnyfXmVJy3clcBM58xhOGELo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LR8aaLHGtm2PeDUQ7TUQgb1QOE5ak0E7Z05neIDcGaUhZqXVHbiDyU3BjE+CCJ4kTBKc5IW1L7QTnXDUiQnCeApQEsY6oXzds72IDDLHZpfTd9P05Yoh+pGZX1jiF0dpk3aPNKunH2lZ3c7BPHuJTGjDPqaLS3I+ZWrW76i4DSOtuC/Pu6/ngdE2/lbpIZU3IIE/iU1rP7ipIho4Zewt/TTrG1VEgLwhOEBRh/rva2/JLW+kNpTt6o8kB7bsoysoZo5grCgO5QZeaDVXzFy8tFrUkC+foJvXKq4+n0OXNeslYZAHUD6dXxi0qo8LVGO6OvsnwUbWEYNtNPL6nnCpgdWm6zNMNsxEwIHzTVuidPB4AKqxVzSeJhfJApf2XUCkovDoVHes/NoEsYTZ40gX7DZ40zez6lHMMKtXMYtS4VuqstIqQgBylKlqS/85sVzIvYMA==;5:5493X45CwecFpYQq4nlwVfuKRPNhPogVytw+cYRY/2uohA96pz4EPXByeMIF6jnp2T6qNMYIFK6vHIH2Rwo/IMMxv/tH4I0vGq8Y69wg065Ph7sei44ulrPi7Mi91kELno6yzzBMgYj5xjO0/EQlWuOVw1d+f6ydCym0xiWWI20=;7:IE+vfnEVcruMhaUp2KXqM5MGN8g+WDWTax/bJmUXHp6gZrpp3NRLOkAOMn2wgqsjL41RMJZZmPf8C0evP9uOxPZpNl0Va1UoUcvutgbZM2S00HnN+LIhArD1KVmYyxzQ2kim3jxrCDzdS8gKOfmc29WAVDaRZKmuK98dh/hFVMVYdSsnOPyDn7KAgzgSAJSE9JVFj4kXPrPqDncwYQso37Wc54r4L7qDu9P4aGICx4kOj+MjUoN5/reOy5tnMCdo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 11:04:15.6339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64a2e904-ef71-48ba-a35d-08d60f317dfc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P191MB0243 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for running tests on multiple channels simultaneously as the driver currently limits to 1 channel per test run. This will add support for stress testing DMA controllers with multi channel capabilities. This is done by adding a callback function to the "channel" parameter that registers the requested channel prior to the "run" parameter being set to 1. Each time the "channel" parameter is populated with a new dma channel, a new test is appended to the thread queue. Once the "run" parameter is set to 1, the test will kick start all pending threads. Signed-off-by: Seraj Alijan --- drivers/dma/dmatest.c | 109 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 89 insertions(+), 20 deletions(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index aa1712b..8ce3b06 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -27,11 +27,6 @@ static unsigned int test_buf_size = 16384; module_param(test_buf_size, uint, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(test_buf_size, "Size of the memcpy test buffer"); -static char test_channel[20]; -module_param_string(channel, test_channel, sizeof(test_channel), - S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(channel, "Bus ID of the channel to test (default: any)"); - static char test_device[32]; module_param_string(device, test_device, sizeof(test_device), S_IRUGO | S_IWUSR); @@ -139,6 +134,21 @@ static bool dmatest_run; module_param_cb(run, &run_ops, &dmatest_run, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(run, "Run the test (default: false)"); +static int dmatest_chan_set(const char *val, const struct kernel_param *kp); +static int dmatest_chan_get(char *val, const struct kernel_param *kp); +static const struct kernel_param_ops multi_chan_ops = { + .set = dmatest_chan_set, + .get = dmatest_chan_get, +}; + +static char test_channel[20]; +static struct kparam_string newchan_kps = { + .string = test_channel, + .maxlen = 20, +}; +module_param_cb(channel, &multi_chan_ops, &newchan_kps, 0644); +MODULE_PARM_DESC(channel, "Bus ID of the channel to test (default: any)"); + /* Maximum amount of mismatched bytes in buffer to print */ #define MAX_ERROR_COUNT 32 @@ -179,6 +189,7 @@ struct dmatest_thread { wait_queue_head_t done_wait; struct dmatest_done test_done; bool done; + bool pending; }; struct dmatest_chan { @@ -206,6 +217,22 @@ static bool is_threaded_test_run(struct dmatest_info *info) return false; } +static bool is_threaded_test_pending(struct dmatest_info *info) +{ + struct dmatest_chan *dtc; + + list_for_each_entry(dtc, &info->channels, node) { + struct dmatest_thread *thread; + + list_for_each_entry(thread, &dtc->threads, node) { + if (thread->pending) + return true; + } + } + + return false; +} + static int dmatest_wait_get(char *val, const struct kernel_param *kp) { struct dmatest_info *info = &test_info; @@ -476,6 +503,7 @@ static int dmatest_func(void *data) ret = -ENOMEM; smp_rmb(); + thread->pending = false; info = thread->info; params = &info->params; chan = thread->chan; @@ -886,7 +914,7 @@ static int dmatest_add_threads(struct dmatest_info *info, /* srcbuf and dstbuf are allocated by the thread itself */ get_task_struct(thread->task); list_add_tail(&thread->node, &dtc->threads); - wake_up_process(thread->task); + thread->pending = true; } return i; @@ -932,7 +960,7 @@ static int dmatest_add_channel(struct dmatest_info *info, thread_count += cnt > 0 ? cnt : 0; } - pr_info("Started %u threads using %s\n", + pr_info("Added %u threads using %s\n", thread_count, dma_chan_name(chan)); list_add_tail(&dtc->node, &info->channels); @@ -977,7 +1005,7 @@ static void request_channels(struct dmatest_info *info, } } -static void run_threaded_test(struct dmatest_info *info) +static void add_threaded_test(struct dmatest_info *info) { struct dmatest_params *params = &info->params; @@ -1000,6 +1028,19 @@ static void run_threaded_test(struct dmatest_info *info) request_channels(info, DMA_PQ); } +static void run_pending_tests(struct dmatest_info *info) +{ + struct dmatest_chan *dtc; + + list_for_each_entry(dtc, &info->channels, node) { + struct dmatest_thread *thread; + + list_for_each_entry(thread, &dtc->threads, node) { + wake_up_process(thread->task); + } + } +} + static void stop_threaded_test(struct dmatest_info *info) { struct dmatest_chan *dtc, *_dtc; @@ -1016,7 +1057,7 @@ static void stop_threaded_test(struct dmatest_info *info) info->nr_channels = 0; } -static void restart_threaded_test(struct dmatest_info *info, bool run) +static void start_threaded_tests(struct dmatest_info *info) { /* we might be called early to set run=, defer running until all * parameters have been evaluated @@ -1024,11 +1065,7 @@ static void restart_threaded_test(struct dmatest_info *info, bool run) if (!info->did_init) return; - /* Stop any running test first */ - stop_threaded_test(info); - - /* Run test with new parameters */ - run_threaded_test(info); + run_pending_tests(info); } static int dmatest_run_get(char *val, const struct kernel_param *kp) @@ -1039,7 +1076,8 @@ static int dmatest_run_get(char *val, const struct kernel_param *kp) if (is_threaded_test_run(info)) { dmatest_run = true; } else { - stop_threaded_test(info); + if (!is_threaded_test_pending(info)) + stop_threaded_test(info); dmatest_run = false; } mutex_unlock(&info->lock); @@ -1057,18 +1095,48 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp) if (ret) { mutex_unlock(&info->lock); return ret; + } else if (dmatest_run && is_threaded_test_pending(info)) { + start_threaded_tests(info); } - if (is_threaded_test_run(info)) - ret = -EBUSY; - else if (dmatest_run) - restart_threaded_test(info, dmatest_run); + mutex_unlock(&info->lock); + + return ret; +} + +static int dmatest_chan_set(const char *val, const struct kernel_param *kp) +{ + struct dmatest_info *info = &test_info; + int ret; + mutex_lock(&info->lock); + ret = param_set_copystring(val, kp); + if (ret) { + mutex_unlock(&info->lock); + return ret; + } + if (!is_threaded_test_run(info) && !is_threaded_test_pending(info)) + stop_threaded_test(info); + add_threaded_test(info); mutex_unlock(&info->lock); return ret; } +static int dmatest_chan_get(char *val, const struct kernel_param *kp) +{ + struct dmatest_info *info = &test_info; + + mutex_lock(&info->lock); + if (!is_threaded_test_run(info) && !is_threaded_test_pending(info)) { + stop_threaded_test(info); + strlcpy(test_channel, "", sizeof(test_channel)); + } + mutex_unlock(&info->lock); + + return param_get_string(val, kp); +} + static int __init dmatest_init(void) { struct dmatest_info *info = &test_info; @@ -1076,7 +1144,8 @@ static int __init dmatest_init(void) if (dmatest_run) { mutex_lock(&info->lock); - run_threaded_test(info); + add_threaded_test(info); + run_pending_tests(info); mutex_unlock(&info->lock); } From patchwork Fri Aug 31 11:03:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10583613 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 22CAD13AC for ; Fri, 31 Aug 2018 11:04:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 102092B486 for ; Fri, 31 Aug 2018 11:04:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 047F02B55E; Fri, 31 Aug 2018 11:04:30 +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 8F4202B486 for ; Fri, 31 Aug 2018 11:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727741AbeHaPLZ (ORCPT ); Fri, 31 Aug 2018 11:11:25 -0400 Received: from mail-eopbgr60067.outbound.protection.outlook.com ([40.107.6.67]:41216 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726990AbeHaPLZ (ORCPT ); Fri, 31 Aug 2018 11:11:25 -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=s6odmDxp7LgTxT9anY07sJ3vGJOKaf7hnYq2OxeXt/w=; b=P1OdJn7ULyxEKF20sgVAuJiPUFM89mFeOQGpOrN3VN9fX+1dojcjcbJc6hjt0weUKx2tO9NekScAhHyBFAmJOdriEYre2Q/ZSnkTLIKpUhzMPPN2yg6AQ9JSJt/rUShIGWQzAxJNy8BCRfECtARt9idcMSZ5kzenfS9n1s4BGHM= 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 AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Fri, 31 Aug 2018 11:04:24 +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 V2 2/5] dmaengine: dmatest: Use fixed point div to calculate iops Date: Fri, 31 Aug 2018 12:03:41 +0100 Message-Id: <1535713424-11322-3-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> References: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: VI1P195CA0048.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::37) To AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30b7d083-cde3-4ec7-a00a-08d60f31830d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM4P191MB0243; X-Microsoft-Exchange-Diagnostics: 1;AM4P191MB0243;3:OSA5h3OH0vMh9GrDaGy5L4IQtABAl4O/iA55CDSBPmCvAuNfaATCb/JhKd98ul4LtVMUiviExSErcE9ChqQcAMpMVqh7QCp4T0Ha1ug1A9GZslSvebA62+bvC/wyD+E2fwSELHFByoNMBkfM0GKcayV/NvP8n4fVsMZ6wlRkYt+sibrOF/QQvLKxR1dwQ52aRP6iK+mBCe+x56pPdZNBsWfLKF49TbUVgN9HmDmz3wFQ2PBlJ4pYnW9hBkMR2jUH;25:EA97eHNYb9msC4CcW4Osl9cANyTAEqg9CizNTkO6LJcymqSEkaRQS/6hpWqEEJQRB8r8PqLl+waLT4DPA9+wUpBJg5MQt9Wa0DzgQ5D6YcyxijhkPwgawfAQNE0K8ddW2AQasDnhbMoVnuh5HGv6/6O5Y/sEpoS+KtE8VedWyg3KFPfCcm4HyEJUq4tCPN1NDyZ8rx/WCYXBU6YseJyf5Xay0ItyFfkTKHuHeqntjePOvW/wu0vcKqtQ4yx3QzNBq1tMFdD0CvCCSrP6iTUF803Tj5bUd3JyX7jXjMi7/eCH1W2Sx+BK6XvDu0gJj9MiVeqDOsUgNnDpm+rroognGw==;31:h3E+UILeBrtH+FIBFa/FKrAl909vOussPlU4ZDvanpMw7JAe4L+O1nvVz3yCpQywwrc0ANeXrFb6zWc8axIqHx3O1g50+c8JV/jlxsjzw0u/4B3hTnikCTirgfCaqiYFzN5ppPmRHr9cyltyOTVbgpr7TKABBIkWMlAwoFCjQro6mDPFNdRKy6PojAp1vS5mEQZW7U6L52uT/HA/HMFxZo71vXBmrGq3o6z5sMQbJxg= X-MS-TrafficTypeDiagnostic: AM4P191MB0243: X-Microsoft-Exchange-Diagnostics: 1;AM4P191MB0243;20:/QHgnIo1EBjCGWFH3svPO7n3SEkigduUNALRvdwhaH7tfjQI8lx56K9I9hdDoTq7mRkOBs3u3l4an4lBJXz9C3/1b2eDTiazQjuDSUe07NrlMremF9ddbGhvf6p2QbGSEnf3+Ez36G+cktUBaN3OSj81g0BL0NvSgHpzJUXACJMhrkF4QshyyLpuISu0eZTQo4lLEUcgPDofBtiYvbVYu/3uCImyAIDLoyVMLEKYjV1lJyj44FPKU+R/mQWoavq/Qi9sKFfPCVjsyEypebSi3plVaYH0BpDR6TZdaxzeGynBRzyM+IC5kK760GPOeJFk+eb98HM2bEotyQlJl0LSiT7CcdsLcz9fsm+7y91A8dfiJzu0giK7a9rLqwcME/gz+QpDmaPg+PHc0jUkWZRWa/Nb1hffDwwEFhzQbk2I/qG2KflekHGFEjHTBMrQD/MpT7jhB+QWEErFc7R4Jlrcir05qeWw+gLluH2wabIlxFIzbjGl2BZ2iFfS+aqoRZq6;4:QHgcleH9kT0XJrJKOWAc5C8j6SGfzCs5Ml1R/Mn1oeMN6WBgbTFzP0OCmpDX3A9JI3Geljq/hdsSzuMffBDh3a3mxJAQbgI5MXLaHhEiBl2CW9he+q79RE4UTuGW47bxwTtfdUcA70/89JmmjwKv/xsHDwJx8su2dWsobcpofUVUWZjpDrxb7y9TqFfLrJ55Xfvszgqu+9NIQW2oWvk9d3OWgaAeKDMDTQLvftRnaQGwloPeZIkXDKl3BFa/7d4YKm5HWk21LSdnxzJBAyQfp8y4/q7P1+4xBqEDv5aLyZsVwNDODLW70SXCVJmeywFC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211171220733660); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699016);SRVR:AM4P191MB0243;BCL:0;PCL:0;RULEID:;SRVR:AM4P191MB0243; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(396003)(346002)(366004)(376002)(136003)(199004)(189003)(6916009)(6486002)(386003)(5660300001)(6666003)(53936002)(478600001)(6506007)(4326008)(16586007)(6512007)(25786009)(97736004)(14444005)(305945005)(107886003)(52116002)(51416003)(48376002)(76176011)(7736002)(50466002)(81166006)(36756003)(81156014)(8936002)(3846002)(16526019)(316002)(66066001)(26005)(2351001)(6116002)(50226002)(2906002)(106356001)(446003)(68736007)(11346002)(186003)(105586002)(2361001)(486006)(47776003)(8676002)(2616005)(956004)(476003)(44832011)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4P191MB0243;H:Seraj-pc.hh.imgtec.org;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-Exchange-Diagnostics: 1;AM4P191MB0243;23:euZ54xmJRnok7tpO4vZvwtWuTUCgOKjVCsfM/ZzskPYDWJTtagSBTFUqAsm/1DeLKGbmjQ2KjdS/Pwz39u27vVH/vP+BhpQw2I7idNUvxUa/oOOXNrkWNEUj9j/vtWBjnJXP7cnHdCzEyrEGHwKEzBPeEADxFIervp70iyC2WqyyFHacqkKNCO84UzJsQTaNy67QAHkb27ov42wrbaa9n3IZGu1BE9bBT65/AIFS+GJydmMDYBVDfu+NfzC8D+G+xJMg2kUHLOILa1+5Qlj77jjuKeNm5e5ghTwhV1DHH91+eo38hlYx5Hv9bWx44Daa7q4vkhnn1FMGNO0LwUA1q8wUoQ1U8i521rrKZckbGuz4UjVU3OVFLBzrR5wvsGJSOC+Y3uCmH7NFGOMEQBrv/D83mjcMdEpctSA5ereqjQmXmawJ6kIY682CHAO/eHvGFUTs9DI9HMilFd9Z3IR9Q8kgqRoMwwbH7lW1T3sK16w0WnKWUaZgHxaDCJkVOMeuMs12wwojn2lXB8ulM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NvUlUVcxPYL/NxprHrh+Q9ufm31wxgVY2sdWL5lnV/5QLdQbwNyEom7c= X-Microsoft-Exchange-Diagnostics: 1;AM4P191MB0243;6:OTiWFWmauL/EJBHTtLeDT8SlVEpPIEMcDfe7A0+qzrWtO3QVza949VYR8H2zgMcq+f0Zr0HdKgS0Ct0YuXS29TqBEL5B89DSS2GaW7LyjNYA4IEtUqNien9iFXtLRw8y8LA/G0m8jwRQVAzyznhDJuTH78GxqZgGTx7gjoDagttC3By4BeCQS9nVrWTw6bjwCwHNcDFJgVrrHzPBGMlwLJHElNgCyOXKeGKLTLCFhqahCA5XucAPYsjaLKvhYzaZRvWwKm+As97HZUHPneSgBCGyEjh1ymPcRIky6TwANrndnnQ0seFWV5rQVQ7O7E9yNx7pbQ/llcWYaKM9B3tdXU/QRAU85nGwt7pY7nVzVA+VbuJwkaoxa+QGvuJQJQyq3EfZ7bqTpkXtceSS6GNJAhv87fifxOYkInTnnMtWwhjBu6vZBGLKvQuhqrunq5eH4gad7kg7jiCUxlwf8UwjGg==;5:8FldDSsyM3sPtUO2FGJbnVSxJtzbjf1WzaRrY2SJA2QrIx2LA00Vy4HmnUi8IMfEuLd4lTo7hTYXmuZ3sm5peirogSOqF0Q557PcB/eEaPhTMb/ZnrtNkEdZTd4dbPEL6lgAwE7mYoYEyyDss+AT/9X2IY9aUgX2eDUte+xPK/w=;7:HK/k0k/Kmf9f+iH+khCZRasumqmK7MjfjpezIliS07Vidw24fwT2tmeLiOXig02d8U/Vwtgz0HEGzYa83O+jWDHJmjcZaL9GpokhVPBztQlPcAeHC2+Aq7Rgp+/xqn/j7x4BXlF9tOQDEgZ/vyxEtUqi5H5zpy5VM8qaE0Vlg9eJD9MW5IiioAW0ZgsRwkz/8REGx70FIXSzfpnlb77BbGULesgjJs782KrDZpbHfxiIAYPGuN6pd4HpmENnWH/m SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 11:04:24.1338 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30b7d083-cde3-4ec7-a00a-08d60f31830d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P191MB0243 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use fixed point division to calculate iops to prevent reporting 0 iops when operations last for longer than a second. Signed-off-by: Seraj Alijan --- drivers/dma/dmatest.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 8ce3b06..3c55190 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -170,6 +170,13 @@ MODULE_PARM_DESC(channel, "Bus ID of the channel to test (default: any)"); #define PATTERN_COUNT_MASK 0x1f #define PATTERN_MEMSET_IDX 0x01 +/* Fixed point arithmetic ops */ +#define FIXPT_SHIFT 8 +#define FIXPNT_MASK 0xFF +#define FIXPT_TO_INT(a) ((a) >> FIXPT_SHIFT) +#define INT_TO_FIXPT(a) ((a) << FIXPT_SHIFT) +#define FIXPT_GET_FRAC(a) ((((a) & FIXPNT_MASK) * 100) >> FIXPT_SHIFT) + /* poor man's completion - we want to use wait_event_freezable() on it */ struct dmatest_done { bool done; @@ -446,13 +453,15 @@ static unsigned long long dmatest_persec(s64 runtime, unsigned int val) } per_sec *= val; + per_sec = INT_TO_FIXPT(per_sec); do_div(per_sec, runtime); + return per_sec; } static unsigned long long dmatest_KBs(s64 runtime, unsigned long long len) { - return dmatest_persec(runtime, len >> 10); + return FIXPT_TO_INT(dmatest_persec(runtime, len >> 10)); } /* @@ -493,6 +502,7 @@ static int dmatest_func(void *data) ktime_t comparetime = 0; s64 runtime = 0; unsigned long long total_len = 0; + unsigned long long iops = 0; u8 align = 0; bool is_memset = false; dma_addr_t *srcs; @@ -833,9 +843,10 @@ static int dmatest_func(void *data) err_srcs: kfree(pq_coefs); err_thread_type: - pr_info("%s: summary %u tests, %u failures %llu iops %llu KB/s (%d)\n", + iops = dmatest_persec(runtime, total_tests); + pr_info("%s: summary %u tests, %u failures %llu.%02llu iops %llu KB/s (%d)\n", current->comm, total_tests, failed_tests, - dmatest_persec(runtime, total_tests), + FIXPT_TO_INT(iops), FIXPT_GET_FRAC(iops), dmatest_KBs(runtime, total_len), ret); /* terminate all transfers on specified channels */ From patchwork Fri Aug 31 11:03: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: 10583615 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 3590C13AC for ; Fri, 31 Aug 2018 11:04:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 235442B486 for ; Fri, 31 Aug 2018 11:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1741F2B55E; Fri, 31 Aug 2018 11:04:34 +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 9E83F2B486 for ; Fri, 31 Aug 2018 11:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727743AbeHaPL3 (ORCPT ); Fri, 31 Aug 2018 11:11:29 -0400 Received: from mail-eopbgr60067.outbound.protection.outlook.com ([40.107.6.67]:41216 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727574AbeHaPL3 (ORCPT ); Fri, 31 Aug 2018 11:11:29 -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=SV5Xd3SqvKNEjKVkNp4BJBDnR4+Y80D2wwpKPoog/zM=; b=Nh87lzM7rcn4oC2X0MxvT0B4HKEThVr8IbQSnPBvJ0Ywc5I8PZ7jKeUWP3BAfAebEufboC3jhuUdKtH+qlfO1ms7SyaKjGivYg+3eE3rbaD88lNnmiy82hg3GJawW4LnU/c60g/CcIcfUzCQCJ+V2IbyK36jg1X1vs04YTE3/g4= 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 AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Fri, 31 Aug 2018 11:04:26 +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 V2 3/5] dmaengine: dmatest: Add alignment parameter Date: Fri, 31 Aug 2018 12:03:42 +0100 Message-Id: <1535713424-11322-4-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> References: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: VI1P195CA0048.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::37) To AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33738ede-7405-4000-a25c-08d60f318475 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM4P191MB0243; X-Microsoft-Exchange-Diagnostics: 1;AM4P191MB0243;3:Ta5QRnFkypDFyswSCFVc6Q1+4uPko2ue5Cm+eva6l/TiCWZ+XHVQNqphCz5XYP85elBn6l52bhMMl0dZ9mq+7mFxb8KOgIbJicO3LSPGxwZkPEBU5WShZ37MDE8q25Wqqf2ixw91uwbt2/h/Ek0V0iaydQnz1UX0NxExJaxj/R/kY4kkeZxppMpY6MG8vuhs7pkgKWP30mxOhq7EPQ35CNTu6PvSFk6r0IxIuYz9drO1OWn/bDNkX39MSRvVODZ8;25:R8qFi9BsgLmedS5qjMWWYDj4n44zdGwKIPuDHMuJ7NiPMtFOWguDs0e7n+h7M7L2XVH8mcrfG9/unIXkHY70LyGpxwuEtZyxp6zI+ucDdn2pC7Xl+GDbGc7RHKAjeRSo4ODT6GNc0odRxRd9mto7w9LFffzBTQH4bngXc2iKrC2YXwThL9IKbBHVxR4bi2O4RFGdDHYZh4wv/6rG4Dfiil9RdBFpBbynoWAK+1ESgJ4KtHIKyg9VAuLAgD9qakYoaqFQUFypGRffRMOD8eR4Ex1hlAodgsgzWLHpj/x7ymmMULp6tDlajU8Vd+t+SKwFUw6Q3YKG2XlYXq+WWH8xlw==;31:Tn5qzneRpozinSEpqssPLp4suRaSr/JxHos2sNt8bp5mOf/Igb/TqHGcr99mz3bbz2BI+/tCI4e/inMv8/bZOz2RvXkbIi/BMOsH+sGK1M2f1WqQYcdbkpx0HF7bOD29dnuUKUEN6GeAIAZMHMRBKutrohTUty9nIJ1otTlHN39fxNkg767f1WPR/DqZbXyAAi8yxSMKUVDx0YgNcZhBSr1PcEob0ut3yNZaghcr7C0= X-MS-TrafficTypeDiagnostic: AM4P191MB0243: X-Microsoft-Exchange-Diagnostics: 1;AM4P191MB0243;20:qUa6967P5/xENQe3/VEXg6InghgDik4GJiNrdtDu/K2lW7GRDxyceq7sQVB7dJR0oQND1ZSyDjq2UtjYCU/7nJMi35i9Q4LOhmdJZF8xblQabOHXcV6fh8TnpjvkYfi8fN4dzgsHEWCaUfGPIN+IFqUsOoq2UbtB8m859TwB4fHLIk13/z81blaPzW63LBKrZ4SjzEpB/Upvw+dY23xdDD+lTRbZrimO0ffsGzANoydpc2J94mgNM2aqn5/12/onFGU1xIXVh747i5088nYSIFeRMP5/W9m1Pn9K71NxnHS8qNJxkME+hh6EoEHFa4QYJLTH77c+waf5Tr0t3U4FXoDW8eeto0y59BtXLpUzkpuz/m/UzamqO437mAV9ISwjKYnG20eG7HeWGFo6Q9C8bAtpwLrE4Uqj52qTdcWcqsZkXtkDh7X4Yn9T1kw+zGNopZ8XTDZctQdKkuLtNuP4dtczEmF1H+7MXhrpVphemo0ysDghR8mSPLO2m21l3Wxf;4:poham5rUv3luMA8lEw8vEZwkiGmPyUewM5/fOE1Ekm4Pz+imKKY/vyOtzzALKiPABjQIU5tT5LCIOsGvyGI13VSqzgxWVFkgce6qogBx6sPxHBsk2nAA0ts2x6B44XaMdcEz1fJTEM1fkgfZW32W4dX8jAFwikOC5M84gYUxFAnzqvrK7bC/euK/9h1iw9AFtztsQpKMXpvH1tu4tmJxq2NmwV9MOVRXx799TwmlG8JCAV/3QLO2xVC6HWzdFd1S6qIare9jDZcWhGB18pN7bg== 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699016);SRVR:AM4P191MB0243;BCL:0;PCL:0;RULEID:;SRVR:AM4P191MB0243; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(396003)(346002)(366004)(376002)(136003)(199004)(189003)(6916009)(6486002)(386003)(5660300001)(6666003)(53936002)(478600001)(6506007)(4326008)(16586007)(6512007)(25786009)(97736004)(14444005)(305945005)(107886003)(52116002)(51416003)(48376002)(76176011)(7736002)(50466002)(81166006)(36756003)(81156014)(8936002)(3846002)(16526019)(316002)(66066001)(26005)(2351001)(6116002)(50226002)(2906002)(106356001)(446003)(68736007)(11346002)(186003)(105586002)(2361001)(486006)(47776003)(8676002)(2616005)(956004)(476003)(44832011)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4P191MB0243;H:Seraj-pc.hh.imgtec.org;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-Exchange-Diagnostics: 1;AM4P191MB0243;23:5ejGV91xvM9HhJD75sNRf4xw9gJXHQsH4uWjpaCXPTHGFJ9isHtUkzvd1DwfiGbiFxE+JUCqYtBmtY5LbdA7PH/tY8u9f2lcPgGgzKT/rJSUAgPqzu3g8go7Kzin3nWPwB5sRTIsPa6sj6A+RrN1TFDvTSBCslJnJEB2F3VcRbTescxT9KI0dzEPDEq51pN5JMynR2gP+z1vTjCEntHfRoZPP5Tr/touH++roJ/7M/BlOXC+juAnULO9RFaPSBsWOCNQAixP3vI/dNIOKv1OnfqqmKebmqXU62HBJwUiUrYHYSGNMYJPnHjI2cWCJegqCLnpDfuFK/9iTygIuISO6ojumy4uTX/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L7nGuONiz0df8ZfSZmIwTT5FoHnYqXY5A2eMmUq3vcvxGqr1uTVpQYOFM9cYfzgoRMpWc8EsTqYzVMkovT9+Snnv2uSH9urB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 11:04:26.4932 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33738ede-7405-4000-a25c-08d60f318475 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P191MB0243 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add parameter "alignment" to allow setting the address alignment manually. Having the ability to configure address alignment from user space adds new testing capabilities where different alignments can be configured for testing without having to modify the dma device alignment properties. If configured, the alignment value will override the device alignment property of the target device. Signed-off-by: Seraj Alijan --- drivers/dma/dmatest.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 3c55190..c980865 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -79,6 +79,10 @@ static bool verbose; module_param(verbose, bool, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(verbose, "Enable \"success\" result messages (default: off)"); +static int alignment = -1; +module_param(alignment, int, 0644); +MODULE_PARM_DESC(alignment, "Custom data address alignment taken as 2^(alignment) (default: not used (-1))"); + /** * struct dmatest_params - test parameters. * @buf_size: size of the memcpy test buffer @@ -103,6 +107,7 @@ struct dmatest_params { int timeout; bool noverify; bool norandom; + int alignment; }; /** @@ -519,22 +524,26 @@ static int dmatest_func(void *data) chan = thread->chan; dev = chan->device; if (thread->type == DMA_MEMCPY) { - align = dev->copy_align; + align = params->alignment < 0 ? dev->copy_align : + params->alignment; src_cnt = dst_cnt = 1; } else if (thread->type == DMA_MEMSET) { - align = dev->fill_align; + align = params->alignment < 0 ? dev->fill_align : + params->alignment; src_cnt = dst_cnt = 1; is_memset = true; } else if (thread->type == DMA_XOR) { /* force odd to ensure dst = src */ src_cnt = min_odd(params->xor_sources | 1, dev->max_xor); dst_cnt = 1; - align = dev->xor_align; + align = params->alignment < 0 ? dev->xor_align : + params->alignment; } else if (thread->type == DMA_PQ) { /* force odd to ensure dst = src */ src_cnt = min_odd(params->pq_sources | 1, dma_maxpq(dev, 0)); dst_cnt = 2; - align = dev->pq_align; + align = params->alignment < 0 ? dev->pq_align : + params->alignment; pq_coefs = kmalloc(params->pq_sources + 1, GFP_KERNEL); if (!pq_coefs) @@ -1032,6 +1041,7 @@ static void add_threaded_test(struct dmatest_info *info) params->timeout = timeout; params->noverify = noverify; params->norandom = norandom; + params->alignment = alignment; request_channels(info, DMA_MEMCPY); request_channels(info, DMA_MEMSET); From patchwork Fri Aug 31 11:03:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10583617 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 A67A2112B for ; Fri, 31 Aug 2018 11:04:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 928542B486 for ; Fri, 31 Aug 2018 11:04:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84E1B2B55E; Fri, 31 Aug 2018 11:04:37 +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 178B02B486 for ; Fri, 31 Aug 2018 11:04:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727574AbeHaPLd (ORCPT ); Fri, 31 Aug 2018 11:11:33 -0400 Received: from mail-eopbgr60067.outbound.protection.outlook.com ([40.107.6.67]:41216 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726990AbeHaPLd (ORCPT ); Fri, 31 Aug 2018 11:11:33 -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=kofZSURTPaPiEW8mhEhdR1I4i5/w9fo0rVOqFqMQ3WE=; b=wEFRstrcEV+rbSX+NTk/6VrXP8y/UHDwSCan35SAP97s4UCiPfEVqP7vI6gZEOOOaXOKrWKzzcf1Y4ZvQg/6be54jgxZmO8kRclwcA8QFNsZ6OcdfgMQq9y16O6ufEaADM/d8gRR+CwG+5PLEwoFbbQMIa4yeGV4CxMAHO19CWg= 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 AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Fri, 31 Aug 2018 11:04:28 +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 V2 4/5] dmaengine: dmatest: Add transfer_size parameter Date: Fri, 31 Aug 2018 12:03:43 +0100 Message-Id: <1535713424-11322-5-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> References: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: VI1P195CA0048.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::37) To AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dcd98a54-acb1-42e5-4858-08d60f31855f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM4P191MB0243; X-Microsoft-Exchange-Diagnostics: 1;AM4P191MB0243;3:mOCuswajQ242Z3vSkj5kVszwRr1TVnPfwbVVRl/noAdo34LLRIjyfpsa6tzHmeLojBWIkmJyMEDtk0V4Nuca6A3yDeZDDlG0O22Uz0A9uRA0+giCWCM3Bb4Ptrklz2+e94twhuA5eU0j6TiCEiv3xq6Zj3/heZbhfgtyp6ww0sGJj4OFUoHPdjJCvaNYci/DsAi56GbMdu9h5+a+NJGwGCrK6ZKB/d8wA7LYdprSUstMVpBRBwfSaJsKj1JKlHx9;25:qm5h5QB7wCBaEatTmWCll2arxUjCwZRqWn1r2gFZ7zBaWxZQ4h12Bo5BOUVG4y8aHY1X0lfErG4qATnq2s2wJLTnX8qBpDGFF3GcfBV/iaoUwgBpdERQa/2J/9P8Z5qYD53EbNrMovd8mq2dU/CJAHovVsiiwBl/N6ty8IzmTJpduj0RNn37/NvO91DJfY4QRZj0B1bQNp70yl8fdkf+XDExmBVkDxJRj5mgR9Vre2kc07YY3jl18j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eQXNWoQqHA2LrKB2bsGsxjOB+Bc0hV2aDCQazslu2SxrgxqqFtj48rHOE/5FrmjTrR8Qy7K64tjb2n3Nf29K7n2+UIV5hwZjDEHwFOp5jvlwi5E8yvqixhngpyCg== 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699016);SRVR:AM4P191MB0243;BCL:0;PCL:0;RULEID:;SRVR:AM4P191MB0243; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(396003)(346002)(366004)(376002)(136003)(199004)(189003)(6916009)(6486002)(386003)(5660300001)(6666003)(53936002)(478600001)(6506007)(4326008)(16586007)(6512007)(25786009)(97736004)(14444005)(305945005)(107886003)(52116002)(51416003)(48376002)(76176011)(7736002)(50466002)(81166006)(36756003)(81156014)(8936002)(3846002)(16526019)(316002)(66066001)(26005)(2351001)(6116002)(50226002)(2906002)(106356001)(446003)(68736007)(11346002)(186003)(105586002)(2361001)(486006)(47776003)(8676002)(2616005)(956004)(476003)(44832011)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4P191MB0243;H:Seraj-pc.hh.imgtec.org;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-Exchange-Diagnostics: 1;AM4P191MB0243;23:bjbX6qK/uOFyd6fO0EGZDabQRxdn6Ulz6lKLdGvEDFSBJvMGSMv/M+cdSUJ3HncEJVqTwzAxTMTq/hGikjGQ1if8g3w9G6ZwnNcYYNZR/OTxdT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XaQvPDmXyNcqDaGouqJ4AAFYzleGyLYKBKLKhuukRzJDVyVOkb4RsGLFlyEge4LxKx+XtCxTMLEVaMPQVj6rW0NoIARBrW1kBs=;7:PrJho/OZIh/5cV8/XVqBRy00nxxaXThIG2He6yukE+e30HgzTYzEDDD/vLErkRYajYi9gKU8kwpxc+Y52f8m50BoufB/Hj9JhAfm16p4ls/XL5YHAgnFGNmMMpoCiEvxQUbwhPWIpAxuw9J29J6cEhjD8JDR2+/3FSl7r7qpVWxwTjGKXw06FPJdgsKuy4JBdRBqIW7Ouk0HKAv45pLuYTyjZ2bKHU81CzCpkqhiZAEFUtQzJ7TMf/PkNxxp4h5i SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 11:04:28.0088 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dcd98a54-acb1-42e5-4858-08d60f31855f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P191MB0243 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Existing transfer size "len" is either generated randomly or set to the size of test_buf_size. In some cases we need to explicitly specify a transfer size that is different from the buffer size and non aligned to test the target device's ability to handle unaligned transfers. This patch adds optional parameter "transfer_size" to allow setting explicit transfer size for dma transfers. Signed-off-by: Seraj Alijan --- drivers/dma/dmatest.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index c980865..937acb0 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -83,6 +83,10 @@ static int alignment = -1; module_param(alignment, int, 0644); MODULE_PARM_DESC(alignment, "Custom data address alignment taken as 2^(alignment) (default: not used (-1))"); +static unsigned int transfer_size; +module_param(transfer_size, uint, 0644); +MODULE_PARM_DESC(transfer_size, "Optional custom transfer size in bytes (default: not used (0))"); + /** * struct dmatest_params - test parameters. * @buf_size: size of the memcpy test buffer @@ -108,6 +112,7 @@ struct dmatest_params { bool noverify; bool norandom; int alignment; + unsigned int transfer_size; }; /** @@ -636,15 +641,25 @@ static int dmatest_func(void *data) break; } - if (params->norandom) + if (params->transfer_size) { + if (params->transfer_size >= params->buf_size) { + pr_err("%u-byte transfer size must be lower than %u-buffer size\n", + params->transfer_size, params->buf_size); + break; + } + len = params->transfer_size; + } else if (params->norandom) { len = params->buf_size; - else + } else { len = dmatest_random() % params->buf_size + 1; + } - len = (len >> align) << align; - if (!len) - len = 1 << align; - + /* Do not alter transfer size explicitly defined by user */ + if (!params->transfer_size) { + len = (len >> align) << align; + if (!len) + len = 1 << align; + } total_len += len; if (params->norandom) { @@ -1042,6 +1057,7 @@ static void add_threaded_test(struct dmatest_info *info) params->noverify = noverify; params->norandom = norandom; params->alignment = alignment; + params->transfer_size = transfer_size; request_channels(info, DMA_MEMCPY); request_channels(info, DMA_MEMSET); From patchwork Fri Aug 31 11:03:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10583619 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 CF85413AC for ; Fri, 31 Aug 2018 11:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCFDF2B486 for ; Fri, 31 Aug 2018 11:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B16872B55E; Fri, 31 Aug 2018 11:04:41 +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 405252B486 for ; Fri, 31 Aug 2018 11:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727744AbeHaPLh (ORCPT ); Fri, 31 Aug 2018 11:11:37 -0400 Received: from mail-eopbgr60067.outbound.protection.outlook.com ([40.107.6.67]:41216 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726990AbeHaPLh (ORCPT ); Fri, 31 Aug 2018 11:11:37 -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=h34KkUyhLgCDAwbej0P7k5fOayUAdDwIKKx8pAeLQvY=; b=ouwDgca3c3j+9Qgi4vNmai4J9faO8EAaIzvsDWogN2Qgto/ygkVMlxwucZDGAHJORDNrwxWrsw83bowwn+0yyMp8iAU782fp0SU6lm0tMseIEFzoHgmbFE+IbS3k+V08bj3FYY9uiF2FLQrvSsiXlXCgpAKG5epEYp1u83+IGgY= 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 AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Fri, 31 Aug 2018 11:04: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 V2 5/5] dmaengine: Documentation: Add documentation for multi chan testing Date: Fri, 31 Aug 2018 12:03:44 +0100 Message-Id: <1535713424-11322-6-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> References: <1535713424-11322-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: VI1P195CA0048.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::37) To AM4P191MB0243.EURP191.PROD.OUTLOOK.COM (2603:10a6:200:67::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4368d598-8a5b-4993-ffd7-08d60f31867a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM4P191MB0243; X-Microsoft-Exchange-Diagnostics: 1;AM4P191MB0243;3:VsMD7gSmRG2AbV6iCLMJs3aQ8tTcTkyg8vIiC08gc6QQwORhrH9EnrK5fZXgklfknSJQkHYSYepGQ7IHcc82HOMvNJmF8PxYiF521Ha6FpCs0yYWOT0G9X/Xv29kP3CLsmszj5xmQUfhh2CrqxukZNClhI2v2vT+7kBPaGmchAO9qVjIXr55HFSjSsQvgu+9U3pRzVeZO3p7tMxPpJbZMyHOlVJIreD977y4g0p1bfNtb0gdjdSbKSuHXznemttm;25:6BdJllPkMp6Lw8ZWhPQ8AHOENi3mgbFqnW0PDCLTl6CxDNpVvYRJm7W9++FMfWvjICaZFuvQX271jTZNaeiqxgKDBzq24v0Ppjh954ngNu5T0K00xzLZR/NjpueIbuLD+ZaZQH2xu1sr0X1L2ULIpaEy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1wg/b+7X0looCGuNxkmFQxw3eabAGNke9ND/Qxt5u/Zq1u6y9kzHohdbCpw7v/PSr4t3MVEvMmP488eJ07bf4Xbf0Il9RyOxIALK6uyJA5SJb9Sh2sW8WkZTO7JcQJPATBF6i9+r17XEwR30z6r8yDHNh+WIJ9eROTLNP158hb+v1cA7UJfBQeDoqeuXuub0U/Ju3v05AMSw== 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699016);SRVR:AM4P191MB0243;BCL:0;PCL:0;RULEID:;SRVR:AM4P191MB0243; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(396003)(346002)(366004)(376002)(136003)(199004)(189003)(6916009)(6486002)(386003)(5660300001)(6666003)(53936002)(478600001)(6506007)(4326008)(16586007)(6512007)(25786009)(97736004)(14444005)(305945005)(107886003)(52116002)(51416003)(48376002)(76176011)(7736002)(50466002)(81166006)(36756003)(81156014)(8936002)(3846002)(16526019)(316002)(66066001)(26005)(2351001)(575784001)(6116002)(50226002)(2906002)(106356001)(446003)(68736007)(11346002)(186003)(105586002)(2361001)(486006)(47776003)(8676002)(2616005)(956004)(476003)(44832011)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4P191MB0243;H:Seraj-pc.hh.imgtec.org;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-Exchange-Diagnostics: 1;AM4P191MB0243;23:71sMqgsq3SmI64S9IZxJCEs3UUuwsHHdn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VqZGw==;5:EPIQK3oG1QBQ34Jxzfv6cTwfk9Cc8Cntu4BEw2G3jGmhmfXEscg8G5GNlTHtd8q88Dbhw4Um1N+qCiZSrh0zjbu3qq5ssvW/OBW2OhBVMdOfermOIwPCL/ApBRUGzmifageNN91S/Wyz9FDcUhbb2eAhO4Eemsfrfmqrj9lKwoE=;7:McjdygGKCYhHZVuDI2nMD6MQEV4goOvr5Pi/+zAhG98VXiTN6wh9PXmsnvlzKY0s0oePnFeVSTMQ5OI3YUQQ/H8zbVbV3MAjUoaZYcMPrkrJCwJmpzS8G5dmQtsUk6l5zYjTGLMs+fc2Fyt/SA9yHxuE0YyU9MvFIvEMW2BlsEnnD3lKLb9PgmRs7rw4w24AbdqGsj+nxaRRdbNFIradD2bNV7M9W/Z2RNFhK/B9Ezpcrc7o34M+WXW0xK/bmEWh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 11:04:29.5713 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4368d598-8a5b-4993-ffd7-08d60f31867a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P191MB0243 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 | 27 ++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Documentation/driver-api/dmaengine/dmatest.rst b/Documentation/driver-api/dmaengine/dmatest.rst index 7ce5e71..0a7e4c3 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.