From patchwork Mon Dec 10 08:52: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: 10720841 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 65A8E1751 for ; Mon, 10 Dec 2018 08:52:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 576BE29CBB for ; Mon, 10 Dec 2018 08:52:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BBB229CCD; Mon, 10 Dec 2018 08:52:46 +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 DD41929CBB for ; Mon, 10 Dec 2018 08:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726572AbeLJIwp (ORCPT ); Mon, 10 Dec 2018 03:52:45 -0500 Received: from mail-eopbgr50076.outbound.protection.outlook.com ([40.107.5.76]:52480 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726472AbeLJIwp (ORCPT ); Mon, 10 Dec 2018 03:52:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sondrel.onmicrosoft.com; s=selector1-sondrel-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FihYHAmY77wE9va8wKPRJR3SI8VUP1472zRlbbt3eVE=; b=Atp8SBysXMPqgqczSbewj4fLcwd4m3hJvwkvO9lcoGqemlW+FlLPi4MzbxuTjFvn9f/s3gwCt9BxLPACLtFooginI+Fege1IfzND/T0TPeL2SHXVdxxdqAuNIP2Eh0Ga83fL1fB+OnNPWBG1uuGfUhBpPTUVAvnhBs8bzb3bQtU= Received: from VI1P191MB0255.EURP191.PROD.OUTLOOK.COM (10.172.82.20) by VI1P191MB0191.EURP191.PROD.OUTLOOK.COM (10.172.81.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Mon, 10 Dec 2018 08:52:37 +0000 Received: from VI1P191MB0255.EURP191.PROD.OUTLOOK.COM ([fe80::cc1:80a8:5ce5:9674]) by VI1P191MB0255.EURP191.PROD.OUTLOOK.COM ([fe80::cc1:80a8:5ce5:9674%2]) with mapi id 15.20.1404.025; Mon, 10 Dec 2018 08:52:37 +0000 From: Seraj Alijan To: "vkoul@kernel.org" CC: "dmaengine@vger.kernel.org" , "dan.j.williams@intel.com" , James Hartley , Sifan Naeem , Ed Blake , Seraj Mohammed Subject: [PATCH V4 3/5] dmaengine: dmatest: Add alignment parameter Thread-Topic: [PATCH V4 3/5] dmaengine: dmatest: Add alignment parameter Thread-Index: AQHUkGWzgdLxg8BdjE6JhiNejNO1vw== Date: Mon, 10 Dec 2018 08:52:37 +0000 Message-ID: <1544431926-8662-4-git-send-email-seraj.alijan@sondrel.com> References: <1544431926-8662-1-git-send-email-seraj.alijan@sondrel.com> In-Reply-To: <1544431926-8662-1-git-send-email-seraj.alijan@sondrel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LNXP265CA0077.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::17) To VI1P191MB0255.EURP191.PROD.OUTLOOK.COM (2603:10a6:800:a7::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=seraj.mohammed@sondrel.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.88.9.101] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1P191MB0191;6:qcq4HaAMDBI+t/zXvNMMpAf+4JHDgRpBqxDCJ+vopefChxKtkys2i2LhHi45+qjSepQzLbN7wFmoqbxlNDBvgzrvmAOvxEIanCw+gFvQpeWSk3f713rRPcaiBE6lKKcmGT+dwYQslhed0Explgbq64Y4yleGAFEF9w1np6NGKLV+DLtLn+Q4zN4mtVNh12y52fhu69udL2QDcAJzw+AZ0v46t0IqwthcOsuZdC1w+W+ogDYumVa9PpWkuR94UOzGnGI8UVRocOpRB0GEaLCGNRHkOS+DmBPSDTUdkUfn8sgmMVOamlG6NCXseb/BY3305SUGj+xEzYyjRkPzRg4aYWYTI738H8+Ld3pwkn1L74E6RIuyRMfYvM/RpAfGihHZLOLqz+sQjrGPJFNk8Ph3vh59Bp8ORVCUCAmzNjYmRexs8I0+zPnUm+yheAYjpdI36696iTWV8CStWRvB4Om9Ow==;5:ufgWI7T5iJnM0KQ5QMgaP+olNtdWRo2u+IiBhti7p2HYSi3nWtzqsNc2MYNr23B/0t6fcM6JU27LsPwBZSYwDLz8GzOA+vSK1P/hVKnVVB28rz2dL3m2AcOZr3OPdSuldy9Zu7DFvuuprFpAcJO8OJ5hXSJMEsCs1t8qh7t6qQc=;7:OxaQGpEK3v7MVzvk404YVy7LRWLIZZXXygAR5mQdKKOMOfvj4NZ6p/QLgVhy0J1QR6HtTxRZdXXBpv1Dve7pHKUgXde51Zc1EoGqEz1RwzWdcrK7pgu1vRPzrHvEcNfLz+oV25H3JF9CcszgBKiO4Q== x-ms-office365-filtering-correlation-id: 513d83e5-3765-4cfe-b5f7-08d65e7cd551 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1P191MB0191; x-ms-traffictypediagnostic: VI1P191MB0191: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(3230017)(999002)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231472)(944501520)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1P191MB0191;BCL:0;PCL:0;RULEID:;SRVR:VI1P191MB0191; x-forefront-prvs: 08828D20BC x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(346002)(39840400004)(136003)(396003)(376002)(189003)(199004)(5660300001)(5640700003)(6506007)(386003)(6436002)(6512007)(1730700003)(3846002)(8676002)(2906002)(81156014)(81166006)(53936002)(6486002)(76176011)(52116002)(486006)(68736007)(107886003)(446003)(11346002)(66066001)(2616005)(4326008)(476003)(99286004)(6116002)(36756003)(2501003)(186003)(26005)(6916009)(478600001)(256004)(25786009)(97736004)(14444005)(2351001)(14454004)(54906003)(8936002)(316002)(71190400001)(71200400001)(102836004)(106356001)(105586002)(7736002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1P191MB0191;H:VI1P191MB0255.EURP191.PROD.OUTLOOK.COM;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-antispam-message-info: GYgh5X2i2VV7Gv9iyY1TuzjKOslZPLBsxGdKKOshq9KEwY0EtVAovDjlyyKSK3DFzQWskT9CPEn/z/nokulS/Kua1yp9BTFEmbba4FPV3g5WLPM7ZtjF8UHz7DgAtyDB2Xt2XwdGfp2HHRimMLzwcHPIC5sH/RPtrlyPVBO69h8oUctGhjBU5iN572OJg4NWhVIATFJrEpBZGQqGo/6PTJ0P4nQuERX40pxBR4mdbTAit65VgS/LGqIzSwbBcmROJBvnq5oKc13SJX47DrPnSMv387T4+l5yMeN9B7aIlj4aPPl1m1QZzUMf3Q5HthYo spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: sondrel.com X-MS-Exchange-CrossTenant-Network-Message-Id: 513d83e5-3765-4cfe-b5f7-08d65e7cd551 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Dec 2018 08:52:37.0273 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4faa3872-698e-4896-80ec-148b916cb1ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P191MB0191 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 998344b..6302ebe 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) @@ -1037,6 +1046,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);