From patchwork Tue Nov 14 15:48:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 743853 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 7ED704176E; Tue, 14 Nov 2023 15:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="UcVaf0ad" Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2060.outbound.protection.outlook.com [40.107.105.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F3E312C; Tue, 14 Nov 2023 07:48:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cGLFRDTW4rqST6uX7TF2jIgmO6GH7fecswFgcwoE7H81P21FfFiWST2tQhk/I0DyBx+GltkMc6M+lPSuPz70MC6KwJk4982rdO1c/fyXv2I+TMQWa5a5HQ7H2r7vGsuWTKIYfHZ9BeY/6TJh9JbJYrGfxymZw0Tih8avuazTIamOKt/zhEEolztcIrSm5bTEh3NbXYoiOgyT1DK+rGimeS9wnwPXoAHEDcF6NvpZdjzllksaGAnNI/tETutVfvXq1v7SPGj3r9pIAJ+gCmkL4d3ihMCkzatltVlYbNmz5unnT1pUi63TuBa67EIoh4ytlhrmsJ4hu/7AJTWH7SOFWg== 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=wbP4Fa+v6IJTu7gDJeCQNNRYU86qiUHCZY8xgO5kY74=; b=JCArtKjDF5AWoDvioaxSu1PoNdICTDQXrMlAlJlWEerBE2MPqPBEX2iW1wwgePyxaj5qsURMgeGs9zpR8bvfUWYRE6Ve5Sgi1CWJU3HMIijsCtv8hVcESDYz8vfO9YlpQE/e92AUZVAm+YkqpEO2tNqyQcOg44/7fN41zpRYUknJNQFcF0DYxwPIgPV7obh0WbvgEgErkcZF9tIZfEDXBNMBW/q5mYI45/z4i8thLEpRYI4hn6qsNOykecZK37Tn/54USasaoUh0+ka1cSXj0Y7UU9zV8WRjTT1+14jx9h6MJwWOKo1BdCZVVYW1FNJNo2Roe85lUDw5nD0XqzayBQ== 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=wbP4Fa+v6IJTu7gDJeCQNNRYU86qiUHCZY8xgO5kY74=; b=UcVaf0adliT0IWrKRJRfJKZ/vK9Rt25GC6TCtk3f2KluL09+fruUJIDGNfQJJlZ4oAIZHGr2zCwLWB1cqkE+YZZ8YMhGK4YPEwNeSMWrK/5V2jfbProNIaj4lKV+CS6/QO55nQmEYLvGo95jhRPi8yNSER+SUwpDvxT0ke/rdvM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AM9PR04MB8113.eurprd04.prod.outlook.com (2603:10a6:20b:3b5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.17; Tue, 14 Nov 2023 15:48:47 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::bc7:1dcd:684d:4494]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::bc7:1dcd:684d:4494%4]) with mapi id 15.20.7002.015; Tue, 14 Nov 2023 15:48:47 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org, shawnguo@kernel.org, festevam@denx.de Cc: Frank.li@nxp.com, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, imx@lists.linux.dev, joy.zou@nxp.com, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, robh+dt@kernel.org, shenwei.wang@nxp.com, vkoul@kernel.org Subject: [PATCH 1/4] dmaengine: fsl-edma: fix eDMAv4 channel allocation issue Date: Tue, 14 Nov 2023 10:48:21 -0500 Message-Id: <20231114154824.3617255-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231114154824.3617255-1-Frank.Li@nxp.com> References: <20231114154824.3617255-1-Frank.Li@nxp.com> X-ClientProxiedBy: BY5PR13CA0010.namprd13.prod.outlook.com (2603:10b6:a03:180::23) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AM9PR04MB8113:EE_ X-MS-Office365-Filtering-Correlation-Id: 32a6b557-af37-4f0c-6a95-08dbe5293046 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jg6c0IIBaYz0qoCJ1ZDAZwRrL9k9swP6DU+4b5yOSWHTKo8Yz2y07UqvOUNEhVWadN8NZ0xOGeHjudXCd2CVCshKDZqSEke2Jx8Hxzkt+hms1E+xg7pdCJtCf6j6smvZQwJlWUzI53ksUxUjsQAe3fZmk77a2DsTweEqaAPkO671I0SKWgZjR5qxhaWlg4P6Qs1bjUWqzkJf6cnBtzCi/82yzmjt1WVQP6hUPUPiMm3pB9UuuSZDcWbpeLtKZYJkMGIufj+24UdBg3NXEG3sjXCHPhKyhvjH7S1x10vhsAN5yELd+5MFZE0lKilcoRKdN7LJUkgOX6GgXFzynpdK6nWYQJHcQs17d/9/f0da80RU4uy5H9DOe+HR1KfkcmDwp+M42CwHvSno2WGRQa2oCbq+kXMDeEYrMQVYd+YNHtcLCLMvGNfRSfEETd02VP2hYWUvv3zm/yAcbmhjKTb6iIRAYmUxc9X0b5FgMBe5kfPWpGjPMAAzVVLRAbFed0fxwJm8PrLNdVeIl9+Rjwhd/AyHjoSwE+XSsyviUciIGwn2v3/lO7m+GBi8Vkpjz62vaduy+8PpQNXy6onB59w+w6IiCg63+jU5H9F8QOoTFEQvY/MCu5pqn7muyiUxm0UV X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(366004)(346002)(396003)(39860400002)(376002)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(1076003)(2616005)(83380400001)(38350700005)(26005)(478600001)(52116002)(6666004)(6506007)(6512007)(6486002)(2906002)(38100700002)(8676002)(8936002)(4326008)(36756003)(41300700001)(5660300002)(86362001)(7416002)(316002)(66556008)(66946007)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G6hrnA7HPG8TEinXNjqpa889QhOk483vPGC4PgrqdZz3i3R1Tdq1g6oBxeV1oSvIHWEh14d6EmM0ukqAFsWWv4JOGb5e8fS9dC08Ev4y8WjxhBz3sMk9LRC9qt79ddDfR1C5RV9JeiuSkYueh4SPRSv2W2X2IED8/gZnWnbBlvkhGJEoIEdBav/T3gvckk/30FdDSVaEos7R6YjB0Kd5SeQxkCaNbbaNc36uLPsG34Uk+TF2j3RUCeq6qiGmKS53kd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6R3pEOpy/3vQFwVmYRgRn5yLyBHXRf+pdANz/cG0+R/3hE0CGw6GmbCszvu6d9eLCx5h/Lb03SqzjW66Wh9Lq7cNpEF1HBvebg2ZpSxIzF46xHFdRja/cgtOzNgPCZtZlr/9S7AhFd6tQR+/ge0PPqLfaBhktCkDkokMtp7erNjnPMCjDJbaeeZbblOXShX0SeJ6SRYwF+sxS3v2m1uFYN0B5+UjBptiumDgO7fbu1cgLsE3dbZhAK4ZQRET3adAbDuwg= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32a6b557-af37-4f0c-6a95-08dbe5293046 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2023 15:48:47.1413 (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: zgNmV/Ior5IihPDOW+k719p6NVfPSyw85qMNn2gCWBz4qscpojioDQ8qSKrPXPqzyEAkFb5qLY00NL6IPoWkiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8113 The eDMAv4 channel mux has a limitation where certain requests must use even channels, while others must use odd numbers. Add two flags (ARGS_EVEN_CH and ARGS_ODD_CH) to reflect this limitation. The device tree source (dts) files need to be updated accordingly. This issue was identified by the following commit: commit a725990557e7 ("arm64: dts: imx93: Fix the dmas entries order") Reverting channel orders triggered this problem. Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Frank Li --- drivers/dma/fsl-edma-main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 4635e16d7705e..3ee08f390f810 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -24,6 +24,8 @@ #define ARGS_RX BIT(0) #define ARGS_REMOTE BIT(1) #define ARGS_MULTI_FIFO BIT(2) +#define ARGS_EVEN_CH BIT(3) +#define ARGS_ODD_CH BIT(4) static void fsl_edma_synchronize(struct dma_chan *chan) { @@ -157,6 +159,12 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec, fsl_chan->is_remote = dma_spec->args[2] & ARGS_REMOTE; fsl_chan->is_multi_fifo = dma_spec->args[2] & ARGS_MULTI_FIFO; + if ((dma_spec->args[2] & ARGS_EVEN_CH) && (i & 0x1)) + continue; + + if ((dma_spec->args[2] & ARGS_ODD_CH) && !(i & 0x1)) + continue; + if (!b_chmux && i == dma_spec->args[0]) { chan = dma_get_slave_channel(chan); chan->device->privatecnt++;