From patchwork Fri Aug 24 12:15:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10575293 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 10BF5112E for ; Fri, 24 Aug 2018 12:16:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01BFE2A9EB for ; Fri, 24 Aug 2018 12:16:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E77BB2B8AD; Fri, 24 Aug 2018 12:16:15 +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 405F12A9EB for ; Fri, 24 Aug 2018 12:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbeHXPui (ORCPT ); Fri, 24 Aug 2018 11:50:38 -0400 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:20832 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726513AbeHXPui (ORCPT ); Fri, 24 Aug 2018 11:50:38 -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=1KVVqfrT6/Hg/a7EEXgVEKG4QkNXlLspOJ4FHEmdW/q4MMP9VM4F83/og2C/mBYM/Ie0I5r9T6DS3cRMu8JvBrWejCdXnKmDP32lqr2M4Iypa8uCu0F1UiXcVC+xdIyNVQkRl/v8SiVpZ+1dmwcnMwWSlppWuctRf/wMa7y2sAw= 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 DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Fri, 24 Aug 2018 12:16:09 +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 1/5] dmaengine: dmatest: Add support for multi channel testing Date: Fri, 24 Aug 2018 13:15:37 +0100 Message-Id: <1535112941-7169-2-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> References: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: MR2P264CA0045.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::33) To DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c939e7ce-df64-43ff-b33e-08d609bb606d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB6P191MB0248; X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gvzFG8hElCsC9DWTwRGKsLuPvXIXjY69J1Ncf76mP51nUruJhRmgUN4aCjboaf3HMBsPiYtpl4p164DtUuAOEGiYjEPBu6t5PVbPdoThf2QcB/Q6u1MoceKzeNv6/fOKn54IYgli9wrkKkZzTCVZbQTG0kpkNTNeB66z4ArwKyxPo+PoDPCS9jBMYxH9epz7jGmq+9GVZOGQHPyYeDb6pmIvsBFodgDYo2qy0tUw+dvBGoEFj15YWa7oFqCl6bJOP8HstYMOD1ZFxKkw5mujS6DL/HSsB2dA0DA+0HC1BCg292/4letAMzR9gCf7W6hOHyA7EfFPe0DlmNHmHt5RO9tbEpibp3u37/1GiC2X7vxkje7Zu9VCz4gJBESn1v6rJRY;4:Ci0HqxvU4GSCUwFK841NMvfzvftU2a5R8ajODk5uSlavNsAcH7sRBL1wYBSbYuDIfMjECXdScJEdnc+zw6Ms1hIF9HbJUSl4JrxqMwJlTXzba+kXh5rD7AMVSat0n357eepukr7dhZ/7A8Avhul0Wwp9wGV3IG/xoqcSHSn9u3bnfgwidPbLnY5phuJQRAVhXBQ/wd1flgxft5VqxhWblsDEIqmjJsTiB9TnVkTOz+a9vOVIOmurWjam3T0K0BroDVn5BGpOXwunLU5cYRO0wA== 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)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:DB6P191MB0248;BCL:0;PCL:0;RULEID:;SRVR:DB6P191MB0248; X-Forefront-PRVS: 07749F8C42 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(396003)(376002)(136003)(366004)(39840400004)(189003)(199004)(6486002)(386003)(476003)(956004)(11346002)(52116002)(50466002)(51416003)(2906002)(36756003)(2616005)(5660300001)(48376002)(446003)(186003)(16526019)(44832011)(26005)(6506007)(76176011)(2361001)(68736007)(14444005)(107886003)(106356001)(25786009)(47776003)(66066001)(8936002)(486006)(53936002)(16586007)(105586002)(478600001)(6512007)(50226002)(6666003)(4326008)(316002)(305945005)(7736002)(81156014)(97736004)(8676002)(2351001)(6116002)(3846002)(6916009)(81166006)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6P191MB0248;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;DB6P191MB0248;23:sjkT+1jLF9wQ1Ydw+ZfOzDZcgNshsXtc8ZHZZpeb0VeNp6iVPBZEXMQvGFLIFEEYW3tA68+yJk5d0rlYq1dAe4z3sdap4aUqwPCNV3xb7rDwev/GJjZnuBDVzXJKgQlp4+JB7+wM/KWbPqOOliDl1U+jNi9uzKU+mG0bAj45IlJHNrulEt0/z8eoezcZDELRZ7t44vTpl+jewGNPzoSApn3o/wWspOY2FQYm//zTQsFHmr/I+MeEMKA8cBAnBIh1dvXD9bSKo9yxxEasi9ADmH7EyI1c+Yt2TrQ8CnRQpUhCoTI8x+r5wWMpj2S2nxw7SfnaMRz1uYVmW67u7l6uMHjINWHDVuKZyAdAOKuDMcun9Oz1pdArdJevGxYZf3ZeFo2v2aT6jDKgNy3n7XrszxGFCgpz1vWXblW/rqiZ8qxuZJQrPaxFZcH6KTF4MWKddJKgVxwUw9XiX6gSYHdoh/+H7ZbcJ4+D0oUSIHCYGOczs7opHo4uYa4kk/z+NGlVJN51IPViRFTutWnnhF7uI86/Lja6E8HgZ0fdvtlNMoxr3xpcEyQTNFihy5Esv5n6x7yN6Ch7E3DhLXZ/dIqhFtd1lTbiv3uLeBungfM8bLveSCquUsbVGrdfRhzQUOxzmR2AX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ZodTq0WGGzOuweyqtRGSIHX+OjYarK7w5Q8lD2jtOp2+DBatXsBb9pUoQ26TQdjFIFohwSJezVr+sYtTLC8hxcWNcE74cBm0+4COFLBbhq/EcO/aaB6iRg4htCsKZZpHnjmYTQ8fuVJ+hSb26Y4NQf8SIS89D73YBRHDm4hcZBgMBdS2X4JBq31aHTT2Z+HmBkf5axmvqZ9FqWszt3nMr4dWopEoVnNqxWlEgwBslyQgL6ogkbGK3aWCDOLd0XiEAh4P8WOapCZ6ZZmX50Nlb54cMmJokuhZgHfyPFs79Xr95mRG7x+HScQtjUg6catj1/69xLNw3NvBq/9mHo1hsKfPkpTcho04Aabhnut16rErGFKyQ6/bHJKEowl4uSdWHktaO4/S4qXYb/MGN9MS67x+5ZVmhsIemdU9UGmiUQPm8Sd/FnEwyL8kMDV97BA==;5:arFSp/dl20VkRKE9mZY56RT+vq8SICSKKCJ7vzZMij+C/c8HoeQmw/qQcOZ+g76RaEg6qqAM2i8ktY+gVeoaO14rmLhn6+CRxF2/1L7/KiOMLpfCIvgCSf7jcPSbLkjI/LV5mfTZJ0V4kZSnkDIw85CK5vHDXWL/huazec9QNws=;7:UOpz4aZShW6yu2sUPlJa3tZK5pHRgZjAXgJUE/UNCwU2DVcY8II+BpAlkm5tSqBJ6eJ1WBXDC5j34GN8wOTLQclotUzr94JWhk1ObGjFQNIBJvW38ulLnENcr+sZJfrHAAeZH+zLFr3eXBLzT1Z7S9zvmn36qMEqgo1oe3SIRRkm9IMCw/SHveQD0Ixd0NoTRRhnoIOZGKBARMRgzOBSx88j0nQ8RjUpzszY4lAVJZioDRk5zdq+kjMAyeury2tf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:16:09.4705 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c939e7ce-df64-43ff-b33e-08d609bb606d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P191MB0248 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 24 12:15:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10575295 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 9BDEB112E for ; Fri, 24 Aug 2018 12:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C2712B7A5 for ; Fri, 24 Aug 2018 12:16:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FF942B8B2; Fri, 24 Aug 2018 12:16:18 +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 14E212B7A5 for ; Fri, 24 Aug 2018 12:16:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726915AbeHXPul (ORCPT ); Fri, 24 Aug 2018 11:50:41 -0400 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:20832 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726513AbeHXPul (ORCPT ); Fri, 24 Aug 2018 11:50:41 -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=ag0dgh+RAR0DfuRSsJZiQduzllftMB1E/Iid/75AJcs=; b=GTD6ypGzT0c/rSaOX0DSc3s5RgIDhc9ajBQJ2Bctbirn27rVs9Q75/9hE4TOxjKB2uouPnAxVAc3VH3AHuAuZt5sUynbyemteJpfCPuPAOjUKZhh0zQXxFXA027adbaOIPlS3es0aJY+fifNsVY07mtN02sMT7NV4i3Ik/Ptyko= 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 DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Fri, 24 Aug 2018 12:16:11 +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 2/5] dmaengine: dmatest: Use fixed point div to calculate iops Date: Fri, 24 Aug 2018 13:15:38 +0100 Message-Id: <1535112941-7169-3-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> References: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: MR2P264CA0045.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::33) To DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9063180b-01d2-43bd-5247-08d609bb61ed X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB6P191MB0248; X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0248;3:G8bWJTbR3Hhx4ulxkl9KvraP99JVhpRjbR2CCcEOVNYhadaLrgJwmWiKDgnti8qCFQV01vSspursR6p5LhrJvBvdDgYYYvCP6xPwKoPy/IKIRP0r6sPRknYJF2VDyOErWuxwsffYwQfbL4DTbIFIOMBSZZCb2BllVUNR8Ji5XUGdZo/C9NF+bjITFxtNAYmpJaF51pbBzQK0IToXXjNQgl4hwLv+FLkHgjWHzUqJMTTpKadCZ1vu+EgakbNbWE0Y;25:XUq3eXEqp+KuvxoV3EZP8KCkJUp8ftdEKOQgH6WYBF0ijcKnkAvscxOR3d12Wew5UIuM/XR24cgRqX2ODqi8ufO0PacfAiwNneY+Cq2Zc4z5JHvIqeGCNld9ftYu+0tpkREGvB9BLPYGNpLFb44POn8XMkT/SVCU4YPgKS6I+mUeTFhbwMmNx0FgzjxmCD73jl1anztS75C4YlahvXE956ojR9Bf7Lq0bRxTs1ARSJS+qPmGrDbLimRYVNB3pHEyeaC/bwCDaWrifMD7mauHfFvHDZ0X6KVr6sEHd4KwmozSEJLoGvxcqSU0GDLDsFxe0WuqLbYjmOrZLXEh+o9+SQ==;31:VTUT4vxsSdEE8v11vKTYJJkv7lmwZD2QXdssgGb/znTO/8IvC2lBuhF9jLRVM8mE4Q56sd/qNS3pKrFXn2FE5wfolzA1F0zsFgTASu3fDq7D8FskkYThN2YQ/RNmxVgp0VD0+qen54YGYngvGP+oSysfFELTb/IN/0lniJNuUy61UQeN0204kSOyU73qEjqI+UlTRZ0kdHpytbRmbTX3ENPGAY88ATivuvSXmZ1HYDg= X-MS-TrafficTypeDiagnostic: DB6P191MB0248: X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0248;20:/04uyhoJl+mYBXwsOwQQ4eGf8FXqN3Gpez61hAhgVbtanZe4HvHdRF/6b2Zm0FmQxvhTCqJjV7tQ5U3/98MQpdeXL38qmo9uxnYNF6jat0a2SG9WmYqRig5kIuAxfzwCiF785/5iBd7HIMyvPp6SF9V6fWUwxGPt/AD8he6UV8bpXNUuKQZcZr4C4yYnxsx1bCoPfhhq+78/EyoD/YsY6eBYtziNqeZXzfktQzkZ/YrZQoHmD9ScbqGc5VXHsRTvOd0/WppXHk2yaBO/QlljPO9++QdsSOEbrYCiv8Lps/l91vmwQcW4d7meQ9JphLFBL8DB0vosA+TE7a2gwxsg7FIfSuhtqbNLAgXiaTukXANmAJr2sYhgZ2VV+Ap9qkN1OsYoOKmBNIecNjVNePpDtn2zYJEQkGUia/VdCdJQtSKyR9OueuNiXYlINZTA3+mBBw08/AjEY+1j0NzbEb+vf/Z+8OS/6wP299pgs7hHaJoxXojwiJm3TUt9q7zSYFAN;4:OmLEJy2Jg9WkOSAeOCA1H3f7v68Oz+d6CLnLpKCKj/h4l6/DoAH2RsytDebG1MYMnynvOJNWDJ3me8iDhiwvpb1rttTor4MCHJs5tg8lSo0mNxzMckYGOCXye3ACq7lgU6T78q/6Tgy/ekgtkxs58yIiUSMW3zxN/pfCll0c0BqD+LIEJ9tkOnZeD2F7hzTFt4QtP6jsxVT4kXWIBVtgjn2dHxb4ZWZ83bryHU8EkQ3CBmDq0nQZtNuEsfbmeW0klnaWfH/gwDb2/g5YBmOjoTqWzPt4kUzpf0ceRUBbPwR1V0k0OITHCdBtqmNkuvsa 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)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:DB6P191MB0248;BCL:0;PCL:0;RULEID:;SRVR:DB6P191MB0248; X-Forefront-PRVS: 07749F8C42 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(396003)(376002)(136003)(366004)(39840400004)(189003)(199004)(6486002)(386003)(476003)(956004)(11346002)(52116002)(50466002)(51416003)(2906002)(36756003)(2616005)(5660300001)(48376002)(446003)(186003)(16526019)(44832011)(26005)(6506007)(76176011)(2361001)(68736007)(14444005)(107886003)(106356001)(25786009)(47776003)(66066001)(8936002)(486006)(53936002)(16586007)(105586002)(478600001)(6512007)(50226002)(6666003)(4326008)(316002)(305945005)(7736002)(81156014)(97736004)(8676002)(2351001)(6116002)(3846002)(6916009)(81166006)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6P191MB0248;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;DB6P191MB0248;23:x93tZGIKv+fn6yL/HAFLIWiBV8pkFHpHKR4wsOMIAm51C1KrAD0yYD7BPAPupIpjvKmPf9RCaKEFQ3EFD70Vo1urRl9p5Qa/0tbmCvIwsns8i3xskM6K7NkE2OX4uTZqR7FIfDEum2zjg1jw3yRSQI6FlUUFeBDY7VEd+g/x0FJB2UNrHOcvbx7tbj0fqbS1ifMhfc2uD5d6W4BmfbihS0+LeYuyv2GLRnoXtdlilfs3+OqUZKb6+EjLwPt8/kARhHBz3Jv11RyWR9w4QFF8VwE8HaEz98gclwaF14eG88p6u8cyF79auzMjOqyRMtOemM+t5P+JrXeiUJIHUVMMnV0g/aRVtzLW6Q/jzHjjyZf++vfHi3IbQVY+u4oDNbxOzS2KgH+6pbWQlMrVFTHuBXMDTR1nblXby+l6lsTKt3xRfMEWJyxNWus8Fdgrj41S8076CnBuN7YoIdYpZq4IcO6syZ3oyeQzKy8BIAb5gQ71h08iULeGt8bGBIp8fUcQ75eyqtTtH3/t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ginalArrivalTime: 24 Aug 2018 12:16:11.9826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9063180b-01d2-43bd-5247-08d609bb61ed X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P191MB0248 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 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 8ce3b06..130f343 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -170,6 +170,14 @@ 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) +#define FIXPT_DIV(a, b) DIV_ROUND_CLOSEST((INT_TO_FIXPT(a)), (b)) + /* poor man's completion - we want to use wait_event_freezable() on it */ struct dmatest_done { bool done; @@ -446,13 +454,14 @@ static unsigned long long dmatest_persec(s64 runtime, unsigned int val) } per_sec *= val; - do_div(per_sec, runtime); + per_sec = FIXPT_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 24 12:15:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10575297 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 69ED41390 for ; Fri, 24 Aug 2018 12:16:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5922E2B7A5 for ; Fri, 24 Aug 2018 12:16:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B0D62B8B2; Fri, 24 Aug 2018 12:16:22 +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 CF4A72B7A5 for ; Fri, 24 Aug 2018 12:16:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbeHXPup (ORCPT ); Fri, 24 Aug 2018 11:50:45 -0400 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:20832 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726513AbeHXPup (ORCPT ); Fri, 24 Aug 2018 11:50:45 -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=UnmgKGfi2MBc01JLux1xLRNLxwoA4+5EgwMR38xBkfA=; b=f1cq59+uad2uXlMAq444Gk76gtIsgXXrl1tStXpkMWnl/7/z58+z6Ji01FFOK98ENq8tvwO7XF2u1bTN7TSj23ImX+qZAmUwfOux6xFGFJutlnNjuz+Hw3pnckaz0HJVstArM+zc30juWjwIWBFhMtWQZ2fH5Y4RfMN3P6EzsQ8= 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 DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Fri, 24 Aug 2018 12:16:13 +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 3/5] dmaengine: dmatest: Add alignment parameter Date: Fri, 24 Aug 2018 13:15:39 +0100 Message-Id: <1535112941-7169-4-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> References: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: MR2P264CA0045.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::33) To DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32f74cfe-39c5-4d5c-bf27-08d609bb630a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB6P191MB0248; X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0248;3:aBDlRruFYku8Oeyh00Ag1i4AllpaOuTnVz6xcyx/BwRh4b61evdZRgZt1AVk8XIJDL1QwYdibyJ6zlX6Yo9Zh6rTwLriAvV66zT7bPjbCD009sm8PmiU/VY1/5KAV84KpcOgGO9NxSd2CM7dF9XFHFUcOMSnEfX6mmk025ol6VNmut91U9xBy12q22ZIX+oBg6x8cv50S/ZT74VakSjTjiBdUSfxepeirHSxkZZbbruGKRKlHU6Ig7TZv1aYmwd5;25:E6mCJ4rDjUDirV35j7Y/rSV2qfJ0lxYufA2Vp+mpSSXPixwkSkII+bAHv+AE00ElWqSDAmqofZaKll3eveEhIyl0ZBxBNi2HeIUY1qKyc+9dKc5CRjASUl9fIQ6VvY8K+UDIEAXpyvEQ6Z5TMPBfpLUbRmi29EGChx6ELQRuteETbNtstbMjI5Sdz07+ZmAQ2oTHfySy5+KKBcCFj1U3wneqYJE9MDTzh/9DgFM/kOkqTxykUJHlRdo9bF1060/c2wQ/1JiqKgyvTeIFSBi+4qFSDUBdDEGOAXjCRGCjNnXFXDShTvCrWJlmOia/4kFrnnbZRaGdMQ5ofbN4zkiYmg==;31:Y4Zp65h/7dovyv+abfgxee5xkA20jRfBBMdy5JVaLReyJK5XUsFpWH7fohxLSMgmivflvQy7WQTFbN9jQfhDIDe8iBuWluI2UCVwCNk6VPLCuJ2yNyA9xGqdUnGqtZmb6ZH4lJSzf4sUxWBAUjC4P582BdiWjISpcuMWNbZEPa0Nh3YiZUkOKLpku2o33QYby4AQMCXVfyHm/BWyFgyd6WLx6ApgMOnmfIexGcN4OEk= X-MS-TrafficTypeDiagnostic: DB6P191MB0248: X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0248;20:2JxmqxEWZNSJAE671KI7zTXtZbUkWYSQMRFcX48MQBJIcPab657GXzIgr/drOmc9ywxiSaYx4FUz3TQIUzNw2mWWF6T4HadGrucx/8pvii/ffHBpRJfWRGmE070nfemMrLeE24E32lb+W9XmzarA1fY4oytAtRn6qOndj0TVLabWLm839aDz2bvRZz4V5NKxTPa5bsYam7hwsxxTsBewYqJQzhUJGMprrHsIThTRAcoI1Ow+LiIy9wJYAzG0Azx0bdVo2cMjsVi+2OqGimRGznOwoiSTsdseQGLMPjU/gAFQLVhzBm6IQG+ziDjZe9Q+8KEoIbthpsYdQ8eXwI9tqYsOYFpRXxDSwyRzz48+gE7QMltw1/76R20XDTga+F1BsfcLdjwp84YsxhapgNdVHcKGMUjW39PkAoeqhqHv0t4wFbwtoZj+btyTYlSLiGzCKiNUi0mkMaIokI+7yBlVTxSagYU64tUGFlyB7WvWhdnzNv1IEdrX8uLJzxe5mBpo;4:hD3edgPOcyiym7Mf4lYG2uQyZu//CLFNTfSwGM+KOdJqHqY7KfrSGTiUbxFrlSXrK2iuKO9EG+7YsifSOZQ0q1NZFVZnqVAp2JrSk2WlMMrUkx+LSyCn+A3oPhT8Ls9olTW4vDhCbbGtS+YC6B5XU/KcnFH3KCVQpe9JbshfoydXSRqnUzp4pP0pAz/5ponmZbsW0P7m5WsQkxWiSEWq0C/6xQsXznag5Jdy83Ti2mdDxEnqrsnB917rar6FV1fVHNXveld5bygIpcpO2i/rQw== 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)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:DB6P191MB0248;BCL:0;PCL:0;RULEID:;SRVR:DB6P191MB0248; X-Forefront-PRVS: 07749F8C42 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(396003)(376002)(136003)(366004)(39840400004)(189003)(199004)(6486002)(386003)(476003)(956004)(11346002)(52116002)(50466002)(51416003)(2906002)(36756003)(2616005)(5660300001)(48376002)(446003)(186003)(16526019)(44832011)(26005)(6506007)(76176011)(2361001)(68736007)(14444005)(107886003)(106356001)(25786009)(47776003)(66066001)(8936002)(486006)(53936002)(16586007)(105586002)(478600001)(6512007)(50226002)(6666003)(4326008)(316002)(305945005)(7736002)(81156014)(97736004)(8676002)(2351001)(6116002)(3846002)(6916009)(81166006)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6P191MB0248;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;DB6P191MB0248;23:NIXtnnOMqEJE2RsjgdFazIiOWPS/Tnl6Hj8nZHi6KjpMGwi3mOwo1Egmla1AwS2bg4gQryXjsXgEIbiNmDSrWI8CPjlAvOaDRPMA3jkQm2zNLTub50QU8uVUrt3FXtqKrfAfme0u0XlM0WI9mesm1cnMKM5wz7lrxymXzCsY5wGxddD8xfl19QHk76+wMGdeNAumnCUyIW2+FlNpbhRN0Ca+zJd64zSARp6kJxYljVKuK+k5WX1PJNsEExV/nNH6b9NUnpYrw4nj0g7qQhRrMrOOVoZWHx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xcSqBkKiqIjG0l66uZZfebECuRPCdBJgJo9LGnkXLj6bgQ+G5odopLkj4e1dw4IF4v/30/gBLYnyfCg2gPHVkWdPSKuUIx8FDfADGoZXrdBMTF6jWGaz+0IGBhg2wiig8zhqt8zeQtpUH0/RiAlFVikEe92Dunl04FPnKBIIPnGen7N SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:16:13.8541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32f74cfe-39c5-4d5c-bf27-08d609bb630a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P191MB0248 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 130f343..e3542cd 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 24 12:15: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: 10575299 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 F31551390 for ; Fri, 24 Aug 2018 12:16:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4EE92B7A5 for ; Fri, 24 Aug 2018 12:16:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D91A72B8B2; Fri, 24 Aug 2018 12:16:24 +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 6BC842B7A5 for ; Fri, 24 Aug 2018 12:16:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727331AbeHXPus (ORCPT ); Fri, 24 Aug 2018 11:50:48 -0400 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:20832 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727045AbeHXPus (ORCPT ); Fri, 24 Aug 2018 11:50:48 -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=OxofnGwDv/g6NDDHzo87AwWmXEXSRkBaKv1U8ptgvwY=; b=LHI6k8j7VIm1grn/g95GW+KiChEb+9nQaPpIjGWhKGyUMoWn9E8bSpUAzLRcqQhuwzdQHTG1e6lp0IOw6L1Z1U9SAITrLhyelxAEexrL3LcE3p6T79jDcmeGobzEr6E9xQdHl1mxU0O0HOxNDo6qIgzuEJFYigb1YZyhmFLSnVk= 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 DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Fri, 24 Aug 2018 12:16: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 4/5] dmaengine: dmatest: Add transfer_size parameter Date: Fri, 24 Aug 2018 13:15:40 +0100 Message-Id: <1535112941-7169-5-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> References: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: MR2P264CA0045.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::33) To DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89886655-bc7a-4038-5445-08d609bb641d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB6P191MB0248; X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0248;3:Rud2jUhPKytUttGAjYUkSGy+S38M0wPThGAyTKOpujm7w4mVX/+e8NG2j4J8SJtSH6TIRVF8LNQG9llu1jfAsKcH/xvS4oWvsL6YTVpnO5FetZuKVfcPdUWSWg6gpKg75zybndYnMrxpWMwniAvToQlLZsxy/LI59HwQN3QVbLK3j3yW9tZ+wsZDHH9fSB5/qTuvTYTqktB1QjmrmQAnjvwkPz6WqJebNftOv1cS4i2v7Xz52xDggas+SoJUkILj;25:7iOfWClYbHQ0x519VrnDcfb5t3fVqmXs6Aq4zy1sKS9TI34i1DSJcbMnSjzpmG1pwTED3jDsGKUSFayoedQ0gfCo1pzFKHdv74CqHm8A5e3RbotRJ2XVooSQ7oGfa8OsZBZ85Dg+wuZDHuAP3Be0Za0Yel7qtr36t4LVjI+JKBV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hYXvQGsrD/lfX9aZZExliOpUXzvTiXaVelZ6+KYYgDsYUsGvIzGhXxmlQQVDz/jK7je7IijkQ8jsV0Pzv6DnZ4T/f5P69TtfxnMxbBgvsnweRXpn+fLwuxCepEd9UiYFpF6TDpD/TdNVPIiqsv+wMJqXWFBWTPVVnr62S9ypHRBt/BpjWW3Hn4M3WLZwzPmAeO+qcQkbMnSg== 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)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:DB6P191MB0248;BCL:0;PCL:0;RULEID:;SRVR:DB6P191MB0248; X-Forefront-PRVS: 07749F8C42 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(396003)(376002)(136003)(366004)(39840400004)(189003)(199004)(6486002)(386003)(476003)(956004)(11346002)(52116002)(50466002)(51416003)(2906002)(36756003)(2616005)(5660300001)(48376002)(446003)(186003)(16526019)(44832011)(26005)(6506007)(76176011)(2361001)(68736007)(14444005)(107886003)(106356001)(25786009)(47776003)(66066001)(8936002)(486006)(53936002)(16586007)(105586002)(478600001)(6512007)(50226002)(6666003)(4326008)(316002)(305945005)(7736002)(81156014)(97736004)(8676002)(2351001)(6116002)(3846002)(6916009)(81166006)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6P191MB0248;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;DB6P191MB0248;23:LeES/lR27lb7gl8hEDrwfkayL3nwwUnVZ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RwMN8lGDs91wvpjNSOQHR/7H1R6impqiYOwMx6os4fZL+o6rT7X7XcIJtKUIamro/Gdge7SPK8b7aX0kWGPrLe/5ZeTXI2IT052+J/7OT7cWQLAnIlprBLIGgf9NxPuUWrbV5yQJvtzcfb4hbXajAYwqtS+UlmQtKJIIzq3egCCocSqrCN X-Microsoft-Antispam-Message-Info: PErKjl7ZGK6dBoZ/qGGpCSVeSoahYz7Wt38PClJ7fNpVL6w1f2bGk37Zs6YhTH5pEIisvkptveQJ+05hpgDpLg90B7OxjYBKS8IGL1lF4awcKtu0FihP2wv5ZPKWScfoQwBt2YrsY0AUhqh0vJeW26c8kO5ddKhU13+0KqYoJmyuNeQCrBNTS3TvWfsSGPv2qU0cfH9xjz9rRtYqS/DIn608DhKzYHwK3UOJGOOKaDgpcmj9lFrv/jV56lk2GB3WOq0cLFUe0O2IUZ16wxsAjAsAdUfVU914UhQE524Levu+w707FZwuByaJLiiLSyNkPYOaXjuF+l5yTxirAAJelVwZ10dau1va6FEYqyevvMU= X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0248;6:bfzyFreGybVic7dEhIDN+XNIklYEHNZvTew4Go3Tz/zZBbCoyYG4jY9iE45rUknSnpcL1nI9cwwbWsv0r2ExY+HngXpodLZ54F2RRG+KvB2RLGxPV0IarvjfGrv2oqkV/lwbTGwXAEOUh5pGrn/hhbxgxVwu5pq9VlqGMvVPBVOkwu6yrEHE3uXdRwa/z4yTHTv564gee4hwaibySfALPPG56SU7fOWgGFipAHTACcHv18U8Y7BAU2a2vvIFIg5VSTiTRYwzibM0H962fu5OajKxs30L5q6qg8UU/f+yZfJcjqdvdXM77FnwPMovcx9jYORDXQesjW3VFkQVzR3EXttZqAhOAHSgTa0o+IqYNRkzhDJYy2psdf5VQ++TgdlnMDbDvzLJeOk4ZNbxjWvJLuMyJSmw0042miEOktaAdxJfUq/rczWCuYKNzCO6hECAJzS53KRcrluxPl9owabzAw==;5:/DU0lAV/w7jxtkWBUWj1IUPs4QUvYYj5eyq1k9j7W2HxnMFGj/TR7kZBf9B/g5tjmYERqr6Kl3mLNUBKu5h9nH1uuvlkz9dZuj3mPT3daxFXyBhvh9dhgwphhvB+tUTzVUdSbHa0pSB0ld3G0x8k8ka7APsERuQufYA6IXKh65s=;7:KPq2FVTPxmdA1/CZPO4acL9141Ii2vv56Nnljj4MWCk6OI8VmlTpCFh9FrG0atQk9LFW0OrsRA4EU85GIx8/CDT1zri0Gkc+tIoOOMKpUAoZsCIpFVMpJmvmkGsDOuLftwh5kXti5ML1yH9Rt4cxdiB/faJFPFBGOeOFeZnKNx05W3naVJzmuNbFfvAQTfMaykbdkFSCeXxy2/az1Z8CgvxVRJKuLnF3oOz6bBukRumFj35CfNydrDXdFYsPDum5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:16:15.6546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89886655-bc7a-4038-5445-08d609bb641d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P191MB0248 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 e3542cd..bb1f99f 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 24 12:15: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: 10575301 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 B61D81390 for ; Fri, 24 Aug 2018 12:16:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6C292B7A5 for ; Fri, 24 Aug 2018 12:16:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AA1F2B8B2; Fri, 24 Aug 2018 12:16:28 +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 188082B7A5 for ; Fri, 24 Aug 2018 12:16:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbeHXPuv (ORCPT ); Fri, 24 Aug 2018 11:50:51 -0400 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:20832 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726513AbeHXPut (ORCPT ); Fri, 24 Aug 2018 11:50:49 -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=ATuIj367yFSKDr24bfTaM/V5k4utU2JfxCIs3eajv7sVWUwjkPdiPcOTGhRkdL5wMyWRgQGHLFjq5GBaN9QZUlqqmtfeEWE9QSJGIJT0A1oR7Pyyv1itAOhH2zmFvWkvJiWIsI9kyH2EQyHtHayns0V0/l+f83YuWIZ7B71baLc= 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 DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Fri, 24 Aug 2018 12:16:17 +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 5/5] dmaengine: Documentation: Add documentation for multi chan testing Date: Fri, 24 Aug 2018 13:15:41 +0100 Message-Id: <1535112941-7169-6-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> References: <1535112941-7169-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: MR2P264CA0045.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::33) To DB6P191MB0248.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d98ded61-17d8-454c-d4ce-08d609bb6506 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB6P191MB0248; X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0248;3:3jcZPcFH0YmYqzaBBiv2UWgEn3i3DpF6BPhu3Vu76e0Imbs5S+pjD4+gNx6QfoTwVFR5fSm64JfcKO+Zp+Q1+B/Jss9LUVp8mrW8pgjgliMEMjkD7MGjXngJg+ghAA5HICWwta9zsgnLHrnBMW7S45TIgylaW1ht0d+bGpScYqm5Aoo/ZPZhva8RF9/AJrcn8Jn+t+2/DPO+2eJq25B8XD+/sCNyAgiUkslvLyiFOY0GOTppWEKkXxF2IwAAO56L;25:4JjIiBn6+GP1eB4OFFUSz+XHAi3Sy4FKfIvNkO/j9ZB87kn2GPwS47HfXmfq72aQaywzaYSptmi0glLUEKnsakSS7M7Y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YnW+Ids0zdK7hZe+5NbbeIJusTlNttrCuDVP0xDw2Q/yqfo39UVMxycZqsSkWqtXGZPMeykDmHg9OEHWbhX9jBuyKPZ+Wall8eeVh+j8Y1RDvgp2W2SVKgvUylnwH4QBjreLgWHWiqNRzm6wcwz1HrTdsjFEOVWzq91ATLKoI4GXmyE8PGhrKhKUkdsIKn5bta93Ak7Nwvl9GyvzyUuGthyqctu+TEE0/xzLsR1voHgi1qbKIPwcAd3UU2EXCno2w8bhtKbkHRFlmE9wc3mQ== 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)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:DB6P191MB0248;BCL:0;PCL:0;RULEID:;SRVR:DB6P191MB0248; X-Forefront-PRVS: 07749F8C42 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(396003)(376002)(136003)(366004)(39840400004)(189003)(199004)(6486002)(386003)(476003)(956004)(11346002)(52116002)(50466002)(51416003)(2906002)(36756003)(2616005)(5660300001)(48376002)(446003)(186003)(16526019)(575784001)(44832011)(26005)(6506007)(76176011)(2361001)(68736007)(14444005)(107886003)(106356001)(25786009)(47776003)(66066001)(8936002)(486006)(53936002)(16586007)(105586002)(478600001)(6512007)(50226002)(6666003)(4326008)(316002)(305945005)(7736002)(81156014)(97736004)(8676002)(2351001)(6116002)(3846002)(6916009)(81166006)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6P191MB0248;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 permit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bLyGHqzTqSiXNuNhZP3vhv2fq23ZiAnQ2eoNbjBEXZOAidBb0SIQ6nkTXRpY4SD5ec/xLtu9R238SJ3cMtU+BfA==;5:0zT4ojyrSIA/zok75+AkucIp1bEmlsn8YkfGcRKkE/sIZqQ67KsDIT3cW9r+9ny4gZxXCWdCaqR5UbivY7cEgJYE75rntd5/60vLDJCo6YY8yVLSgM5Ix8HQ1Vl/NZXgzDTZElOs00B7M6gs5bzgZXgFx25FJXbtlWQ9tCBnxKM=;7:zwX5b9GCbx/Io0YnRl3DHrzy2R0j2XZljYr/zdJhx3AuWx9RvVv8JgR9qY6w1LitL8BGqXPn0w7TwxnCsgjNgCOqSysKzLUGPjEZMjU4u6a2EAMPTbgEAHkWqzepYy01w0Xgj11Cvi1NcPYZq3nKie8t/+57Dwmg3n0uf3/3LW7tHUolQLgnNZAT7UlcLGBu5fODMVavD60oqLRKCoS0qFLHbvhS8n7IyxUR67Plpos9vFMPzuwBddC8D3myn4Nk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:16:17.1819 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d98ded61-17d8-454c-d4ce-08d609bb6506 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P191MB0248 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.