Message ID | 20240227-8ulp_edma-v1-2-7fcfe1e265c2@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-83706-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2863328dyb; Tue, 27 Feb 2024 09:57:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWC6iCY0OFmFywNOU3jtTNWdOHQwEHLvZJ5OhU5qDfwGICGXlW4I2/Slp7K2QqR22PgLDlfo5tYFSkRy/b9Fp1+oaMnNg== X-Google-Smtp-Source: AGHT+IFRuJ8XllXXWUTHoxApFEUHKlwlVr8QWAisJzbdKxrd/t8dBj0P38+QnSfSLbtiL93EOVc1 X-Received: by 2002:a17:902:7603:b0:1dc:adda:6d45 with SMTP id k3-20020a170902760300b001dcadda6d45mr3756021pll.18.1709056632569; Tue, 27 Feb 2024 09:57:12 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k14-20020a170902d58e00b001dcb8f5e59csi1464772plh.529.2024.02.27.09.57.12 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:57:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83706-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Dbu9JDr8; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-83706-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83706-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id ED25FB2EE74 for <ouuuleilei@gmail.com>; Tue, 27 Feb 2024 17:26:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5550414F97C; Tue, 27 Feb 2024 17:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Dbu9JDr8" Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2055.outbound.protection.outlook.com [40.107.6.55]) (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 0768614EFF3; Tue, 27 Feb 2024 17:22:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709054544; cv=fail; b=X1CR/gIFPeg6uSpib/p9P+bHJ0ZrndI9FPRmGH8p8UT9n2jDX7wpigO0vSbNW+OVcji2ldOShNIGdB6oR9fgEWcaJD8HPlJdWyryPIYDdBKPaEVN7dq/uqNkC6VAnKUt92X7OE2iYwc7lhZAIr9QIbHiEh5Z4nBb7S6xvFuyTqo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709054544; c=relaxed/simple; bh=Cba1I8lPfT7XGGJBLhHLImkgVygTholVVk8WsvGvZuQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=H25vVGD+Od9kZWAysdo7uZ3xbCvpdD9i2Mqu9iiyVL3x8Guonr1w5z9ZS9UjAxhjW699VS6MIUaxqtWwB3puzC3JzKFjfJpZk25e5bGNLAIp2GbWa8VUYm1oOZZqqyChWit6e459kvv1Ln9kXH16DaKea7pe2h5Pg5m7kjSxVB4= 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=Dbu9JDr8; arc=fail smtp.client-ip=40.107.6.55 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iJaa8YzY0yU/dLMtoM5SU6YrO8j0TqJQNjuxv3ZzcCXLzymnXtXWLz3feHoJOwHVjwW4uXQx+T7zBTGpb1qev4vSB0nxMkShDph6yYJWl8QGrN6jX+m+vXiSW9rGI6Jzks+eGUbEG3a0FWrZ8zRzW12n/YsfS6hoVvk4vA+QyNPTyebaObUjry+ChaYu/qT6+8dvVe/FpBk537alq8n4NgyLUK6WxdyOL56D/tv17flFt0BJ5YXNZlE1RqH9XCiV7Gx0fu9C8x9wIeXJK+wUG7fRW62oO/cXTTbTZE++urXX0dfvltWiBKAbP6R85qiVcLE4Myf33f2hIy6iu/5p7g== 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=Ba3nrCNQTUMpCdcF5RETFLCRC2l8XsApsgf28lA0jf8fVEB+o2KKPZolAaWHOwi6dy3ewj5EctFh6aQwAcmRNvL1htj5Gse82nMqShBvylwko+t1jZXuSt0BzQTFPFFSw8cn0fPGXvM+k0oNTh7rLrvIJGjgKEKnQxzF/XoQZPw0FGABPMcHQr0LEi+gz2OY47dSk1QKHGgw3mgmqm+VpKOcrfkymvPUcMwV2xGb8LumPwdtyVJjfK+xMjnFITmA27ZjK1Woo5MsCFMkLaFlEytFN2uQ1SAmGpu2X/OfTIwlWrX7i394TcjR5L345iKUO3bxTSTuTKJYzn6El3yeaQ== 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=Dbu9JDr8Hq28cT4y2zahOCHQ+K1ISKnbe6WgvqRnT7SMdRASbjbrCA9KS0mGKriBHzzhO++NrBSoylo/4vQtNv4LO2W3z/LIrJd6w+qWVrVptVBPQeODFrbNWIAVrTS9peXzG1eVVueQsqC7uf9p/8KGP16hYJUMkoIcDy3kawU= 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 AS1PR04MB9408.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Tue, 27 Feb 2024 17:22:18 +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; Tue, 27 Feb 2024 17:22:17 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Tue, 27 Feb 2024 12:21:54 -0500 Subject: [PATCH 2/5] dmaengine: fsl-edma: add safety check for 'srcid' Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240227-8ulp_edma-v1-2-7fcfe1e265c2@nxp.com> References: <20240227-8ulp_edma-v1-0-7fcfe1e265c2@nxp.com> In-Reply-To: <20240227-8ulp_edma-v1-0-7fcfe1e265c2@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=1709054529; l=901; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Cba1I8lPfT7XGGJBLhHLImkgVygTholVVk8WsvGvZuQ=; b=BmFxSUdl/KUEZPYVMBtSkXMGE4o+yIg7DElAlG9Dvn9iZqgL3PJGsxSGm261NMigMG0Okfx+G QlPjEYBJy9VCZEOZCSLJNjSt/ReeFaw+ZHaJrFeGRE+VHkbLa1A1x02 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0059.namprd13.prod.outlook.com (2603:10b6:a03:2c2::34) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS1PR04MB9408:EE_ X-MS-Office365-Filtering-Correlation-Id: 18ecc72e-7ce6-428a-7423-08dc37b8a5d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XarjfkF6ztdFwprXzf4yUFLF7cPwZeBSVLCX3XnhCcFcG/9DaoZqVoSBbL7Cjs6+s6jaAQnvqDXNoVO07gLMRKgZNrB+PlZuRC/IJoUzg4I7x23JYcdQmO3OScD0r7RkjKWqso2wgJq0aWH8/ZtBVIHybH9bDD2pok+ET9y/IASJAiG9Hs2qc+h1xg6NR6x3jxTa6/AH3QzIIKC/R8paQ3AmwLbTUftNWQQABsylv78pKPo3AmU4WlVZykDvcDKx82J1obHW9gUxbBKJdpbeMaGA9PGYRF3SWeBc0iQDUDMnMi1qbL/67qQJKSmMVTZVLUehj1gHr66l/Vi0OTE2EG/C2D5A3RBhYQwTyrTgzJs/lJGkG95uTj443/dSb5wVIPfjqUr9vxAYJlCq1zy9qq989AfH8uhMfd7tYsKqqT20N39xffCrUXVs3uCvhyT7KSPK/SsR00qtNYvCPMMDdMZEVrq7tCv6ngeaM1zd86Fu1JmdbjkPcYIbNu/9Y51XGcd0Gga2V/G2kZD1MbIb67TuyqDpjr+8rhc+UD124s6O0ohPbeiFm9beNlxjx8hci3HQMMGTLFMRrvhDa71nBqk7P8pmrz4AQ8IL5EAdAnJSO0NDtG+mB452CruFQ0UB96GXcItIyHPE5K0V33sKYComAUR0KRniRP0C+pXvA8aEHV8CBFgvzxE3qqhlJfYA82IrVthJRAyIC9jt9V2bMPiyRM1+ria2FMmD9DnNaIo= 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?alj/XzTynL2gto96CY8q7hml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utf-8?q?Li3lPjm3i6UmYH4Jud0IWAPewTxIqWtzj2xg0bHfeopy4dL4hywPoTwePq27bU5cy?= =?utf-8?q?GyHRB8Pf+ilWWzRN+itVRzowSDtQc6GyRyOGyKwmDslaKJ3mfCMiWKo/GTffwtShI?= =?utf-8?q?OqLWNMQ94Onbsq9lLTpGZh33nroii4kTEStN6kYSiKrOwioP01MCqJIcLsvRxgfpo?= =?utf-8?q?I08uvd7kWU2fkmed5x7uc/qztrfeDCFoqEatkoxVMfOwiAqVe1zX/wx7B6ntGAPGX?= =?utf-8?q?3rlVHbDZ5cscrTwu/lNUuYJBnEgDnnqAVlzBct6uVC2h0aCZWrbfTEFmm0zArrol9?= =?utf-8?q?IwU7cr1wTA2Ec3Z+lsgjrgpvJHxuVrEGH4PsWVbuFghsXINrLq83Fi/aClK7IGA4B?= =?utf-8?q?ba6h0AYXJc4KpeAzByWA1cMZ6D0JEDA+jUxlRoiVzAWt0SFCfnGp1M4mpD5X/mnlt?= =?utf-8?q?YCJ38rnhM6RBB/aeFE8NS0CIVftEhmDtIt8xw+TbtWaB+3hGhh9LbqvJGUhQImhYT?= =?utf-8?q?gCiuZjKQNG1INTKOLSi785OegwKf1dZh5lPBZRZ7f0mst6r8fJqJhXmSpBYxq9Qu6?= =?utf-8?q?CBCCwHWQrty8pjJYnM5UmOf4NuuHsQxeii8YiHhMFXkuCiizCMRTWhNImIni60WS7?= =?utf-8?q?3eWlyIlrd4gM?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18ecc72e-7ce6-428a-7423-08dc37b8a5d0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 17:22:17.6074 (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: 6w1LFTRIkZ+ZXYp58HsAkcKsVTraj6Z2nS7WKim559ZQ0SeOMfRYdtqXq9wlzKmzIZ64giZy0yiYwra3gux2lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9408 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792075767676505772 X-GMAIL-MSGID: 1792075767676505772 |
Series |
dmaengine: fsl-edma: add 8ulp support
|
|
Commit Message
Frank Li
Feb. 27, 2024, 5:21 p.m. UTC
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(+)
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);