From patchwork Fri May 31 21:01:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13682172 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2073.outbound.protection.outlook.com [40.107.21.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E65A8187567 for ; Fri, 31 May 2024 21:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717189340; cv=fail; b=LydoQdQkiUdL/MJtFjsBJ7PAtUHi1OypgcGpvQXqS+YIr5183nWQULzLnSwaD5vCkK2Q8und9JLe6FJzEl8jHAhTafOpS62cBrSIedUnmuCFxNbPuJtZVr+H2nk6/Iaxx39YiAySA25RLZ8mbi5FqUsVymbLgEZle061kXPR4ag= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717189340; c=relaxed/simple; bh=B9usMufM/cKSi2dR2e9N7oRRS95a2+JAS73/tt6r+YE=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HSG9BVGLr3n5BhJVKgU751gnydXqPnWgS2BRzsPNBMvXvj23Zvo+jG2G6N37GY3wvFc8G7x+C4VtG6yAAYqYyNfEgCwR1hRCdSEvtDhmhkNE/ZhRdA7H0DJ0iq/5LgaowB8MtsYgtuF04m37FegHcb0pIujngmK5RlUeuXqzX/s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=EiMiGml5; arc=fail smtp.client-ip=40.107.21.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="EiMiGml5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cjQI3cJRLJvNbbC1CxkZEWZ83J+/dEB/8wt5Suq85R2zjb4dABEnL6Xma/pbw4iK8eQ9S+yc2nUZ3ExjmttFbj0hG985m/UgfCSQbIBMfKGCa7L3n57RlhPyW46wiaqCq7iHLHViw6YBVAyMVA17S5ISxH+GHUywrkethF+9yah6K7o3SjNRnc38XOTv3ZiuyUNhHn+gSXmD2Newcsbj98P9E2ysZbUQ70ZdhI2LSdqXOWUuqxuFLzxFeWC8gD7ptuTAjQi5rN/0mB0SKS881J3dbq2DItaEHisB97V7hhX7i/IGh4vL6EqE3n/j8xNmmtTNijGx3qBo/7SoRZp2SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g1e9ST5ojHmoOpizX5pWEyTGphsVCAuYfEYUYZGChEU=; b=MmwzgmXwuq0c+dFF4sxL7s6DjL61J+iSv1seILi3D0/TfBzLkvKjzdT598Io7aZAtxcvOKWUa9RbZoIpsRXat1A4BrME2Lnh9WzamntU1rGHFBaXsTUlv75mAQWB7vpELkATjcLeWmLwjjfv9aPo+ABYZ6OnB4cNrTUilN9AA2SaQByiRQwkhUcZC49DjJ8koR7zH8SEOl0cSDFM/eCkbrR+M1Yfbv1sgxPwzfbvSRpyI9y2EyFRLN/erkt2gJgHLaMP9H1wFbUf6g4ENwzKj3DkO2l3mX7brLiMXk9UDy+OzzzAvmvSBmoAbkDVdtaUbZH7De4vopMnkWVmfVhCsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g1e9ST5ojHmoOpizX5pWEyTGphsVCAuYfEYUYZGChEU=; b=EiMiGml5jOH6BlxPME+x0XhzKcHZJdxqVeKg79VCjf8iYGc37a8WvxGajkMs63EzUzG/9PvOyYLagqNCRgD016DR3D67aStSv00valfB5c/0ZGnaGNQIOEV2E0XStixWgY5hZAP6d4S0wTTakMBz5fq3q/2Bg3Eu8gMQR1cewJU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB9232.eurprd04.prod.outlook.com (2603:10a6:102:2ba::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.23; Fri, 31 May 2024 21:02:14 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.7633.018; Fri, 31 May 2024 21:02:14 +0000 From: Frank Li To: Vinod Koul , imx@lists.linux.dev (open list:FREESCALE eDMA DRIVER), dmaengine@vger.kernel.org (open list:FREESCALE eDMA DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] dmaengine: fsl-edma: remove redundant "idle" field from fsl_chan Date: Fri, 31 May 2024 17:01:52 -0400 Message-Id: <20240531210152.1878443-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531210152.1878443-1-Frank.Li@nxp.com> References: <20240531210152.1878443-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0215.namprd13.prod.outlook.com (2603:10b6:a03:2c1::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB9232:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c44edb7-94cc-4000-e6d4-08dc81b4f280 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|38350700005; X-Microsoft-Antispam-Message-Info: rCsJzYEucNmdrdf0MpbnM2LupAqVH9yDIofgJFkCanOUF96IQnryvX/3rKzS/tX8fOi8ZdyiToMQdg3d6wRnz12b9HWPI84jzDt4oSU+NyadsNJ6N6DIwsicx1wZGCQpg6bV5cT8PmvIIq3nia+8Jitv46K2o7fPiVOPylm/34n7NNphAoN5r891TOgIl1ScbP/CeL1XnWQbKiHzi5I9PsCEJM1rdzIHK7Fgk5UtFG+Opz+5CdMk13XvL6u9Kw3OG/XdHaUVE9aAV6XtT+g6tBRNP/V2FwqkiurgnbvrYwRaz+I2zj1mk51gpWP0InuTJ2BvzNWPTIymryEiAk1/tbnZSZ3y4HNo6M/gzpMwJ7Wksb3Ed4jU89QnVMyeDgPcDho5Xyrdhweg+wuV0j2YJsa9GsGTTSjST6cxjThjL6R88ZdsVo4aofpzfO4xH6kXr0R0aFTFREvx+P5JlciYL3P20VBbqMrAI3LT5WMHmC3lJ83if5uLVWe8zda7tznrNlfwRm52JA8JSIbImc09nei3L5Lgrv6qki7X4kNTpNIpLfzfE4uklw2vQA6fkShwoDCGqn+Au4eZp4P1GLD29k+WePcv9wwqpbmD3cgWvY7A2qZpwe6hCpy0JKwoez/GHg6yVKbfpusVz0Lyixwd6LwH6JkrGDzsyZfan3v/dKHS79lTA0lR2rOL62UcuqRGrtDjOkxbZr86O7MatEQ/VYI2CPNQxsjOZqJJZIfWqn8D7+A2ugfs53HhtOYTZDpxIVNaSuBhI6V5tEY/VlJ13cVnZWo8esgwCBCyC6EU0EzM4Jrb+DLZabKhurR8K10z1dFs0gOZOLQxva5EZ+WEOzJgWlz1gxRCmLlZFINbQDg8XZZH50BWZIWP9IfYrmpfGoCVqrXhsnxvTceV7jfYIHe08NCG1FrHxaCRDJRD07LCiLGrAzuWUM/mZJ0gDzw2wpuR0NIjLQdQA9XC0cNXGq7IgCPDaM5WCQ7SbnTbPN+tkvU/nxG7FvtKTGLF0okYLnqDi7ULycDSodDWedQF9mdOH53a2YSJpsmN2G8XwMRoh5nvpwOdKDKGos4DRBhxoTNbqscwV1LdXbDYIWkieI4RIhqttxBgNQ2aNug6h/zFbcpaR73fDHdPJlQLxzGzTQ+cPyKP8p73XsHtL7wDi37NgW7Er9ncbpYGR3U/sgXnzNrxMIQiww77BRzO8Cx4HlG5jhFv38KYH43nUP98YKGfXWvSc6roUDa5tuPpKUNV1L89h2eCxKMPiaO7bs2eYADcsO7rGEhttVA+UG02vOc48Yo5u/FCbB9cnbQHIOWkFSQpaznwN6EJd1D44c0USHdaX+WNZ7XfEBPROot4cw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EXIFYLGA93Ix4dd4N/g3iQ/1cqQWSoF8h3rIucJn80Svd+DD+mUnTyKgNU8BYUIu16Cx0G57SuO4G3cM7GoXVMDdr8v2YwzYrmYFUlyC1bJ7KkRiIy7190Fu2cuxsCWAv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fY7KQS3BYlInbvQ7EjL+kUTRr40G0Jpl1vfIM0oCWCsdPuaeHFJZTsZvdAMnSs2LIyXtdkGXPwv9SIeqeu75GfUYKcqbEnTjuUA5OLbmWfgJu+zdJjzdCuZs1SWGZUEmfxeUKZFUShwTG5LC6piAa9LO0RysOeaXHCD/suyHX74iQrkaosqZrVv3TSBzitHNeYkhgzrNpjcKxudJRe6AARM/glN0bEN+9Yfm0s9fwjaVIkf7vL23sGSlhFvH9ftL6SghqlLNds859wUni2A3y33wVc1UmRq/kX2JCP9Z1HL3N7IKBT3yv31uAc86A3HIIoCo3Bejxa71jMKPhi0wMcl6mjNuBXMKe4380ae0bFjLffvmMNXemVONuWzI3B6qsDGVn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c44edb7-94cc-4000-e6d4-08dc81b4f280 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 21:02:14.4004 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K7FTN15LBo7Y5x7t61ZKpmaLSRsfrELfacmp5t8rme7l2aREtbe+BsZ/UvVP55yfix/c54x+PUtuMFHWCg8ltA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9232 The 'idle' in fsl_chan is redundant as it's equivalent to 'status != DMA_IN_PROGRESS'. So remote it to simple code logic. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 6 +----- drivers/dma/fsl-edma-common.h | 2 -- drivers/dma/fsl-edma-main.c | 3 +-- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 91a4c11b7cbfd..e31dcc127708d 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -59,7 +59,6 @@ void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan) vchan_cookie_complete(&fsl_chan->edesc->vdesc); fsl_chan->edesc = NULL; fsl_chan->status = DMA_COMPLETE; - fsl_chan->idle = true; } else { vchan_cyclic_callback(&fsl_chan->edesc->vdesc); } @@ -239,7 +238,7 @@ int fsl_edma_terminate_all(struct dma_chan *chan) spin_lock_irqsave(&fsl_chan->vchan.lock, flags); fsl_edma_disable_request(fsl_chan); fsl_chan->edesc = NULL; - fsl_chan->idle = true; + fsl_chan->status = DMA_COMPLETE; vchan_get_all_descriptors(&fsl_chan->vchan, &head); spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); vchan_dma_desc_free_list(&fsl_chan->vchan, &head); @@ -259,7 +258,6 @@ int fsl_edma_pause(struct dma_chan *chan) if (fsl_chan->edesc) { fsl_edma_disable_request(fsl_chan); fsl_chan->status = DMA_PAUSED; - fsl_chan->idle = true; } spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); return 0; @@ -274,7 +272,6 @@ int fsl_edma_resume(struct dma_chan *chan) if (fsl_chan->edesc) { fsl_edma_enable_request(fsl_chan); fsl_chan->status = DMA_IN_PROGRESS; - fsl_chan->idle = false; } spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); return 0; @@ -780,7 +777,6 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) fsl_edma_set_tcd_regs(fsl_chan, fsl_chan->edesc->tcd[0].vtcd); fsl_edma_enable_request(fsl_chan); fsl_chan->status = DMA_IN_PROGRESS; - fsl_chan->idle = false; } void fsl_edma_issue_pending(struct dma_chan *chan) diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index c5a766da02b88..b846cfe0a7fc6 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -150,7 +150,6 @@ struct fsl_edma_chan { struct virt_dma_chan vchan; enum dma_status status; enum fsl_edma_pm_state pm_state; - bool idle; struct fsl_edma_engine *edma; struct fsl_edma_desc *edesc; struct dma_slave_config cfg; @@ -456,7 +455,6 @@ static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd) static inline void fsl_edma_err_chan_handler(struct fsl_edma_chan *fsl_chan) { fsl_chan->status = DMA_ERROR; - fsl_chan->idle = true; } void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan); diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 82ac56be2d832..af05166ed251f 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -544,7 +544,6 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_chan->edma = fsl_edma; fsl_chan->pm_state = RUNNING; fsl_chan->srcid = 0; - fsl_chan->idle = true; fsl_chan->dma_dir = DMA_NONE; fsl_chan->vchan.desc_free = fsl_edma_free_desc; @@ -669,7 +668,7 @@ static int fsl_edma_suspend_late(struct device *dev) continue; spin_lock_irqsave(&fsl_chan->vchan.lock, flags); /* Make sure chan is idle or will force disable. */ - if (unlikely(!fsl_chan->idle)) { + if (unlikely(fsl_chan->status == DMA_IN_PROGRESS)) { dev_warn(dev, "WARN: There is non-idle channel."); fsl_edma_disable_request(fsl_chan); fsl_edma_chan_mux(fsl_chan, 0, false);