From patchwork Thu Jun 14 13:35:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 10463329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E78A460348 for ; Thu, 14 Jun 2018 05:38:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED271288EE for ; Thu, 14 Jun 2018 05:38:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1C7728910; Thu, 14 Jun 2018 05:38:49 +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=unavailable 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 97C9F288EE for ; Thu, 14 Jun 2018 05:38:49 +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=RKA8izDp3q1H9+SMoESsQMFZX9RDfPIJndz1Y0F47nU=; b=Nh4gPDiCF6p13V 8Z1b5XFBCeoSGuwJwGRsfRzPXxapeBQ6LrwEjMbqR/88+MTeXnvKM68IXs6a7SwNWwnBIh7ALxK1H dkK1YMN8ewO6Bjwboksb3PeUlwyp5OpUJZQ4iAXx3HRdvyD0p7pm1pX7JtBv+ag46W3bgk4MUe2Ve dQfkJwRdXEVAxadKJO42xGVzO3vTPmKYqNuZ/LKiRpyzMS0kWX+Im9KRlGqzLgTPVvGgPNNp75Cux e5J3XtLgBVTUrUIA6GHeBToEaW8jOS0P5F8HZ1nI9NiOmoduLNXIq4tNYBI7OfDAhwujYJmo/ymyc PI86kvx7fh/oK82xOAdg==; 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 1fTKxx-0000tB-4T; Thu, 14 Jun 2018 05:38:37 +0000 Received: from mail-he1eur01on061d.outbound.protection.outlook.com ([2a01:111:f400:fe1e::61d] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTKwQ-0008A3-G1 for linux-arm-kernel@lists.infradead.org; Thu, 14 Jun 2018 05:37:12 +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=JcLSFeggHVq6Eh0NyeOnnk1Sm4Eq+ynj/vQFhgKFka4=; b=SjosMnhs6UMDuUQfwq3JTpcE4VSE/v5uqriJ0N2nhMUnp94gbB81mnSQteqfS4dVSeoP70qASA3K3r80UEvV+LY33V0lo+mM1AiUOyuxACVoqJEOPzSo3CO30SetvBpwP/mw/k4URlx+T2Sa0Bg0Jb15T2s27ygRT4sHiGFZCnE= 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 DB6PR04MB3222.eurprd04.prod.outlook.com (2603:10a6:6:6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.14; Thu, 14 Jun 2018 05:36:44 +0000 From: Robin Gong To: vkoul@kernel.org, s.hauer@pengutronix.de, l.stach@pengutronix.de, dan.j.williams@intel.com Subject: [PATCH v4 4/7] dmaengine: imx-sdma: remove useless 'lock' and 'enabled' in 'struct sdma_channel' Date: Thu, 14 Jun 2018 21:35:34 +0800 Message-Id: <1528983337-2726-5-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528983337-2726-1-git-send-email-yibin.gong@nxp.com> References: <1528983337-2726-1-git-send-email-yibin.gong@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0P153CA0024.APCP153.PROD.OUTLOOK.COM (2603:1096:203:18::36) To DB6PR04MB3222.eurprd04.prod.outlook.com (2603:10a6:6:6::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5851083f-3a49-453e-5aee-08d5d1b8d223 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR04MB3222; X-Microsoft-Exchange-Diagnostics: 1; DB6PR04MB3222; 3:QyoV84g1oO+UhYxeZ3ieWc5iF1nlcxxNFVtD8XcJCNLjlBnJgJ9B/gk47BUX2Z9eHB6WOqRziAyNwol6nk3GvMgylisSX21IEcdQ5oUm1fM81HhMjMwlqFpwiIA+8InZyHbApcoR0HDf5vQDDygVk9AG78LZXURHzPfChmDJDqFi2Ivh1ZSWVZsfJs5MBZczdwweAPfjQps3Iu3qSUJLIb2UmgJqX4ljtnfpOjns/DBiq9AVr7YX1omHOhuLi2A6; 25:wkax4cENEiDHLmQ1/vW5HlnfXvIk9neosf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0MPHItG2OTMiF0e0a2Q3JXNJnq6Q7mVSJpa0E2r/jFQ8jpru6ZWqpLI09; 4:6TxPQpG1GDr2yfJ+WzdSYv2wMl/3XPvdr2EJtThh8PzbuaszLBdrNogUE0ptEf1uXP7m7fQzfo/THSW3Wl1HNpydbV1EuTgWX+0MOzVwGXb+v24lMOKjQMKb/t+KVwAu7zg524o8RqqKmOfg8YuiiQJBvqgUc21QLupNZ5FJ/aDjnrQ89diB3Fj/m8K3FJ+sTmqWYFvfIL/mdv8W6bS/91x3NW0lSk+pcVGjUFB7v6vdhIy2i4ZS77NdUAx4M4p9yOZQg4qRkV92yPxixcasC4BdYgMx1eoZzEeHUQ1xpk3bOJaCXpNzXfNrizdx4OSL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB6PR04MB3222; BCL:0; PCL:0; RULEID:; SRVR:DB6PR04MB3222; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(376002)(366004)(346002)(199004)(189003)(476003)(6486002)(11346002)(86362001)(16586007)(6666003)(50466002)(48376002)(446003)(25786009)(66066001)(305945005)(956004)(47776003)(97736004)(2616005)(59450400001)(52116002)(51416003)(76176011)(6506007)(386003)(16526019)(486006)(186003)(105586002)(106356001)(36756003)(81156014)(68736007)(3846002)(6116002)(478600001)(53936002)(26005)(6512007)(81166006)(8936002)(2906002)(316002)(8676002)(5660300001)(4326008)(7736002)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR04MB3222; 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; DB6PR04MB3222; 23:k3/5CgWQDP+yd8/EGIWxv0j5fOwQ6ckfR/XLc60hR?= =?us-ascii?Q?XlNLtgwNDHfS+STbFUm0KsDUz+KggeHhuzwgagfE4fNY9CM0MvIUrtvCbGub?= =?us-ascii?Q?iDmykGqW+YQCYvn4T5msNum2qnvvvtLe8eP/O34NgJ92PffeefoplmXYwqwH?= =?us-ascii?Q?wKeGQP/C/HpfFbVboabkMj+H3oqr/pwuep3wx5xYudFSfg5u9Pu8i9+Uqows?= =?us-ascii?Q?33BkOUzc0VhwiI5ZksupelC+121aTsnjBNGuUAmHcFOgNFcexmke0ID/+xK1?= =?us-ascii?Q?cibfsKl9sA2Pa1Dw2F/HbNMqm+i5Hdnm0m90hI6TLOvSd9qqnE9JGra2i8Oi?= =?us-ascii?Q?ltYvysOhBshdaghEcsJXDL5UKHVffLYDg3mkmiFLAGT1E8DZGqZtIrFyPytA?= =?us-ascii?Q?iLXTyHp7LVtWoNMhIwlO2f5cs6f8N88Ar9pifs6gLMWncCmoi0xzevR4PKS4?= =?us-ascii?Q?FMVk1E+m8sDzPaSKfsPSGlsVL4Hymr/4XYJmiA8lx/HpPgHIKFNOqLmQxycO?= =?us-ascii?Q?sIPSPWrND2tLjpmyURIeGBQHz+L3PQYx90MI7gVve0Ee0YBLkIJ6HZRw4Ko9?= =?us-ascii?Q?d7tHyBhgDz+1yifCP+mudikMURU+dNm0pmwdCQHT8gAffohKFYbuOPudWNiJ?= =?us-ascii?Q?OhoZi1I4UkEii3wi6bcBQbJc/o2P24oFBF+erxF0IApvfdLH8nxd0kpFBw/7?= =?us-ascii?Q?+uQVssFHu0RZI6z7NkMh8Jefo18kC4E41+1fviKwzI/GdRkHoIj8Mw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10qqzDtU8tno5HjNgqXCJ6l701vuuNtxiBtybX92J5FgXjWABpEw7/zhrM5TUIJ8Cwdgl+HlAWrcejo8mPutbvJ01o462Ei4wsIrUSWuELWUd8yF26f/0V2A6MVoQpxva7fXsGwAbXZz8Y75cRgY+3zHWXsrw9fPbTFnVoNHpMCltmp6UoWs3s8DIYimCtPRisIeYcgYH1iQw==; 5:ebBqKTAC7jHhsMJ2lAxjmQXlyFAMfWqN6RZXLbsV6GGv7JQXE4cBtaBqTxF975NcleKn8B1Rw0Kya2agmj35H+OlS+JihqtoY3OY9l4kUNR39jyvLJ65FepXUxJEi63XbP5Jjt/imxL4CK3w0wXzQJVJH3kgKR639AKTCprydhQ=; 24:k5m+laMoNBrJq5Dow1j9wjvWgE7x59gBfcdog47f/LedlzZ50bUy7WlDUoBYMJTRHOIs0WMKmqmGwTF0hdpiSFR5NPFGVV2/BujTHTXEies= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR04MB3222; 7:zjn48ycl9PzkAU8KS/WvZQwSgJdG6udTNdXn30GCByZffOKVzfgIjkx1DeQ0n8KEFBYBmxm7WdGoDiBDYQBvTJEAldvUIfUAuBn4so2v/of9RK8VRZuVA/z7fXRReJEBf288IN+4NtuYBASa2rmdtcqdEx77zKWfRt6kwr28Azaxhsa8hbKH2OGIRzc2Uz6PkSE7lL5CEkpl7Nz1D1OCfwPHSaE1NXCN7VBfiF/5uQW42rvg74DXYu7RtD0qsEji X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 05:36:44.1731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5851083f-3a49-453e-5aee-08d5d1b8d223 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB3222 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180613_223702_568052_A6D3FC8C X-CRM114-Status: GOOD ( 11.57 ) 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-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com 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 Since 'sdmac->vc.lock' and 'sdmac->desc' can be used as 'lock' and 'enabled' in 'struct sdma_channel sdmac', remove them. Signed-off-by: Robin Gong --- drivers/dma/imx-sdma.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 719bf9f..27b76eb 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -349,10 +349,8 @@ struct sdma_channel { unsigned long event_mask[2]; unsigned long watermark_level; u32 shp_addr, per_addr; - spinlock_t lock; enum dma_status status; struct imx_dma_data data; - bool enabled; }; #define IMX_DMA_SG_LOOP BIT(0) @@ -613,14 +611,7 @@ static int sdma_config_ownership(struct sdma_channel *sdmac, static void sdma_enable_channel(struct sdma_engine *sdma, int channel) { - unsigned long flags; - struct sdma_channel *sdmac = &sdma->channel[channel]; - writel(BIT(channel), sdma->regs + SDMA_H_START); - - spin_lock_irqsave(&sdmac->lock, flags); - sdmac->enabled = true; - spin_unlock_irqrestore(&sdmac->lock, flags); } /* @@ -738,14 +729,6 @@ static void sdma_update_channel_loop(struct sdma_channel *sdmac) struct sdma_buffer_descriptor *bd; int error = 0; enum dma_status old_status = sdmac->status; - unsigned long flags; - - spin_lock_irqsave(&sdmac->lock, flags); - if (!sdmac->enabled) { - spin_unlock_irqrestore(&sdmac->lock, flags); - return; - } - spin_unlock_irqrestore(&sdmac->lock, flags); /* * loop mode. Iterate over descriptors, re-setup them and @@ -1007,15 +990,10 @@ static int sdma_disable_channel(struct dma_chan *chan) struct sdma_channel *sdmac = to_sdma_chan(chan); struct sdma_engine *sdma = sdmac->sdma; int channel = sdmac->channel; - unsigned long flags; writel_relaxed(BIT(channel), sdma->regs + SDMA_H_STATSTOP); sdmac->status = DMA_ERROR; - spin_lock_irqsave(&sdmac->lock, flags); - sdmac->enabled = false; - spin_unlock_irqrestore(&sdmac->lock, flags); - return 0; } @@ -1929,7 +1907,6 @@ static int sdma_probe(struct platform_device *pdev) struct sdma_channel *sdmac = &sdma->channel[i]; sdmac->sdma = sdma; - spin_lock_init(&sdmac->lock); sdmac->channel = i; sdmac->vc.desc_free = sdma_desc_free;