Message ID | 20240229-8ulp_edma-v2-2-9d12f883c8f7@nxp.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2040.outbound.protection.outlook.com [40.107.7.40]) (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 D81FF156961; Thu, 29 Feb 2024 20:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709240345; cv=fail; b=h+4ouaGnafWFdQVFKFswxatOpwMKlpR7lqj7hrw1g146UhRuxN3opJKcQMiyrFeOFamjQjWgXJZXPNKah8peEXlpNH87VEnRnwcCWyhea/3EkYiGTrCJd+Lhs6F26ab5/OVG4dvU6xsbA5kM1KSF94i24qOqvV3mvH7fMn9Mvwg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709240345; c=relaxed/simple; bh=Cba1I8lPfT7XGGJBLhHLImkgVygTholVVk8WsvGvZuQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=kUapWTDxxaYjomNzGdi5oCYSkVQHNE1VyXidEA/rs5Xcqz0g5sG8CgYUQWBK1oNW65Pebu+9zG1A1LlknFxj/w5Ma+Au+W1dMgZz2pYClRWTV/e24fvRDFOzpeoXzH6KmPkWWAKTgFgHB46DpQL+b+hkc7luLmq3CT/2CEiXu58= 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=Ne4H88wq; arc=fail smtp.client-ip=40.107.7.40 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="Ne4H88wq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JNt5GWHW6EkvonoxRSeAa7uQwlE226Cow3djnuL8tzqCNdohj2kVT05vTAAIkL6xNq+Yb8h5358pCiNp+wBLDyv2EqXniVp3iEMIBPoJv6+WnIAuLEaJEdSuUPg7qylEB2+rFQuVCALxk0C72YAdcV6nvMvug9DAFXH9BjCU7yHGwfRDPGUn82X40nSlxSTWmzk5qzbcYFhbXj9AVCtwp3tlmuTzQ/kGQ2dBnD0Bkej5t5SlFWQfFKPyCMIJtcdqKaatvt9VqjJR/vkpJJJgIthFMGIXFqIXqXvuX4JwZJQIvxz+Ysl0NuMu1uJNPP5s5hv3/EDcMK3vpLLPyoIFAw== 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=OLs/58IIUeveyfmtV9PhDz6tUG0OWzPy+/o3nZ1cyIY=; b=UBFb2nG92MjHAO1PDhy25voNbUWnO6xhtnYn/xXJ7tnaComSK+vyqj4/hvtTruepvhM4XTeaKylt7r55Eq5Rto65nCVpcuqB0BnF5nmbVyiHyZWQdxMRw7oXWtmked1+ZN6vd7Khxib7DSqIz0gueFpAYwbBpU8mh75X6lRMSHM8I5oT4hNEcUdCMozbYKyPI3iXbpXvGD4cw3rS/N/WfqhKRXDNhvqHU7u3Rn9WNXMdy/1fYtujzQNQEA070MsNKkLj31z7D02E4237kpznU6pcDDOvlW8KbPO2G3shTMgRTYt2AnuEsBIT+nK3zqfVsoPF8sVd/uYuGhadKW3/wg== 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=OLs/58IIUeveyfmtV9PhDz6tUG0OWzPy+/o3nZ1cyIY=; b=Ne4H88wq+HHzAaLsUgMy4hPY12leRmrxVoR/EtPkFlVD1EbmbL1+XrNMgLQupkB/eEit9QZy/GmpK+Kac43vVAjnhRWoL+TUVPgcUJnXtf9bxymf4+LgmmHaK/gzeDj4Y93PTNU/sLlNfottIeywCkuhcMiFWaiBh6MixHWKOtU= 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 PAXPR04MB8750.eurprd04.prod.outlook.com (2603:10a6:102:20c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.40; Thu, 29 Feb 2024 20:59:01 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9af4:87e:d74:94aa]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9af4:87e:d74:94aa%7]) with mapi id 15.20.7316.035; Thu, 29 Feb 2024 20:59:01 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Thu, 29 Feb 2024 15:58:08 -0500 Subject: [PATCH v2 2/5] dmaengine: fsl-edma: add safety check for 'srcid' Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240229-8ulp_edma-v2-2-9d12f883c8f7@nxp.com> References: <20240229-8ulp_edma-v2-0-9d12f883c8f7@nxp.com> In-Reply-To: <20240229-8ulp_edma-v2-0-9d12f883c8f7@nxp.com> To: Vinod Koul <vkoul@kernel.org>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Peng Fan <peng.fan@nxp.com> Cc: imx@lists.linux.dev, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Frank Li <Frank.Li@nxp.com> X-Mailer: b4 0.13-dev-c87ef X-Developer-Signature: v=1; a=ed25519-sha256; t=1709240333; l=901; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Cba1I8lPfT7XGGJBLhHLImkgVygTholVVk8WsvGvZuQ=; b=eaadin1fbdghmp6xGn/H3m1Pugw5hEkckIlpOSy42uL+blK41aoNXo+cWWtmHWxtxeeVdCNrY P9wDkD0PQNnAJZnQW7NCsmOskSg68yEPwBJkvTJT8EDCiMY+Aa5Fi22 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0060.namprd13.prod.outlook.com (2603:10b6:a03:2c2::35) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: <dmaengine.vger.kernel.org> List-Subscribe: <mailto:dmaengine+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:dmaengine+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8750:EE_ X-MS-Office365-Filtering-Correlation-Id: 4df85db8-1c80-4b96-b826-08dc396941ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 82KbRJX19YCs/sQ2tgOTy1b8mIiGLlHxCsctJ0VBKuxAuSVB167twS5l+fffPavd/SSchbb5wooLfvevnxpyp4RSyPDnjnHyj59/KKL1g8chXD256WDwsIJaMX5G5pLNJFpLQds2EMaUcLB8sRJDDipfEfIi7F1YC77WzC24FSokZziMD+76Wo4tcMNYlr7QcjCXDfM7pV6sMFXsXhX7tY16uX7Gn4asDfOXtJWr17r06MoN5qZXb3qBLLf6jhCF1mdzIsAG0JBY7gpop6mO6WZ0X8QID+8Dr2n5dwGUBHwpW5w71qF0JN5NB5TOYuBroTfq+feTqrzVBz+UR0+E4bLwtFoynP0IW6gesUcuwt7MpK3XLPwp2ryfle+vM1u2XznYJp2uYuyXsOzrNKxf4i7W3J4kjRYBSu+RCt1Q5o8z2+wa1dFHrXGIGpCToPS4IB06sJsKVuUST3WWKfK6WLP52ggX+RspDuILgkDIjZ/TLw26VmlaHELuxPvZeAiTppi2ZINi36dXugbW+17+dLtByYcfT/0sCZDTCq9Q9IRyjgD2CkegrTvTKuB5rktr/YkWE0vDG5qbW9fFfQnyhGMs+dhr82lP2dX2psHIvapvb2Fp6Kfj0OVMOX8mnLEGDZYpKA7KGOSFXLMNUW9Uo9K2AkOCUyXeLobPJA/Hn0ZCYvTrdcmLHS2yrSHfETsLYCtkXY9//NQ6illH1atoyP6uThRcOWVoumLOxXTHxd4= 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)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?jOkvYHk42z2ZGIbBwxK20FftOFFl?= =?utf-8?q?5b/BEgfODIoEnyK3oauto5zRH2fFk6tFXLCmP59WaOp6E0lPDSt1i9IwMomcXK/op?= =?utf-8?q?y9tRJ6joDkhbybfbu6HKvHKQYqfSRsLmquShg+oIdm3+tBpbOHNfq7WlBO3Wm9lUT?= =?utf-8?q?OwzTSfwjfo5F3pDKE7FYeHgqutw51ottGcWq6Ua76aLwjV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XmeLj/rYTn?= =?utf-8?q?yn0//iHSnNbP2mRzC+YUcBQKJrzO6nNQIN46RCZBe41InIVBkbEalB/nPOu1BIYcr?= =?utf-8?q?6nLNO+mGytQDLr69IpDyM6t3yUjAs6XEeN7PGuIu8JGeewU4LVuToz9F7ZmwQZYMs?= =?utf-8?q?OVTXkF7UHGCcsy1YtUnEfeCbvKwVA6jNqq7a+6cu0CJtIQBtR6OfeidY+g4nK65PE?= =?utf-8?q?GzDblfsdwxASjEk6pGA/N9r/wSkUubN2P0xxEYh8psNFa7MrtP66Zspsfo0MM/d6z?= =?utf-8?q?LUTZecfh5U4w2UxRYytDHWmi9Xpa82JSWsGsSeSlzyrTxhxYeG7/fvC0gcwM3YPiu?= =?utf-8?q?Yf22bCgGbfvV7+c4zEkpyVKIyPuDLOJ9PDjfrm6y0tDQSydikloT3BFo0Sxtr40Fl?= =?utf-8?q?OSPs63DzQ9ifgxjUD0PMbfv+Qr17ndjnFOPA7LXiou9pcOnYozqf9IAdIsuV+3lAW?= =?utf-8?q?wAnhOEY4bNxU?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4df85db8-1c80-4b96-b826-08dc396941ae X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 20:59:01.6821 (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: MyxlTfKv5aOYjwi7nPdb7T8cHq6mK1AJbbYr1nRnEl7uBAJUNz7pJnXY2sGgpVFkA+FUGEqevRJlqAaq+HpNuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8750 |
Series |
dmaengine: fsl-edma: add 8ulp support
|
expand
|
diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 0a6e0c4040274..2148a7f1ae843 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -115,6 +115,13 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec, chan->device->privatecnt++; fsl_chan = to_fsl_edma_chan(chan); fsl_chan->srcid = dma_spec->args[1]; + + if (!fsl_chan->srcid) { + dev_err(&fsl_chan->pdev->dev, "Invalidate srcid %d\n", + fsl_chan->srcid); + return NULL; + } + fsl_edma_chan_mux(fsl_chan, fsl_chan->srcid, true); mutex_unlock(&fsl_edma->fsl_edma_mutex);
Ensure that 'srcid' is a non-zero value to avoid dtb passing invalid 'srcid' to the driver. Signed-off-by: Frank Li <Frank.Li@nxp.com> --- drivers/dma/fsl-edma-main.c | 7 +++++++ 1 file changed, 7 insertions(+)