From patchwork Fri Nov 1 10:14:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13859061 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2040.outbound.protection.outlook.com [40.107.103.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 55269165F1F; Fri, 1 Nov 2024 10:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730455456; cv=fail; b=DuheikuWmbNAKSEYUL5fTQhaeDxD272p9+P3xS2K/9AkA2ZVw0VhhLSC5HsPi0TbOUyhBx+JkvAiTELkXUCmtt11GPFFKq4D+HEEyTh3KUcUmAWiNifAlyj3bXZd5FyaWCf2IEfg1C4njzriU1Eo2TexpoCpDihWDmuSX0EwwcU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730455456; c=relaxed/simple; bh=2vaUDbbjH0SnCKbgInmGyflxTp4uRy3bvR9BqM+UjzQ=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=ko6UuwE6J71VWLB5rYCXAiIdPb4NSaUCX7n60Ps/gSdBkMemNb7tSxHGtzkuRpSTcVzX9VOsGQAyLbyaKeZ3lKKJ4jZSqh/n6dLse+XMZndQXMv1qvaC1nPgLajvXugoY6GmFbBLJFPGCGkMxgC4KBP0fMpACdL1e6SOdA//SDM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=kGI6Rny6; arc=fail smtp.client-ip=40.107.103.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="kGI6Rny6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=M9BKJLpRJnMuH6PykBW6gxg2j4nHtOZYXeRYRIrBQLXDXPo4n4Z+SIVRpCsnX3SAgZl0HcZ8gPV2pP46jXDnbmNF40Y7bEfKDP2CDq2PCUb0Ngpl9Ol40BVBbfovuA0Z/ycpYDOs4J+Z1gwRI1Q5FYr1MW5HhLrhA9oH3/5zredIxQucQyBxFQKiWLjXP5SdEKkVot7Fi7WYVPaVX3cyholInjxwgJNyMHHmSk5BbzfuBN+Gi4+X2eJHSlFsMfXmXVrAfMSpDp/mM+U+xza0L7oG2jSPLYPedZ/AWfRBK34iFm5zOzVIPotZwAnP3fYLvrvO0Cb5r2CO3sTezOzohw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=goUqK77u6we//E4r9bcReG060QqtPsv0O90z1tBrcyY=; b=Zqsqg0WOQNUy1vDHDNGenObp2/OAx7ttIOouq/VQA8V6rGdLSzWg9J51dxtG0pns3ir4bxW9wwsd10n9d1cvCRpvrk0YD7yHfomxDIYCrUDARiTKboQuJxG3bZCf+p9zf9Sq/jhOwONHdGxjKAKC6pgIi/W1o9eigRoXMuLatrji5lNamu6XaYezeqTCwXFi4z78DTpq5q7d/scF+OgQFwhB3pQZdlWFJU+tmoJsv4jUxca2voCdOTI4+1YFyXFzt2cCSdaSOHKqYmI8lBOww3Q+luOFr9c6jkZgToPNSNQVa7mqwxi3jj065wIcg1iNjPxqN5YYopDjc1cCNNe4Gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=goUqK77u6we//E4r9bcReG060QqtPsv0O90z1tBrcyY=; b=kGI6Rny6NQ5s0dCql7zPuGYWylAHfB2EFAXAfmZq4rT8jMX4A9znlAv1YsMWgmMAkt2kM9MS5GIN3EwZwVnPIslcoJgpmSjnCASibKiycCRouPcfgmUN/gzEhYzs1SWgcevrOPYo1l2yLZLfTWivZSJFIgldAgc6PlMcgxCRP6WDAWPqlJIEvNTji6vsrrFtEpfujCzNGsWT/F+c5vERM4lYijsv+fxzl9QjEBV4LQBzhaTLbSWmBeOhOmPs2XrmyGbhMzMPfX7g7CAxTPyftT3VHyhb5iaPfY7WD4aHraUgtKXgComvsSViMf8s6sYmUacc9m1CK8BOqc7688F7Dw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by VI1PR04MB7200.eurprd04.prod.outlook.com (2603:10a6:800:12d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Fri, 1 Nov 2024 10:04:10 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8114.015; Fri, 1 Nov 2024 10:04:10 +0000 From: "Peng Fan (OSS)" To: Frank Li , 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: Peng Fan Subject: [PATCH 1/2] dmaengine: fsl-edma: cleanup chan after dma_async_device_unregister Date: Fri, 1 Nov 2024 18:14:09 +0800 Message-Id: <20241101101410.1449891-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SG2PR04CA0186.apcprd04.prod.outlook.com (2603:1096:4:14::24) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|VI1PR04MB7200:EE_ X-MS-Office365-Filtering-Correlation-Id: dfa50477-f91e-45d2-a2d4-08dcfa5c87fb X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: lpzRCh10eBP1T+sQ4+XhM0jTOLriRDWfekMDCnyS74ROQZGL5vzhh2EHowaDCAserKmyw8agTbLbzJbL8T1RobgS9ZhzVyN21Cfvi4rD1Ptaxgy4LTQ194lkLhlPtS1WTdHBwwGpWCKICY8xF3Z6H523taa40NgR/5PPwlhaBvhhg76DdrLk7rWMAbcKhdYA7L+PcSVlP0A1q01IDEeMuMDO1RWgnDAkQDp25CG+W5P9lIVngZk5dmunenlN3HE8xq4ESPqKzGoeRwg+yl2r5VwzLu0Ynvza67YM/+UAoryII2jPi9ACuL1RESw9Y0IGCSeDqkeSYP5IPLdH5Yvl2EXERww3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Y:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(1800799024)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ODQqXhDXpKtyziyaezcPaKgvUaN7Xf422SCBcS7TbJwkjm6RaRQgPSt4nWeLpRoMKpeOn6AuHvPArRkbguLzzln+4m0BL1P5V9rEsyWpVgMY+8oi5bpdngTa2u19F1H4DridigrrBDwK6hRmvqHL6rW738a022sHp/o/5nEECec3bOHtEJVLZN0GlItEv5mVnDtNKN09yZzPJwCVY/xEOHBzbdphLy/BS0iylP8sctyI3Huzym3C4V4wIIE410K2z6naqXNi+lmtT4r5FH9qETpH8NeEAwn9+mBXM3LVnJaaaLGwoge6S3uctIREud8CkQGNr0GSdc8v7AeUpaGB3ZOvThiGofzV+wmfVjWrJgLmn0s1jOJndevBUH0bWutGLXXDDS9H+IbTHg8u53e2IqX3S9AHJJV3ub4lBHMe/9/umCHo64jXFdRTf20v5EaEbfg1bTODcM5pSHV4Z6mfGnrymO06aoWROBIuovusvRit2AnqZMviTmIoc2nEstPt9gVzvCgvLzthKCbYycSs6OiVjhDV3xiQ4EEQpHQNN4sfJz9EtU8iH29mbqsqg2p7Fm08df/e3v+8Uc9iQguzZv1VzfLvljrnroU25nlOQmhl+ikYt3jcP4sPCxOMPXxKxKDHSpB4qWVyFSN7P8fo+fVuI03TwVx9Vk/091dEhly02CMDTrj0LQ1HiyPWT6hOi1ZG9wEel83tt4I4OKiDBr7bZf2SPwxT2ecc+2toVcgU+10YSzGoN91txjY6ACwV1UrLoko9xpRHXakJl/DC9ZhrzSxN7oIxAuCGg1AicTeux+yckeu8zCwzHqaimX2LIrhMqTur3BmisTCz/EIvrndo36Gst2RzsZh3Cluo9dWDSDy2NA84qrqcY145RThpI47jn4NIRAtnKCGhF5izaRATMwNnRQJY6/7AUe4vkxVZnHdlHTpuLFDMctsMNMtbOVG630Tu/FDDMW+uBkwyy/GKaT+tjjkbWdnRpZ0WEi6fYKHEKlkKHDAcedUcK66PpWIgAc26L3A8S9bVRwqViK8pTh3VD4QCtCyTGWA570xhJcsUTto9nKDorc9VO/C+6RUCJeIGgio3QsnCqSTtPecd00WIUhL1EXjKUMye9Xv9hMilUgzSD1b8p7aLr8e7IFb6gLZxJS9ZDPMSN6E/j3w3wrz2eCYlMv18iW68Q1oOjYM2khfznEEIfNwzasd4Mxc7dlxPnQx48NohyIJhokwGtfO1UBSu0Ww5iHXIZF2D5RUxpQDKdAa4zSWpU36FKg4F3kJoAQD530T9NM+hzBJYdcN/98xkqurSOwmxL54leb/k4+uoXD210BpzJ1JQjyZTEL1vNBJqN1B2lAeOTy28NMJr97JtBn4JMA1aW3NIlPFHPDVaMSj1ALg4iFTG1P+ca2GBzbBbQ1yCTfrWNC15RXvlR5eHYoagzVzbwsLbx6vNSj1wX7GKkzTYmGKkzrM4F48W1BjKJiaqwEH2i+f0UjvQ9TpOgfOurx0pySC6I/8518J8XZcVWwg0QGYleKWYb9OYL5iZd7JI00fi9dW3XKdoC36WG8wGvNI/OlOltryC3l0RWPCoZKcrtQA/ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfa50477-f91e-45d2-a2d4-08dcfa5c87fb X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2024 10:04:10.8157 (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: DPNrNhy3p67vBCWWUB13/Xvsna6bvu3vtx/vPVMNIIjYEGo+H2HpEFMkNJ+itTEe/kNslVJKej5qCXAIs07ACw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7200 From: Peng Fan There is kernel dump when do module test: sysfs: cannot create duplicate filename '/devices/platform/soc@0/44000000.bus/44000000.dma-controller/dma/dma0chan0' __dma_async_device_channel_register+0x128/0x19c dma_async_device_register+0x150/0x454 fsl_edma_probe+0x6cc/0x8a0 platform_probe+0x68/0xc8 Clean up chan after dma_async_device_unregister to address this. Fixes: 6f93b93b2a1b ("dmaengine: fsl-edma: kill the tasklets upon exit") Signed-off-by: Peng Fan --- drivers/dma/fsl-edma-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index f9f1eda79254..01bd5cb24a49 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -668,9 +668,9 @@ static void fsl_edma_remove(struct platform_device *pdev) struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev); fsl_edma_irq_exit(pdev, fsl_edma); - fsl_edma_cleanup_vchan(&fsl_edma->dma_dev); of_dma_controller_free(np); dma_async_device_unregister(&fsl_edma->dma_dev); + fsl_edma_cleanup_vchan(&fsl_edma->dma_dev); fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs); } From patchwork Fri Nov 1 10:14:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13859062 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2040.outbound.protection.outlook.com [40.107.103.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 E051E1662F6; Fri, 1 Nov 2024 10:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730455460; cv=fail; b=VadEcYGFhgcPjsfQ5BNSbTNWl5DkNNKA/slUmDimPbolTWN9/ow/bFMNyCqdSpi/jUSDLE7DGRS32V9+O81mlR5tNgDIJvF8CELCKZPEKLbPuv/L97JAJJm1f3OiHh84MjBrXPrJmyaDTEw+Ph0mdWJxrIUqrPPvru0pHcROl3k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730455460; c=relaxed/simple; bh=NXOskWM2QhLTNpRb7X/KITFT46yV8Q474IUSrhf/sOw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=JASQqVwz35A13iBSkcHE80nplkoj09VzBGIafCHwTHjB3x1rwPtoxXqlj6YFbB9/iW7IhQMZmPPgmlth3wCN1gmd79mu2czXvKkpbLGW86uHCJp4IMUyaj2bnIC621QYsajDfWPNXjhTfXa8IFRHH/+GF2te1L5nlwA6EMtUZr8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=dVXqDtpt; arc=fail smtp.client-ip=40.107.103.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="dVXqDtpt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lnBfzFos8NhCRYIIsdSGQZnjtnPhBym6Rbqa+VyowMOCMW0djSbDS/INaxRAT5P3dLei41FsogEKC47OY4y3qeWwcj+gfN6cEFltFM9IEAqYwbIZLeDBlkX2FZRt+ghPq8HjRo9xsfh30CbMGoAQqwt4/h6XzLmFft/zVt92Ga8DvwHmczK5mGVD+f9jyH/fSYZnNEcgCxzbWC2q5bJmbe1GwjAyKzNKB4lxPSffOYWeKKOGS25mnqRmoUMVk2MLpZMJc7vGV1AOYm8ivjDtuRfXj1SbvEkGtDy7fouzIePJKEW+2WdS0ZaCZtBxPeHTMOYjATft6m7/0vsafV3w3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2w32KZwir+2E5o8hWSntNZYM+pmVTo2dx5HBwggLxh4=; b=BmxLk8mdAYMHd/Dd1HjMPYzH7A6NOblmwtcjWa+3insf+r4PP01uKMEOIORq0GPEWEGMr842b+NCfRza2h503xVTxkUN9nhd3xUlnyQvBqFKE58bJjEE08KF195/JVKNiwXLbeLLT2GflBK6pb8EY8dLOXGClTQ7evOw/edghzyeKQevauJMNmApmDnM/q+c2fh3UO4MRD532Otw7S0t3V46KdOkDqMFZn/O6ROtzLJZd607QF8bCY4rVLV4BmqmuL8SijiW+bywcNMLLQo66IAT/5QkuQN5F7wMSA1IkJ5/XOk5OtFdVojbVIR7Q5iriJ7JFCCmymgyl16MzFabDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2w32KZwir+2E5o8hWSntNZYM+pmVTo2dx5HBwggLxh4=; b=dVXqDtptt0alQUm6OCVPv3X+6ZD4NhemJe5FFr2Yr4jSrC4M5YZkxmxh0vhLuJIPUtiqh1N7UXc6/hnIoZ+jw1O6adycwvd10/yqX//jVGK0C8PaRlR+3YGdYhZBP71VawIcZfF3lyNbXhS8xy9wG9ECaOpejsU1bAoz8h1OZchNO56dMSTByeosNIyY3q8rs/ziBYA5k8K6pLIJC1GqGOOg6VOWu/7KsUyEWOrsbap3sezlN7If0EuyLOuidkKPVUrNJsKEH0SLW7kFlVyJyyPf3ghd95sCdvGmlN76m/lyGbA/owCoDYk9Saf4W/Et/D+FlWCEvmvW++HCL22QLg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by VI1PR04MB7200.eurprd04.prod.outlook.com (2603:10a6:800:12d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Fri, 1 Nov 2024 10:04:13 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8114.015; Fri, 1 Nov 2024 10:04:13 +0000 From: "Peng Fan (OSS)" To: Frank Li , 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: Peng Fan Subject: [PATCH 2/2] dmaengine: fsl-edma: free irq correctly in remove path Date: Fri, 1 Nov 2024 18:14:10 +0800 Message-Id: <20241101101410.1449891-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241101101410.1449891-1-peng.fan@oss.nxp.com> References: <20241101101410.1449891-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0186.apcprd04.prod.outlook.com (2603:1096:4:14::24) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|VI1PR04MB7200:EE_ X-MS-Office365-Filtering-Correlation-Id: ba2c8f62-5e9c-4cf4-08b1-08dcfa5c8994 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: QBHjZvx1HKSVljaWSJp29zJP0u523fIZAvgXBFZmexPz8lWTCt71Cwc0Jrlf8zP2qkRUbJZw+aUQIuVLJU44UVHABowCDAviCFJB0AMYXhLisMWQxwC71rkIKBeQ3RUfMXAzWyHoPWwtWRPCzOmR0YYYBgvc4ZqisRPHiRvUcbW/bhMCam4J//EgNsBGOoylGkOVsEFt0T/9vht/oTfx9JoJsklPSb7MO0XMlyxnWcjzq1uVHoZtDVT+hsxZIEH0cUVdUxja8cDejMrpq+2bky+nXjc8rF0UsLvbh5pF73jVHd1VV3damKGX8Qp2sAwrkbhp574H+tH13z4BmhD4MDDIwhrD3M/UXWtPFisXvo0v2HvqM9vms0LjU/BDm60mwKFJJ8njqJX9NG1K1B9Ay1PpRTxA1hcZbODXUf6ofKe3i7TMN7AlGoHY8e+sr8n7KZpsPYHbz1JrN4ujEsDBQ/vaq+ceTzaehSCrZX9an3SYhD+6W/LoBO5PlI2TSCTnWPesLJub0A1lrfXp/eluShHOnCRqngfIYuKgFWXKg3003X/Bfxrpbo5J1OMvqcMSQGUhkqaCn1/ptOq7OUhj0pf08r92YP4mUxSKJDI6Z1AAa8ZwbxhBUbHIsWeDgGz4Brn+bCj1YXfyUHh68i5adJRDojOBnl9sZ+FcvDRKD5R+xoErZqw60gQWuHXxQH49c6FlOw1Irrg8+99POEn82GOZaghPGReo1TMYXtZ+D9w1jFx4mdsjB5t5XMKpyhr2ufeK72I9WC7XfS9QsNrxht27dUFYsAFpjAPs172u6vd4edwkerHma5sN0BT83OY30+nvcqxqdTAg2OFcm4BKAtWYXS3OMuVXYpK65+1UOlRh1Qigli3vECpGMy7hrdoTu/VyZbChGYQMZQVFd6htbe0z2lUJhonPjvMBsZWs7tG4v1Gee4TDTT+fb08X9H43X5wpCDtRZAQWmd2LLdNDbluggKd4/UNJ/r9yLB46lQj8XmD5G4qlRS1H78Reojs98KxDCM5MNaie6mJkm6JJAVXlGXP3y0Po21Bbg2mysVrH6fhU5cbRK0vhOCORPE8h1BZ4PKPW9VDbcn4R1CyO0VlzNK28HE9o25zFP5KRtpZ+zD118uAgJjMWMWra6VseCJyXRzr5lJN87I8dSd2pv5XE9Bwi2AkilH+kH7PDQmYK6bdzqvMJfHW3C4X0cumD4E7YIqhwRlYbDP5Rjg/AmhL2ueBnOHqCSAXG3/Kvq2+4vQGF7oP2rbwHhVQkxCiJ1GxQSn2OXuG2+9xVAFLeBbwQ0JB7SIN5zcFEhNwnBD0BwDLSves1+xc+3RLpYXP2mPPhtLQ3TnaEvFXgl4QtghmuuSLuLYAi9PCYFcjrp9g= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(1800799024)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AvzuOvmc7kOqTATXtpnshQeS2KEUW4jMhNCvaNZNUNyp1qvT3ZZHGLiSNkTy3EgHPNPxoSNGPM5+zMuw/gY22qyHAJnTcoN6Jj3UIik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Ikm8r3npr0jqf3ElHf5grzGkow3Y+wdwbDh3x7FHNLkwtVOP0/XfJbzHDWEQ2YiMYfidIU7Wq9Ao0Udaj/XxdwsR91HqO9ITLhQ+NUauQhCMa80r1+3sqJ7yRf8vE/MjYD0exGX6vE1ojQ7kaosbaH/vbIxPeZ+fcVZt5HW3vr2djRcMnMb3U6EoMz+LCn6axi7nT+B8h4jq4ugeYTnRkUwJoEuPrx99JZRf7KChxdavSbTf2s8LC+chC/ZMTM5LajZOnFxWVa7yDSjFYFXcsYBMBI16xJCnPiljiJ2ONwrisMnY98HXYPIVJfaO2cqwTp2c7kqVJRx7OML1H6J0RhDg7hFOdpSiw+vU+1tB0XThFDRKPrRogmVMtEiaqlPrqXU/YNqC6PC8EdOBf12RBYiDDjtu X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba2c8f62-5e9c-4cf4-08b1-08dcfa5c8994 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2024 10:04:13.4801 (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: Yxx4U2pLEXNCeRaY2Ad6Hqodt5Uk7qbAwEHcuik5g1Y1+UL/5qcCan9/PiWZtnP+Asgup7CuZe2jzdV58nm6+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7200 From: Peng Fan To i.MX9, there is no valid fsl_edma->txirq/errirq, so add a check in fsl_edma_irq_exit to avoid issues. Fixes: 44eb827264de ("dmaengine: fsl-edma: request per-channel IRQ only when channel is allocated") Signed-off-by: Peng Fan --- drivers/dma/fsl-edma-main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 01bd5cb24a49..89c54eeb4925 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -303,6 +303,7 @@ fsl_edma2_irq_init(struct platform_device *pdev, /* The last IRQ is for eDMA err */ if (i == count - 1) { + fsl_edma->errirq = irq; ret = devm_request_irq(&pdev->dev, irq, fsl_edma_err_handler, 0, "eDMA2-ERR", fsl_edma); @@ -322,10 +323,13 @@ static void fsl_edma_irq_exit( struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) { if (fsl_edma->txirq == fsl_edma->errirq) { - devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); + if (fsl_edma->txirq >= 0) + devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); } else { - devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); - devm_free_irq(&pdev->dev, fsl_edma->errirq, fsl_edma); + if (fsl_edma->txirq >= 0) + devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); + if (fsl_edma->errirq >= 0) + devm_free_irq(&pdev->dev, fsl_edma->errirq, fsl_edma); } } @@ -485,6 +489,8 @@ static int fsl_edma_probe(struct platform_device *pdev) if (!fsl_edma) return -ENOMEM; + fsl_edma->errirq = -EINVAL; + fsl_edma->txirq = -EINVAL; fsl_edma->drvdata = drvdata; fsl_edma->n_chans = chans; mutex_init(&fsl_edma->fsl_edma_mutex);