From patchwork Wed Sep 9 16:22:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 3252 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 900311C2B4B for ; Wed, 9 Sep 2026 18:34:15 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=NXP1.onmicrosoft.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-25754-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-25754-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id A00D961F4BD for ; Wed, 9 Sep 2026 16:23:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3B99356766; Wed, 9 Sep 2026 16:23:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="EgkGXJrI" X-Original-To: linux-sunxi@lists.linux.dev Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11012028.outbound.protection.outlook.com [52.101.66.28]) (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 B7339582B9E; Wed, 9 Sep 2026 16:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.28 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788970988; cv=fail; b=imuGRJPd+B6DVvx2ELTa9QWiGvZEXrCSf+6g4+tSmJuq1D3OIfDaqj4MKH1JX+DHDiVAEGcdMnUxQufazKd8TkYOEc6yLv+9p6jvqQcmUMD0sEAkklTOl4VW30UH0QVcHmgLYSuBX4vf0J9p7a10SV8ZRlMxGQt/ijIRotBm+wU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788970988; c=relaxed/simple; bh=Ua0YwGFSrxEWjUVeaNv4r7bsH+XK7b+1JLJ/YN4lWcM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=sb5ka9sOxREjkqmAhI6TwGXkM4z3tjF7iXe/q0UwFlBvjM2Jdz8N6JIIhYGmjaoeM2XDkZiIrRRs2TX+QgmgNntwhj45blXc+D3GejJjoAXwTXTrt5jwYk3favfOm7lxykyiACMo70x5FJ9b1US3J0LgDw1gSmN3zX1IHurPF/o= 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=EgkGXJrI; arc=fail smtp.client-ip=52.101.66.28 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PmCyBJFF4/JJjLvKG4S0lQFVDQ3CETjF7DRX3GWG6w0zdWdVpUobRijswCdDFV0LLt1cZ7ISO4BHIQ9zvqubOJThoutdeOp4yDjWs5D5VrMGUoW/36jWMGNbXZaeXct1oV6ZJmJPkCJ1ObGMc/J7oKQwmam7knVMvSlX1cdMFa/GQIqWzi6qG9woQWiMBKNJPp8kXjIWZdW9SVwRxDEuvXtonJzkw4QLlLRJaMHOtAesfcL3R1x0oVkauZEpItngpWOGFTf+E80rdnbEZmA6VFyxpWZMNxsno0z3s1fQoH/nOWKJNY/9Z1jV4phY2ce07CEQAplG45VCFOuDHdM7nQ== 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=7abauvZzDACK0Ed+1mJvu+H/+yYSq0K/zf/n2yHRa2E=; b=xtDCjuB4wLKnX/IkKFMRBnsHIJ6dhgXexcJNJAdc9In/arQTdTFuAPGok0bVCHEsZ91dLquC0t2UOxqBcwHPxdw3N4Bvp/qIw0GMH+mTe6o5XB1ir2oTSrhXWSE9phZMYVO1j0eoFoglg8ccRGh18soT8joNaFoAlTOV/pT9LgZwlmcJgB2ssGnpXBEAnrl8S8m3OXAkybUS6/8Wr1YFzo7vWRVa3zgDbp/uqM+MQb2ZuBrE0ROm08Z8Iq2puj0HI/MrrkEZVry40rv78P5lQO095+5dqchnebG4f1XH70gmioRi4KMl59Cdu1UCYr7Q15ZMGzcw6PP5Crq5iKZoOA== 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=7abauvZzDACK0Ed+1mJvu+H/+yYSq0K/zf/n2yHRa2E=; b=EgkGXJrIDu9sZjzAztwkv+/7JgE6a23nn4l/AE4CZYkVwcdlr4Yiu+Hz7AbgUeX//MKqrKKSyj6ior48Tz3WcNUO0mlup0QPCCcA0sCm8XdG3sBaMGNEoV063Rmm0pJNHLSlcegEknajkXQiVtLcQZGPghal/eNowK/Ta3kqQG3yARB0MvV/RqKrQA4yQb5YkJTzh1GmOKzD0h+VKNJdClXGSXz3RbBnUk+N2R9fF3q4NpUa3JrmmUwkgmMHlpJYVYgjzjtTdQ64NZTqGGcr8g5PSjMcnQjdm2xUml1Bqxc56RK7CSomBeX3V7RAmGsZUjmy2zFf9TuCrw5dF6NPjQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) by AM0PR04MB6786.eurprd04.prod.outlook.com (2603:10a6:208:184::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.406.7; Wed, 9 Sep 2026 16:22:58 +0000 Received: from GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c]) by GV2PR04MB11799.eurprd04.prod.outlook.com ([fe80::2146:83a2:5329:b7c%7]) with mapi id 15.21.0406.005; Wed, 9 Sep 2026 16:22:58 +0000 From: Frank.Li@oss.nxp.com Date: Wed, 09 Sep 2026 12:22:31 -0400 Subject: [PATCH v4 4/4] dmaengine: add union chan_dev for dma_chan::dev for clarity Message-Id: <20260909-dma-chan_dev-rename-v4-4-d8fb6892a70f@nxp.com> References: <20260909-dma-chan_dev-rename-v4-0-d8fb6892a70f@nxp.com> In-Reply-To: <20260909-dma-chan_dev-rename-v4-0-d8fb6892a70f@nxp.com> To: Jacky Huang , Shan-Chun Hung , Vinod Koul , Frank Li , Paul Cercueil , Eugeniy Paltsev , Andy Shevchenko , Binbin Zhou , Patrice Chotard , =?utf-8?q?Am=C3=A9lie_Delaun?= =?utf-8?q?ay?= , Maxime Coquelin , Alexandre Torgue , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Thierry Reding , Jonathan Hunter , Ludovic Desroches , Viresh Kumar , Keguang Zhang , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Kelvin Cao , Logan Gunthorpe , Laxman Dewangan , Vignesh Raghavendra Cc: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-actions@lists.infradead.org, linux-sunxi@lists.linux.dev, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788970951; l=6095; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=gHj52vD4WNLOndR1YWKRKx1PK/eHQkOd6+tAOWX9+Io=; b=rLyrCMSAaeqf737nI0+3KNhYuzF/PHdlwAvBsq4aslxfuLfa/LjJBtXopLfwIeM8T6ydrDSDy +nEvaBDW1XCCj3gdk9RYqFRLEuKRCAio2Q4L8qi7QDJ3vYzzyYeyJdN X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: PH7P221CA0030.NAMP221.PROD.OUTLOOK.COM (2603:10b6:510:32a::35) To GV2PR04MB11799.eurprd04.prod.outlook.com (2603:10a6:150:2cf::9) Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV2PR04MB11799:EE_|AM0PR04MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: e9789093-cbbd-4b38-eae2-08df0e8e9c8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|19092799006|366016|23010399003|1800799024|921020|10067099003|56012099006|11063799006|22082099003|18002099003|41080700001; X-Microsoft-Antispam-Message-Info: 7pwalToPSEwKsAy69W6aq4wBxqMbZUAqZVi7/iqc30RZq7sT1hV7GsGncKTcJ5Xd90zhx2Rqlk8JgnmGU3uzTMhualDiWh1izNfs02o2/qeKMopcncWswenOkIH/wb8ExokO0v6Ru6cIRg46jVZopD+EiAfXHafh6QL/THWwvi/j2zM0c5lcpUfQ4pfNGGTcrcrupeADkfznMpf8jHC8nk3XglM1gN8LGImA2+p48p4kES5981HPQlkiN545fiKDp5JHgVaqNLLB/riplH7mSvtph8fhh2v7ta3+HhAXaF9V9hKl99eMCAWzmV0rqlqMdM3NrBAaINiZGidPxpZ7G7iUja/OIO2ij6VhD4jWB1+4p9NOdiv9IdHlZMXgCO5d3Dtcpo/Wm2of5wLSrsoQ+jhVdDhoBdXSJMeWKnpFAJqkkOQv7YKPOOQE4CmTmDf/qcbFTphqM16qpfTeSQ0X0F+nAyyDs5DTi5XZuEXMlj+R9MVX+8TRu/8my7W5umWtFvghnhEagAvWmN69uB+Es5f5L821ZgiuyQQkMyNCtEiQxV3L/mm78yJocnNfFLN0Q+1ZDjsI0RbIPBbXq3yfnNaHEMMgKhr+/cB1/4GzyKmJpCa4iAv3efmpbTdz0wXNECJa5uipwDF55JMUSMOvP3vK/VxKp3rZlvtCEi24G1DNjsby0UgzDSq/uQyDtmCW3/qWNSDF3n1r/cyK3heTPnlfpsaMJT0QZh57G+t/qynP+tA1limnJDzQyb/UqWKI X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV2PR04MB11799.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(19092799006)(366016)(23010399003)(1800799024)(921020)(10067099003)(56012099006)(11063799006)(22082099003)(18002099003)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ArqzpnAky1xIvE6jZSomzAfhm3b+?= =?utf-8?q?NzGYIDniR4QFNCcByq9yH6THrSsL/TlltH5aMPd4mH2IBH4zJLlJrTgnrOd4RSsnL?= =?utf-8?q?yM53aca/n1dzD3SII50CHmr6qL4KMEk4rnS16S3Z4/okFQC1vQ2KDDhsVqfFvjheZ?= =?utf-8?q?JwIX216iwH+7yBG6GOgDYt2GWLZu/sJim6NHze55Ys3cMEafygW3LFjcWGpBlod1Q?= =?utf-8?q?2wgtqvB4PoyJTPPubEEmR4hRlkGw/gGMkvojQ7IOjMZak6kLoywMla1h7tatZcx87?= =?utf-8?q?KOK/OrvizBswx8WVk+T0Xz7YydnTkXCBiAFTszkkRwIh/PsZ6Mbv66jsnMtTcDw2c?= =?utf-8?q?soTFlloMbceuCYpTtjA02jwl3MQPS6gjAj9kxPyCB9Xae5lDDEQKQ1CHeCA8ESBtf?= =?utf-8?q?uK1j3cETse8yQsVzWRz5lb28cfheeYohkVs4RnXQLuHtZwr8zAAD8oQnJ2DMDEf90?= =?utf-8?q?gRn8e1FcTcDT9YruZsIIG7rNdH7zuCageidbdkPrt3KcCC9nyrzc0BpY8BQki9jL4?= =?utf-8?q?Q3KHUdpRbbnm0rmSUu2IGjHmksvHT3eLFMa69zUmXfcjgGcSEcygVbb86hWyTKt6k?= =?utf-8?q?of9gSqXNyrUZXsbgr5Q5ywFW/Z8Qab2lOYbrHfDiJXLZI22V3s+VIUCHUC6l8+eHL?= =?utf-8?q?47k+6gTsMm178n4Ntd+k6wwd2N7WIe16USVp32a46rxas/juJ+e/GJtphUqTtw8LN?= =?utf-8?q?m1CYTCcHHHvAT/JMLJ56l16BMyQf0L+i6nlDOCOaX3pQb762AIdn+FCEllWfP+7vl?= =?utf-8?q?V0ELXPxBIu6J6ehGdzfEd4eXEbgqMhVSm4miRr9coPLdiSqUmHmOM4Jt9h2exk1G7?= =?utf-8?q?lkSqXxXIMEYRPLS1l7+clu8GmM+fPC9m1537V0E0lXVFicZHpQTnlM5DMY3p0op7g?= =?utf-8?q?a9wgourfse0gGdxDMFmhdMcCim/iZnw+ZYdZ0rKicg7+Y614hhmuVfx9YTPIr6EQD?= =?utf-8?q?fy9/HnoQhsNMwq/mNv0qphFhy7nUqz0ZrsGdVkOwmr3hPA8fNc07WH0nErSAMLzrh?= =?utf-8?q?wPB66eOfuZ1E2pCNAzoLIBTJWUYudTfxC3D+4SFNn9ur0kKH01rFcFQn7n6Z5/iCG?= =?utf-8?q?xkLrxJGhYtSD6utepJt6JL1C7IVEvenbK4V+GF8LdSlCCtarFfrU8NIUfWQqAnXpU?= =?utf-8?q?W0ek7Y2NVzQRwA0sDT7K109d+4VB+s+3pZFUvoqaDgZH6Hed6+DxNAVno5ROfX7zm?= =?utf-8?q?H1wDZO5VqD8mEOXu7LbyFIswDRHCLB+Jmj7D2eJgTDZLwEJburgFCrxrvTOBXiahF?= =?utf-8?q?GD/C4pGoGILVcAFDLd5+5n9/43zQ6t9XD9zkqnm6LC8rYdMji6h60ZKHRQCpMxpCQ?= =?utf-8?q?fItQ3JHg22ymBfBeTtVXByBPsFWdhXnSVvzQlVS5ZdufumK8VrHgyjHvpMrjjT9Jn?= =?utf-8?q?D+OZZ3V10vnJQX1jwFpsz03LK3D7fn+VF8RpbU2Omk/iiOOZ4K4LHGN/xhxeeSzt+?= =?utf-8?q?7QaKY1si9oGFeZalzZOq4vUgcgO5FutFgvkYetQ2rLRdYCCw+v3YTEMQ08Ca0SdCe?= =?utf-8?q?EysaegQkbeizhFlwah8M5c2oUTLaWfoslWXQepvtWWmact3czY1q2E2piwxmzjFsV?= =?utf-8?q?e7NS5McEYCZx3ZxTKgvs0e7RHCyVO57Y2uw84exuAfOIfVb+IJ9s0L30sR0DWDO1v?= =?utf-8?q?Qd5k7/asqqAPet3Mjz48e7iZnrL0ttAW8u/VeZreykT2TGIlkyqv4jViBjl4Q5vWk?= =?utf-8?q?VQs8xbZXY?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9789093-cbbd-4b38-eae2-08df0e8e9c8f X-MS-Exchange-CrossTenant-AuthSource: GV2PR04MB11799.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2026 16:22:58.6470 (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: ZZEiLnC4iI5iaYVem9V5CjQuUahbxiCPKaloEtNgbWFGZaLx/irSfO7ZMxY1afLo3owBgZvjYViOBtCvoiOzAat6oKocfDa+mjyKR8hSWrMSAMUsl31RKH8JVt5RV58a X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6786 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [5.34 / 15.00]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[nxp.com : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; ARC_REJECT(1.00)[cv is fail on i=2]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; R_DKIM_ALLOW(0.00)[NXP1.onmicrosoft.com:s=selector1-NXP1-onmicrosoft-com]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[NXP1.onmicrosoft.com:dkim,intel.com:email,nxp.com:email,deltatee.com:email,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[43]; FROM_NO_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[Frank.Li@oss.nxp.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.90.174.1:received,2603:10a6:150:2cf::9:received,52.101.66.28:received]; TAGGED_FROM(0.00)[bounces-25754-noreply=patchwork.local]; DKIM_TRACE(0.00)[NXP1.onmicrosoft.com:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FREEMAIL_TO(0.00)[nuvoton.com,kernel.org,crapouillou.net,synopsys.com,linux.intel.com,loongson.cn,foss.st.com,gmail.com,goodmis.org,efficios.com,nvidia.com,microchip.com,suse.de,zonque.org,free.fr,sholland.org,deltatee.com,ti.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.232.135.74:from] X-Rspamd-Queue-Id: 900311C2B4B X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Frank Li The current dma_chan structure contains both "device" and "dev". So chan->device->dev refers to the DMA engine device. chan->dev->device refers to the per-channel device instance. Their similar naming makes the distinction unclear and increases reader confusion. Add union dma_chan::chan_dev to make its purpose explicit and clearly identify it as the per-channel device. After all user switch to chan_dev, union and dma_chan::dev will be removed. Update the kernel-doc accordingly. Besides its sysfs usage, the per-channel device is also used by some DMA engine drivers for IOMMU mapping and therefore deserves a more accurate description. No functional change intended. Reviewed-by: Logan Gunthorpe Reviewed-by: Andy Shevchenko Signed-off-by: Frank Li --- there are other user use it outside drivers/dma/ directory. --- drivers/dma/dmaengine.c | 14 +++++++------- drivers/dma/tegra186-gpc-dma.c | 2 +- drivers/dma/ti/k3-udma.c | 4 ++-- include/linux/dmaengine.h | 18 +++++++++++++----- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index a7ac2729e4d9d..bb30a9aa54d3f 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -1083,8 +1083,8 @@ static int __dma_async_device_channel_register(struct dma_device *device, chan->local = alloc_percpu(typeof(*chan->local)); if (!chan->local) return -ENOMEM; - chan->dev = kzalloc_obj(*chan->dev); - if (!chan->dev) { + chan->chan_dev = kzalloc_obj(*chan->chan_dev); + if (!chan->chan_dev) { rc = -ENOMEM; goto err_free_local; } @@ -1103,8 +1103,8 @@ static int __dma_async_device_channel_register(struct dma_device *device, dmaengine_chan_dev(chan)->class = &dma_devclass; dmaengine_chan_dev(chan)->parent = device->dev; - chan->dev->chan = chan; - chan->dev->dev_id = device->dev_id; + chan->chan_dev->chan = chan; + chan->chan_dev->dev_id = device->dev_id; spin_lock_init(&chan->lock); if (!name) @@ -1122,7 +1122,7 @@ static int __dma_async_device_channel_register(struct dma_device *device, err_out_ida: ida_free(&device->chan_ida, chan->chan_id); err_free_dev: - kfree(chan->dev); + kfree(chan->chan_dev); err_free_local: free_percpu(chan->local); chan->local = NULL; @@ -1155,7 +1155,7 @@ static void __dma_async_device_channel_unregister(struct dma_device *device, __func__, chan->client_count); mutex_lock(&dma_list_mutex); device->chancnt--; - chan->dev->chan = NULL; + chan->chan_dev->chan = NULL; mutex_unlock(&dma_list_mutex); ida_free(&device->chan_ida, chan->chan_id); device_unregister(dmaengine_chan_dev(chan)); @@ -1290,7 +1290,7 @@ int dma_async_device_register(struct dma_device *device) if (chan->local == NULL) continue; mutex_lock(&dma_list_mutex); - chan->dev->chan = NULL; + chan->chan_dev->chan = NULL; mutex_unlock(&dma_list_mutex); device_unregister(dmaengine_chan_dev(chan)); free_percpu(chan->local); diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c index b3327aa35de40..e76c58f213d84 100644 --- a/drivers/dma/tegra186-gpc-dma.c +++ b/drivers/dma/tegra186-gpc-dma.c @@ -1554,7 +1554,7 @@ static int tegra_dma_probe(struct platform_device *pdev) return dev_err_probe(chdev, -EINVAL, "Failed to get stream ID for channel %d\n", tdc->id); - chan->dev->chan_dma_dev = true; + chan->chan_dev->chan_dma_dev = true; } /* program stream-id for this channel */ diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index 49e2d0014d5ed..78a67cb9d6e00 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -426,12 +426,12 @@ static void k3_configure_chan_coherency(struct dma_chan *chan, u32 asel) if (asel == 0) { /* No special handling for the channel */ - chan->dev->chan_dma_dev = false; + chan->chan_dev->chan_dma_dev = false; dev_clear_dma_coherent(chan_dev); chan_dev->dma_parms = NULL; } else if (asel == 14 || asel == 15) { - chan->dev->chan_dma_dev = true; + chan->chan_dev->chan_dma_dev = true; dev_set_dma_coherent(chan_dev); dma_coerce_mask_and_coherent(chan_dev, DMA_BIT_MASK(48)); diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 33aa1bfc8fb84..c3a49a33307c6 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -325,7 +325,8 @@ struct dma_router { * @lock: protect between config and prepare transfer when driver have not * implemented callback device_prep_config_sg(). * @chan_id: channel ID for sysfs - * @dev: class device for sysfs + * @chan_dev: class channel device for sysfs, some device use it for per-channel + * IOMMU mapping. * @name: backlink name for sysfs * @dbg_client_name: slave name for debugfs in format: * dev_name(requester's dev):channel name, for example: "2b00000.mcasp:tx" @@ -351,7 +352,14 @@ struct dma_chan { /* sysfs */ int chan_id; - struct dma_chan_dev *dev; + union { + struct dma_chan_dev *chan_dev; + /* + * Use chan_dev; dev will be removed once all users are + * converted. + */ + struct dma_chan_dev *dev; + }; const char *name; #ifdef CONFIG_DEBUG_FS char *dbg_client_name; @@ -532,7 +540,7 @@ struct dma_slave_caps { static inline const char *dma_chan_name(struct dma_chan *chan) { - return dev_name(&chan->dev->device); + return dev_name(&chan->chan_dev->device); } /** @@ -1805,12 +1813,12 @@ dmaengine_get_direction_text(enum dma_transfer_direction dir) static inline struct device *dmaengine_chan_dev(struct dma_chan *chan) { - return &chan->dev->device; + return &chan->chan_dev->device; } static inline struct device *dmaengine_get_dma_device(struct dma_chan *chan) { - if (chan->dev->chan_dma_dev) + if (chan->chan_dev->chan_dma_dev) return dmaengine_chan_dev(chan); return chan->device->dev;