From patchwork Wed Sep 19 19:52:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraj Alijan X-Patchwork-Id: 10606431 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 489A5112B for ; Wed, 19 Sep 2018 19:53:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 392862B8D5 for ; Wed, 19 Sep 2018 19:53:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D3FF2BA2A; Wed, 19 Sep 2018 19:53:33 +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 B11122B8D5 for ; Wed, 19 Sep 2018 19:53:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731950AbeITBc6 (ORCPT ); Wed, 19 Sep 2018 21:32:58 -0400 Received: from mail-eopbgr00060.outbound.protection.outlook.com ([40.107.0.60]:27849 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731253AbeITBc6 (ORCPT ); Wed, 19 Sep 2018 21:32:58 -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=eEUSKccSL9lFY2/dYaT+1doFkhZYKZvzqzfw6bBbuc4=; b=CYveiufnqB1047pLSc3gCqWkqBHff0UrjtW8P5Y2A3zsLHBB4rVmKTKXezg8jQFe4lJoHspO6li1VdfA25tBj/GbQAw0R5wE/ygavONneotjpdEqA/vx8CWNuE2ReA3xGlQnBXIzaIqeTeIURGMNVTtWA4aAU/RzXJgtNxuoITY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=seraj.mohammed@sondrel.com; Received: from Seraj-pc.hh.imgtec.org (195.88.9.101) by DB6P191MB0245.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Wed, 19 Sep 2018 19:53: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 V3 3/5] dmaengine: dmatest: Add alignment parameter Date: Wed, 19 Sep 2018 20:52:52 +0100 Message-Id: <1537386774-20749-4-git-send-email-seraj.alijan@sondrel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537386774-20749-1-git-send-email-seraj.alijan@sondrel.com> References: <1537386774-20749-1-git-send-email-seraj.alijan@sondrel.com> MIME-Version: 1.0 X-Originating-IP: [195.88.9.101] X-ClientProxiedBy: CWLP265CA0040.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:11::28) To DB6P191MB0245.EURP191.PROD.OUTLOOK.COM (2603:10a6:4:8e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 463a43dc-9682-410b-b7e6-08d61e698fc9 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DB6P191MB0245; X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0245;3:m/yYJgAhyz/sYPpiY+VuY+wwFHT3pdMoslMOW5TOVXtC5ocyxLA42G2qwnw0HzT0nbPBPY0J1wb14PQlwT0LwicYMK+FzGwDnbMijqPebluKLKDLKE6KUpIQat6swnSLRLs4A4ej6lF7ort+wupIcqflEcjqlX6vapYAsrnHsZRhSXrxOJ33xnEHIrwfFcQupE2RQitNW3Ztm5evK8WostvBBlmG4C9nVA2hR00mC7TH5wpEder0FQbwfBbne8v2;25:wlqwL2P8Kw7JImdde7lxu/FwC8fEzn8vzcqtiOwNEDfy4oz4BJJYpNyGctJHmZZg9MKEpiuckPUmXMRPZC6d+2/KpHuB3d3TlK0KO71vqNsWcf5RVbPG4lc7jSjZDv739V3gHvr6jhN7TQqSwkPpkfzeOtIiD/WBGCQzmL+lvgjaJ1Ong5Rm8/0ia8Ay9Ka89GSkK51n/E5bPJfAsbge4MIxXtc2gWWcd06KpUPVzMwXOFSb6aflORqSl0knUBeXjXdP91eogc9kmRC+DDidpzW0VrGDmZ21H/dYFMvzzY3tBr/YutSZpMlp0mXwgBO55l4dj3ECcDbelyAVH7q06Q==;31:xNyK4plI/Fk4zF3t4j8/F1//QmAB8u3+GB1srSKzphx07dhB3nhx0qNJ/OqyzAObG11Lg7DZUyXwmJW+FgC5j7oVNXUs5BAYqPnvYdU8QZoEK8ZfhliAb12kBap5W7G0IlawbNMZT5M2dGwZBBOjAQPsiHOZCP3YtM+MtinWcb3sYK2aWrrTUkRFJcc9ciGRZyz4iuHwolshrPTJQpCWZvomOMTKdFoyKWFJqIL/caM= X-MS-TrafficTypeDiagnostic: DB6P191MB0245: X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0245;20:+sW9F26/HY8XkBuvKfA8FX1ijgHKjmWzmys4YMQamezd55E2xW9bLSSfEN1py5rw9XVgeUBPnUc0I5SzW4rH+LGG4jU/ny7gSjRVnzC+GmRlhfVJW8WB8kfNt1aOlFG0td5RmvGwl8KM8L33vf3BEHhUNGtRWwK6Qea1/TIrryLYQRRjGwk8k9BtyP8yG1wTKaXn2hNmvagWaGV0vcyvkye2DqcURtHveIMxxEDbs1dIlJ4XbCsnl8QMi1Gv9eL1QepNa0K41adUpHc5nNN82on9ts7S1NBVUZtJZbxtAiMy1UrCcupnmDaaHGDFCbT9D8xlUrwGuivYiV5zer7RCQP4X872CKjgFtDPhiqkkKpICxsUXGj0zKruyhSy4Cni21mo9u6E4pEU/TCSqeTnhNbjZaXoasMJi37nQFKQ4Osbem1KKBZz3vfVgZUk7HFVgfOPTaoeKAFoA2W7dKorTmmM45REMRk2+vGge771nhSd6zuiRPvQCiOE16TA+Zq/;4:GF+3cgvv1EJ+6y6D1RrApRX0kP4N57nWvoEe37b5cx2WhAd4crxjW69Ucg2b452qj5wP7EHPkw0aapoUaKuFvvAL3dXgl3h4+/Qw96P4qMaj6xWyHGyB74mHIDPeRHryYK9PvxbK5aXRjyn0yJERn4Z8C7hWAumCjznLJ+ldLjti86/LuCb1Y4G90JmtZphdZ6z+zNVmhfskPzPWmBaJdPa9E087JjzBCeW1Z3gQkMDbfbn+iUXTIHiazHtYRoRbkPE+/lV3wCt0zVpP0KYRRw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699051);SRVR:DB6P191MB0245;BCL:0;PCL:0;RULEID:;SRVR:DB6P191MB0245; X-Forefront-PRVS: 0800C0C167 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(366004)(396003)(136003)(376002)(346002)(189003)(199004)(316002)(16586007)(53936002)(25786009)(5660300001)(2351001)(76176011)(81166006)(50466002)(52116002)(51416003)(2906002)(36756003)(6916009)(6116002)(3846002)(14444005)(575784001)(48376002)(8936002)(386003)(478600001)(81156014)(6506007)(66066001)(97736004)(486006)(107886003)(2361001)(105586002)(106356001)(6666003)(6486002)(7736002)(6512007)(4326008)(47776003)(50226002)(956004)(16526019)(11346002)(476003)(186003)(2616005)(26005)(44832011)(446003)(68736007)(305945005)(8676002)(16060500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6P191MB0245;H:Seraj-pc.hh.imgtec.org;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: sondrel.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB6P191MB0245;23:go4wkShxkbi12JcuiVw7uG9G8Y1kjYsNGtTNYv+CiHe9GoaheZQPAcWBq8dAxGH2XGMn2arZVk9pN3iaoRl7NRERoYUAcsx5VCdd5uQdUOVGS//YBNmXohD72lXxZeT0EtQS5g2DWQxCmc+oE0g8MnKhY+JYhYVxI0KJ8OHRfvFuNQXEVZ7725elEFbtEizNUBwtrPoSPnIHTnjIoYxSwgjRhpi1+IZqpKOjwWXR5wr6b8kHnghHXwahWOepBOo3vlAQKgYxQn6acz337b3cgC44AamAGmm4rGvynXXCpjw/hu5qXT5KCFIfRC0oyn1MW2ZK77VM6BisCA7SrkKOXP/bqfCwaZ2kZh3IKvyaxrii4oYmNiBulcRQX4jidfOAM1pI4QroQVZQSSqnkj3RI1+d68dmyxHnEUKP3Hh1+mvnS9jWpLFGLs2ulYADANhF/NHpwPrJ3Dg95taxTI782n56u5mtJ8umEJPoP+m2sQJuo++cuWaAp4/1zmc6UE2fgMD9GtyQyI4MzZdeTAxG2E1cghV/METXmGVFYQz0UJRVehaPAiYqfR0YzAe9BpqAiyXsrfNZV91k0cUiDJeYMHTOAF6gsrF6XKue2bvsNh5GyPw6of1HvZqrPbgT8Vb5rqT/XmkDUHs88M22+LbzRdb3Y8nULjv7aP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V4cdpPNy7EUNes1ePQjJOUOCe7y0iCz6FlBLYX36Q+kW/kEwY1QgW9UdZQGVfIWERi/IGLTBJJ3HZNQzc/LOIy6lT7n+CwILF8f3UoJTfcmz9jPzZMaeTwVE9KKlFcj6xDYJcRfROu9wHDzC3fhXEJ5tTzmJRHIPBnoxrdqkvzn+1kxMPnzJ5+CL7LYhha0Q9Ybv2gWdEp0YD+0YFazGJ7QeYpBAiL//ma9n5nb+laTBXRdSwJoUT37EUgSAuI5MerkRlpoae7sxg8KCKz1GZJjd4dz/GZu8T5XcR4+vcYspEEc/kV6UjTrLrK9sSEkaHwQSSwYqso3KiVTyHgW1WTVvKweuWJAvI7JT/7drljZgHeJloMeJ+T/5/JZzMYeHG9Uxgw6V4VEHd0n8LRxvlkbbiBELrog4KN5I59CqwleSyTRl8mpng6zbw==;5:YjTxY/t/3kVTHpW9MYPkDDjkh47hb7Gi0kkSFugMkSirp8TQD/8ieTCsENfD2lSbk6wFpZTlLv1rgQLXk78TYoFJ4DS+UGr4wDK98ELwHYCr1bSAp+ai2RTEMxEbk1eFb8jDk9/nbfMSIVCbn7ckaGZ5ZSqcW+Uky+pGsnGEBXw=;7:MnLAFwuQA1LX/bRR0pOOW/P+5gpdqxp5JjT3xOEDlcunQvGiJ8DeflXZyWDpFpn18vVUEDOcNYuqWn4JM+Y7cEI3NwotO2v7h6eDCgVWDUnahDjKaGCUIaaEfCZxEmicyRnWhUO6M/oC69jK8KBagABizXA08cbGRGvnXgG369/emyk2L3geqO4Z6fxBFd2Wr09xex173StmsKJy2LhG9mCRygyDVmajrTm8DoGTgHmiKiv2PwDLAXaGc9eJy/tJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2018 19:53:24.9862 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 463a43dc-9682-410b-b7e6-08d61e698fc9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P191MB0245 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 22f0e4eb..300fe4c 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; }; /** @@ -526,22 +531,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) @@ -1039,6 +1048,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);