From patchwork Mon Jun 3 15:23:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13683924 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2041.outbound.protection.outlook.com [40.107.13.41]) (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 E3A0936127 for ; Mon, 3 Jun 2024 15:23:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717428217; cv=fail; b=ktfnhMr+sh4NgI1aOPsYwmr414m3Co/uSEkc0fCptKysZrwdnPEXxMHyn8JseMFlCqiVWI0SlqYVY/ch3QAsK6nz/YLmp0Bc0qRKBPSE+67ky6wkg4v7D+bS5q+tfQ2Y+h3ps9enkzt40mQbvJqKPCwg4XE8qmih0eNihV/6ZV0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717428217; c=relaxed/simple; bh=3Iplv631NWl55AVG49oXrkiGJT/8mska1/a5dTVLp0o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=uzDQbQCdBwgQECa8vkhdJI0KG8gr3gm6IUiX9j69t1rx3hNy8giVEGDvnu2fMYHAHeSCnaN/mL6195NNkaNMOl8nhBCvBGqgvbSWkkhes1I33JT3A2zvK/T06lXRoF7xAm/WayPPPuJA234+cr0C50luQnjFOPdds7JSKuxUX80= 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=SZc1LeD7; arc=fail smtp.client-ip=40.107.13.41 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="SZc1LeD7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZKNzyRnXejRJr3GJGYV9hav0FBxxwnba0f55cwKYjyDZ9xN6iP0SLY9FleCzw80Oz8UQvQf7+OYKe4169LhDdh9heFkOLN2HLOYzXZRt/u7rBZpTCF+N7l9UxsJdwmRusPfDK5+Imoo1k/dincJWSrNpyNN/DdflvdjjiikDK0aTLUlpZkgjQfcS0QkbjKNGgq+9LI476xg4aWBLr0cVyLP4wxCqVWueJLGG7snQLs9yj8ZE3NCnvCIJ6VrIyAqSVJQc158bWRG5WmJ3D6W5ave0wh3oPLD7lxYRJlXFPUVctTpXAEWU4sRpwXmyTGS4kmw6T1CRLOgAZAxsmVZiwg== 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=Ro8mhtjonCwWBYscZA88GaoXM8W8XvWKbYlgOdmek74=; b=QlsRb7J8u/gW2DZ1pOeIL8cQcy5d3bpYiBjRXZwEl4gzDn+9K8cDGST3xnyqvD3eX9NqjMAmr0c1DWlFSp+fXex1k+/Mc2UVPH4HNbMHz2yCTfimqujfdYkJ9KP96ZaCtmzGx11PES1A88a2Idb1JhnDuBjivzLwZ+VOyFi7pUJXev/CX9VKAdbOIhqO2X1HP1r3HtTCNXgRpZsvz62Hqf+HaeaNlpYTM50+sTK1tDDmR3hJw6QVcOiHUSwQkkBpnJk80D4KwsnHmPCO5d5lcqFR0jupTZKfptrR4w3XyLnayuRoiO+DmvabXsfasB8KP7k9gpCWXMwg91k8q5UNHA== 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=Ro8mhtjonCwWBYscZA88GaoXM8W8XvWKbYlgOdmek74=; b=SZc1LeD7GQ0AxSPOYZc1ZtBHEMVdg66nrAdWkKbOqtffuU055/fKLtUBOIlsovSyUO5uV0qsZ1Rf0QQtYIspUkSX4T9AP1qmjfaaflCKgo8aqmQF322vx/Nt41hR1PYMuC69cSWiWAtOakTfAbke1KA/sOPFY+b+PUyiRcaw6aU= 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 AS4PR04MB9243.eurprd04.prod.outlook.com (2603:10a6:20b:4e2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 15:23:30 +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.021; Mon, 3 Jun 2024 15:23:30 +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) Cc: imx@lists.linux.dev Subject: [PATCH v2 2/2] dmaengine: fsl-edma: remove redundant "idle" field from fsl_chan Date: Mon, 3 Jun 2024 11:23:16 -0400 Message-Id: <20240603152317.69917-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240603152317.69917-1-Frank.Li@nxp.com> References: <20240603152317.69917-1-Frank.Li@nxp.com> X-ClientProxiedBy: BY5PR17CA0047.namprd17.prod.outlook.com (2603:10b6:a03:167::24) 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_|AS4PR04MB9243:EE_ X-MS-Office365-Filtering-Correlation-Id: 33bec09a-a198-4d57-15d3-08dc83e11ffb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|52116005|1800799015|366007|38350700005; X-Microsoft-Antispam-Message-Info: iiY3DCtHfnlWCIRW4g96TX0Q5Er6gRIcelPyaWn/5LA9mQHk6epkjJUBZkg2vfZq4t8yprpfppLk4B+brQkhwkTdRUPma9yWFohaYGeK8LW5U54s+btwUyxaJ5S1U5u2IeMHy8G8qBtDNhhh9b7FB564PG/4IE+87BrRPGYwSiydLnHUs0kW+UA1hnwLwMCcqlpUB777FliPP6vst9q6cEk+NJVqxYGiN5x1CbqcvI+Sh5n9aHdZH0Y07uKOhQIHC+cS9b0euVtUVopJwstF0RRelsjHVAorY7ThKRTX/cBG0uGW7Aeejgi5Lboc9abXG9YPMNhSyaV5v/iRz/fDmhu45PXufz10DjvbZJdW5pzeoR27LkoPmDa9T3erNm+kBBshWdpljuTfNk7pVww8Fi5K2ka6qUF6FN0IlmkvanRW16dqgdf6wU2Lrtma87yYAU88TlRpSqQLKuq1xXTC98ly2clClbyT3Jk9rtg/Y8b8t8oSAKjqozP+js3o4T5skzlcDZ440ALwbfKAAEKaU5wQ3WtWn1KGmK+giqfyNXEcuvYhGa4B1iCBhmoPFPxIeAhQyG5go5L2mIFiJ++IqNHosKK8tO0RMEkK3tLuIuwFzD1SYB2/OCrnmQ2ewpm53p7+c+8gUmF48yUPmCywTo0ZsugwL4zQAjKbxPUkKXbMjx2H4M9GTGwpJU1y8dQXtXei+gSJbnXGftlaoPF4Ks+rLgcRfg6by5JyTUcRLyI4zCZgiXMVFizZJSnaasMQjbLtUB+6n51DAHkC2HU/qdvyLePUrxYr23yZSJDK3Gn7p3Mk5jvREKinj7yIR9OPcz0pFlBzaePjHxE3mWMtHLqcHBHS5U+I1hz/V2JlvyHYTXjdyd7fpHZLvc7nTlnXdE124mb2AxAlqNgFNsOPiDUo1ZUv8WPxFik2+IocnE1fbh7sPl/sVP5V02Jxku+85prsuVYJ4HZyIwJcJRMNl12iroGClkAyKvt7XVdSl3tJavDWGwByixxUnukVZsSqPvvS1Gnvk4QIiDhzzBvQJEqV01D914kSDCI6mOzrL1yK5bZyNAEHTTdJEAlAgH+zkCk3DmalDikp/ptDDYB1gb/4Cav4YgYsA//GaQN2PtF2o8Qzz6MYdMyZYMcb5TXDgpPiPzoETtIm14zexnAfVLZvE4X8NYd2lFjCwPdDEPIJrgtArJBe3+T/0aAS+2VANNVx25SiB9tHhpUsN8lmVbgqrqMLMFswjGVTjY1JpIC3DLhWbH/VoVUlaPJW046xOKfvH9OvLfxZLg0hleLlGrFu8pZ+Ro0qsMZhqmymE6OTlY66vysh64gdg8nuybxberaDnC/6dnEdqyZdoVi/pQ== 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)(376005)(52116005)(1800799015)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jOqNb8Uk44LaxlZJ7esR4o005aPQJV9AksCcUEghqwtPLtIop+HmEZZ4gjH3n9cvZlVgkAZkVIa2n49Amz/Tx8aAbvv1hcN1w+zAHYRZki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WujH+lybItnuux1Ff1M+IYrdCyIxv/Z3f9Cu3EeAvbxI3DYahTbQTUi2yyg5xVjfJLBuus0YtTWwNPoiLQw8+v2w5Ull9pPvgRB8zebvCwGrK1mbETufC4Z09sYbz9jbQLUCengcUbVeGPSK/HA8ZAuw5WtJfN+2lrrVXmkfvYcitKpXd5TRlMgki3+xmNgZsIiNUEqvFIJDom1tW3jGine2mOvlgG9nQ1x2YbPP1bcIhE8RKBCNWSrZYHnXUxG/nuOan8sRBBQFF15/+Njk9zBI6595GtSSmPqIjiKpaJ4G/mZQYlwExSPAyDrreTaswodUxh2ZA49G7fKjeexCLB2jfNIn+e+6D6XCja6QZIeWeC7/kbsTSHQjqsU0qQ5ZCTs4b66D82FKQvD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33bec09a-a198-4d57-15d3-08dc83e11ffb X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 15:23:30.8382 (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: 1tfmqG6PXWkaKeSe4wWpWfOCRVd2SUMCNUKYUUv0DowveQcgp9+U6HiZShfd3wE9iGSay3g7CEbmPN5BKLHSeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9243 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 --- Notes: Change from v1 to v2 Remove "idle" at mcf-edma-main.c also to build error found by | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202406011344.s3sPp61I-lkp@intel.com/ drivers/dma/fsl-edma-common.c | 6 +----- drivers/dma/fsl-edma-common.h | 2 -- drivers/dma/fsl-edma-main.c | 3 +-- drivers/dma/mcf-edma-main.c | 2 -- 4 files changed, 2 insertions(+), 11 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); diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index d97991a1e9518..3ceb7b8f9a67d 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -64,7 +64,6 @@ static irqreturn_t mcf_edma_err_handler(int irq, void *dev_id) fsl_edma_disable_request(&mcf_edma->chans[ch]); iowrite8(EDMA_CERR_CERR(ch), regs->cerr); mcf_edma->chans[ch].status = DMA_ERROR; - mcf_edma->chans[ch].idle = true; } } @@ -196,7 +195,6 @@ static int mcf_edma_probe(struct platform_device *pdev) mcf_chan->edma = mcf_edma; mcf_chan->srcid = i; - mcf_chan->idle = true; mcf_chan->dma_dir = DMA_NONE; mcf_chan->vchan.desc_free = fsl_edma_free_desc; vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev);