From patchwork Mon Jul 23 17:46:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 10539819 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 5E0FC91E for ; Mon, 23 Jul 2018 09:46:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BF24285A6 for ; Mon, 23 Jul 2018 09:46:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40584285AA; Mon, 23 Jul 2018 09:46:00 +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=-1.0 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C30EB285AD for ; Mon, 23 Jul 2018 09:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JD10sbTYTNY/vNp29g1GQFz21Uy+idy1EU5AaO4g2iE=; b=W11rPRaVOSrpIh kJMzM8wz3r2mar59o0LdzUbcEmKYEjX2rMHv16RDz80D3KtKAw9MaC+D5gDvZbdvW2FCPKaru8PEe bkVC51J0uq2bK5JABOddEFHY0Jj9TZ/XYvW1odDMnl7PR8rMn4ziSwaYxPhxO7fCK+urHDDlQJu+o 0HJvDAKPvGGnZnahfa28Y7Md3q+gBqxzVgwtYAyvO+6fnmENByrFpCW3vAZLX5ZNFGhMD7Nnb6Quc 875coHRIGpRpqmHzORJaPpf+muenSFWE6BbqRFaGB8u7Tie3m6yygGlXni6hib6YCdfE4SafeDJlC CIisW0chGGlVIzaY2nGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhXPe-0005lk-6a; Mon, 23 Jul 2018 09:45:54 +0000 Received: from mail-eopbgr10061.outbound.protection.outlook.com ([40.107.1.61] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhXPQ-0005UL-6S for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 09:45:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2dGpd66jhEso6apISiQaFJu5TVvSKsEqdowif2s3tEk=; b=hyMRQBcZIzSUC5d4p3yoeJJTaxQ82a/uBFoQRWx2/1eZ67I2CN5/OSonS77+VypsRwbwR8o0gejO4GiUhfZIxohpip+Pe+BN6JKjHr+Nw1NL3nTJj2NwHirQaW3nqUvjXQiJQY9jlPywfCv4YWktt0OSn/c3giBmqCLuAf+kMxY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yibin.gong@nxp.com; Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by VI1PR04MB3232.eurprd04.prod.outlook.com (2603:10a6:802:6::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Mon, 23 Jul 2018 09:45:28 +0000 From: Robin Gong To: vkoul@kernel.org, dan.j.williams@intel.com, s.hauer@pengutronix.de, linux@armlinux.org.uk Subject: [PATCH v3 1/3] dmaengine: imx-sdma: add SDMA_BD_MAX_CNT to replace '0xffff' Date: Tue, 24 Jul 2018 01:46:10 +0800 Message-Id: <1532367972-29707-2-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532367972-29707-1-git-send-email-yibin.gong@nxp.com> References: <1532367972-29707-1-git-send-email-yibin.gong@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR03CA0086.apcprd03.prod.outlook.com (2603:1096:203:72::26) To VI1PR04MB3232.eurprd04.prod.outlook.com (2603:10a6:802:6::29) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41066a21-8e42-4dc7-6677-08d5f0810806 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB3232; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB3232; 3:AHspo+dY4FZmazc4LuR96dz8nGB6sAt4U3zvV1e3Q8NDZ0xrowjU+6WzFhVWO4/WWLc9O//nY18XryN/dOn95RwqAKhKjDVVh66jzboG3SBCIs1KibaNe1elMODQqA8ly1NWf0ljW5+HuKuY+BLkQTxzwdqVtNDat9kS7r0ixHovYSfTodhbU68ArDwickxm5uL0Z0jd48Gl9rDlB4Torl+7eSew5NjQu20CZj206xITujMHaFEHEd2tmfaZZhZW; 25:+k5SAX6nrp19OAITcr3VnTDoapgNzmjx9dfjCI5T208uV1tCi+ZAWG0nXr6khFzRYmRflfofNzzaCo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; 4:LqZrayEuk2WYN+/yePv3MJbYD+G/J2Rr1mNhCww9KJDj4/vogMA8o7Q8K8GuLvNAEDlFCEtA5PFWcLzEOG7hisRp/CBM9PRAAW0XelRrbHb1ZzVW2Rf+++8Ee7wbdo8KRnPhJDc2xpEAp9vLVGoql3sYOkiOIcDlKzlvJOwVMDjWRN9dmzk3zzrnteDTmVl3VbfC2AuAk3tvM2XvgbTFqRpQC3h5VP0/pxxBH7qzLwrZvXQLAFBLmG+6NN2FfYrvobe475v5WSAOsVIVByDo6Jvzsml45g2RUzpOYtNp1fkEqlbpp4+gx8B6Bocnex3txtoBRHPdz8TmX8QMLeVfQLs/e+w8QUWYGpIzkC7EpjM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB3232; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB3232; X-Forefront-PRVS: 0742443479 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(136003)(39860400002)(376002)(199004)(189003)(16526019)(6116002)(3846002)(956004)(8936002)(66066001)(47776003)(53936002)(478600001)(305945005)(26005)(50466002)(48376002)(476003)(2616005)(6512007)(25786009)(7736002)(4326008)(11346002)(6506007)(386003)(14444005)(36756003)(50226002)(106356001)(97736004)(446003)(5660300001)(68736007)(6666003)(105586002)(2906002)(486006)(81166006)(8676002)(52116002)(81156014)(186003)(86362001)(51416003)(16586007)(6486002)(316002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3232; H:robin-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB3232; 23:MjA+KuMUAYRdOwmdMdnKTlvTw76sETVA/8P5aT5Kh?= s3yrCnlDcqFrqZxwo0mMfhqnMLpV90Vx96edNmjHIjTq01403fqUfMSnco9JorkG+ldqjmMkygU+NELwTO8cRrTMA3bsSBMjFY6IcgRZI5gwgTsper8Jfld+TzGWMqocywK2zJyOHnAih528GXfTw9Ux3DHy/bqfT27ZIDnfUz82QVPHpNgWJaIxyzRuDwOijq8OU5GmOM7FAFrq86FiPujKUrBPAjnwrE5lTrKTh9c+1aZcs2PmFIDG2RLpOtFtR8lESR15etmPZUzruRLwnOHBC5l51hRNILvf6hLEea+2gaXgg44sPDe5uDM4MLs/9CD4JhfsaMI7IAQ7KQPQ1QqgIq9VxYvN5Tj17dhpw8Bdq93reS50t6ds6t4n4eh6ab8hIdFHaFc8mPFi3HzPt+usmPBYsFzu06d+5gcH5BbqYZIRsmm3QHbF2gmbqLEfucwuygP92MLMKrjnqtUXiUpFEJXxZ2sKjUMsxBG2+Mcg1bSATJgHoAm7UhF8DK1bHZJPx8UpiWk8d+5MlcDg1hEbWdSsiqX44NQmAQVBOBxeoGD2mFgTWmgBj6jTtHd3xj+/mpIXJstIOqa6n+12eLsEGd5MoqOytwX7I4tl4L7fvsJyKq7GjQ5jCW7qWASw2PnXzM+6lItpEo2VHR3nOHG6M28dpLBVGHeCEZG21MAiABsWZIwQa4+HJTAwoH77mQNXLXfObVYNrsCc3y9sOPC/A8vUk6xvS3NmJqKJZ1z48xSFSXR6jtePB063deCQRN4JnUi1LH2nEVs3X7X+03GksDIqfPdvm0qBcLtNSjZjod1Bqp6GVX5CSUw/oxpPzrkwFLsE+MTXGuZz6VCCKMrq4plJjKvCQE3gmDA8rfJw+uiaswnqMUBO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VDKTLzXVMvBbiQO+gPLC2uxDacejzbXuuwtKoToutQuDskDFB6rvsg==; 5:HuXSZjOBmgOD1Ldp9ibNS7VmIwkb+gm2Ws4yldoFFgYvsOjnJVUrTSYk1zqR6ogIRsRv69xvV/+y7fXT08BMjfXaQVncjm//Upzn7FLTckF1wAhzmf5UMIARvjOqieOlX94Sl2utK4//9jqtAvwfnADqfYlqpJsaLowr2JJEt6A=; 7:0mpMEANkwuzCYr4Gysz+NnCWg1XkkSQNuI6I50uTgEEbX4fXKeKZOgkXc+ZJYiMYWvNgOCqhdKB4DgL4X+4vXhbDsiVckcKlHpBeou3rpWaFvUlt98GqMHcl+C43nDPMYhbTgYK0b+33deTtCRCWdnhZyoXFmFjii45brV4fU5aZah6GpYi5ZPRvnGP/ahSk7dz+gNpnk5etRs0hBNMb1fRkgqNwDUcfXJ12fd1fmGMJBpwbC9emySmD3vjYTVYa SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 09:45:28.6533 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41066a21-8e42-4dc7-6677-08d5f0810806 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_024540_235767_2BACA266 X-CRM114-Status: GOOD ( 13.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add macro SDMA_BD_MAX_CNT to replace '0xffff'. Signed-off-by: Robin Gong --- drivers/dma/imx-sdma.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 3b622d6..e3d5e73 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -185,6 +185,7 @@ * Mode/Count of data node descriptors - IPCv2 */ struct sdma_mode_count { +#define SDMA_BD_MAX_CNT 0xffff u32 count : 16; /* size of the buffer pointed by this BD */ u32 status : 8; /* E,R,I,C,W,D status bits stored here */ u32 command : 8; /* command mostly used for channel 0 */ @@ -1344,9 +1345,9 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( count = sg_dma_len(sg); - if (count > 0xffff) { + if (count > SDMA_BD_MAX_CNT) { dev_err(sdma->dev, "SDMA channel %d: maximum bytes for sg entry exceeded: %d > %d\n", - channel, count, 0xffff); + channel, count, SDMA_BD_MAX_CNT); goto err_bd_out; } @@ -1421,9 +1422,9 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( sdmac->flags |= IMX_DMA_SG_LOOP; - if (period_len > 0xffff) { + if (period_len > SDMA_BD_MAX_CNT) { dev_err(sdma->dev, "SDMA channel %d: maximum period size exceeded: %zu > %d\n", - channel, period_len, 0xffff); + channel, period_len, SDMA_BD_MAX_CNT); goto err_bd_out; } @@ -1970,7 +1971,7 @@ static int sdma_probe(struct platform_device *pdev) sdma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; sdma->dma_device.device_issue_pending = sdma_issue_pending; sdma->dma_device.dev->dma_parms = &sdma->dma_parms; - dma_set_max_seg_size(sdma->dma_device.dev, 65535); + dma_set_max_seg_size(sdma->dma_device.dev, SDMA_BD_MAX_CNT); platform_set_drvdata(pdev, sdma);