From patchwork Tue Jun 20 20:12:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110684 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3917965vqr; Tue, 20 Jun 2023 13:21:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6709r0XHtE/CwImRJtBKf4P3qhByLruOpiPF51Ox7UtrAV/CbQ6CkCfw/tQZ+i2BJN7Qj2 X-Received: by 2002:a17:90a:194c:b0:25b:ea12:a2f5 with SMTP id 12-20020a17090a194c00b0025bea12a2f5mr5030314pjh.35.1687292518910; Tue, 20 Jun 2023 13:21:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292518; cv=pass; d=google.com; s=arc-20160816; b=wz4xs5BdTCQrjwlpK7cqq4I5o4z+7X6G+krX9++WyHsW92MJ5QYKjVPWsRQR5nJauZ 55xW/TgXfR98LVETBq/TGM1n8+w2M6OLu7grtKNGvWXVjG+q7a8Aof9637O4q3ZKEGBp Hq2tiobBuMzwlh+IlUFHuJZZR4EtbRYbSXM50DPPqGR18HbFWafj2A1GM/ZFmGXySv1D q40uJgT3EKXpzQA7ZgAqu6NDkGi/+8yVp3GbO+zNDsW4Dv8HoEonwU/Vx1zefPfeqXef gmpmCeyEeHSCsnqkUefWV8gGTVOYGAIFMxVWRuPQkxPKURhI++H2x6qOzjq/gcLCD342 DTEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3PiQca/rhXI4tmiaMBYojKL4cq8Esjj9EehlE5LYftI=; b=POCDlIB9rRJPvw7jFUOdG9IgCbPYhDmDB8ff2UF0hDtJlDLPurNwmasr7Nt6JeOYr7 5YhY9mI45hemcErzIsepB3UDDeywblPckibqQG3KrRiR2aQ+Z5XYXBhOx8KQ2tcQgD2X exX8WzPlym2NFgz5QRcbLvUU334CZtKcJH0q82eGMdNvX4c+bcAIhngXeH2OExrZjzLp 5/vVGTZTRk9PMFX+yNXeTsqm5fFnQW/9UYzUk5kY4QEyMggj15aGVfUGJf1rDUpolKw7 Rs+jClMrvMLILvrb/eJEsc0vTWwTd/6ijHpEZHw0LWyWGM9a9gtEP5JgqJ4Uzl3Eesc9 kvXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ShHVJcQU; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l70-20020a639149000000b005348202cac1si2427797pge.5.2023.06.20.13.21.44; Tue, 20 Jun 2023 13:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ShHVJcQU; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbjFTUM5 (ORCPT + 99 others); Tue, 20 Jun 2023 16:12:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbjFTUMq (ORCPT ); Tue, 20 Jun 2023 16:12:46 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2063.outbound.protection.outlook.com [40.107.6.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C24161731; Tue, 20 Jun 2023 13:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oIxQk4cJKHhr66QmbHDYSkahxxJ4jlTPZeb6QLImbe0NPrs9NcVqY16GZqnKCXobI3GnfMh7sI/5iyNwobYZLyINK/276kinVUVxPQNGTsOw41C6QlxnkihLUIU6RiDv6UJl67MRU5zU7oU3z82ADqequsTcnVI2PdNyt7vrKQfacNq+McLAmvIwHGEKOmf+3icm9vbfq/wts6Pgb25mMIt/J8KLGK6H/9O+1MmXZYapbsgy6R5VusoWuuJk+f2Ww3aC3eQoQUXTmBRd45mxw/LktlQd8cFaXS9AON2vD+ocRR+LioQgt50Eg/5ZOXOcE5yV6bcqcND68uPnNIyu4A== 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=3PiQca/rhXI4tmiaMBYojKL4cq8Esjj9EehlE5LYftI=; b=KmIId6WcMcD/xSlrx2QK7wEFaK8jYrMkBap1O5GsGHtwxySwetUxqfxPxalxSJUoDU1wedJ5qf9a6i3BnTk8gQpGfYmGEgogYRKoRhMhB4GR/H7D+Gs7cjWk5zIuOYf8G2bWVcQa3MxYdUa1DxNP+iueOggQVwi34kpvgCKypiHu8Dum7z9EapHb5mYboXlH121TAM/OvXqP8mefvuq8NJovVtMeOHEC7bJYQ1qI+h1YYCMosmScP0mRVRhk5rx0RK6DUg3eglXCkBpb13D6Z2270ta0t4W4zrhWcAujMTZ3iIGsLxiZmmZxeWfjv8La/lB/LJkqdUgd9XPWT2BUMg== 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=3PiQca/rhXI4tmiaMBYojKL4cq8Esjj9EehlE5LYftI=; b=ShHVJcQUdo5hEgGtzeiZOHPXiio9bBlrBuGgnH9vMt3IHkdAgvfOROxthiETgp23EM+tGYMAomS8TW+2TWqJoMaFSD6u00OZYPRjW8cENF/vSejTGSmJis512Xa9EGEzyEz7CLIA0ewgq/YTXUUrZ5RokaE1ugd1zRxJ6bKC13E= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:40 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:40 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 01/13] dmaengine: fsl-edma: fix build error when arch is s390 Date: Tue, 20 Jun 2023 16:12:09 -0400 Message-Id: <20230620201221.2580428-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 14aa7b8b-497c-4a7a-142f-08db71cab2ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G0rX1QPs005Pxe6yUhUOSMc7ImXWB6QwoFkNO4aOzxNziu8G4I9tUMnaTZ1YB+iK36TXV7U/sMfyz53W+uIJi7VVOyS+uY3ltm/sEBOwhE9Z4KxuQ0IV6F8CCu6LCzJ8fm7snZ+CyVXsFokb/mqyaPUhvyZH4ZiJE0L7y6aUD+TAUQEqSb4FRdt/Ed1+oBF5yOGjN8AJmnAcqt4XjO1sdLTHXk0HEmYPmnDCWfhiCLxHwTbGk6bV7I3QQ/EdNUr7NRIE46km09KvSHz6vPQLtL/mbFlP5SpsK4IJ9k8riFvIWhK4NNllT6vQ1qFOmT9QU1AN764e2hzL/9NGw8VWESolm311WlVvb4f4FAIgkZksuIGcofqyXOtz6L06AwegopkZsCtX3Kqh4G46pAVn2rs74WDuUHuce2JKOmf58Bw21274o3RVbXEIaYoncfK/1S+bLd6vp1ruqmD+8iCqjb68zMFuGRbpm/F4T9J/dXUsLGazQ7mK4Cr8va35ioTdlrRPKUYhqOOXeFQXc48LxgjiM4Q5I6rs+z3rLjVKng+3nv06GYQSVHnp44NVHNYOhNCepiRYXRP3sVTdBPFeJoeqRzbbf+mDGHX3brxky91ngfUl4upgm/uowkM41/GK 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(4744005)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(966005)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FZj5hnw7Y6QuGEeW3Gwc5tONjarFdZpVzjuWe96r6522Kdu3y43Gic8O2Hn1RBowavKTpCMFSlDk09MznvanLYyn+g/Ysh2iF7Mnu7EuuxNM0nKo7Il5BujPgSmVlabl+o2ymlMxMGzX0F8e4g3l0p3DoXP9WTnPIJxZZCWvul7gupUHVoOa64JmqfkgwJFjShldgpzB1nD5W4vx1YFvp66CKPCx/xH7FrtIap4aMLb+wVOS5GBOdM9aefbEBQtJGTJYMOkLxOCgo2OSWt95hJHCnmz1hsimZCR95Bt0HWLWl1cCOyypI1zxLkQYS4y30gHgtmJqDd0YV8gAvK2q59UBamHhJDuHdHXnPFk0a6rZD+G3LJaFbTeVZotZjp4o75eblmMMVxkAJGXOeNKqAGwdEeA0bj/46jHvlZYZvDBL6/opK/AZs8u7OpJto3fFbgWzga/ShVU4en1xOKZ448fIWFC3zUpGbhE7UYvC8mxEWMlvOuNja7YgXB2wLQnwCWn6cOJLhEHqQBd+sgN7bVonMQsjh+mUMyG7z8kE5qKLoE4YGqHAkveySVIN4hs5L5nRRcHva9tkjIkctR1vZ2OVw8K7OpbYQmTWxf+AFig4bDzmMny3PZXZFLzuxe7kHQ7oHEF0taUdyHoTZn+burtIcunmNWIfKsIUFSMEwu79AyAYvwYJMH5yOgfO3Ng1OBoxHMS7NkIUu7jA0mIlzldpr42RQByysThNPrFLzDcwyCwW006gZ57GHjQIJ/JKkLEV1VtdyIBISXrsHTFuRukdIavf6Xh6G1zUad3rgEDQIEPwfaswBll/f4MF2GE1fu2z5nSdFgBWjeybTzV/DB0CRF3Dx0D04ltIqwhTR3MQ+psFgCIwbZTH9JMf5hVLuJFs9xCMMu3ar/bD1o94I1d2SiLbLZQAgfGNMleSFdv2mOEkgRgIhh7n47YRZTenMg0HB8/SPbJGtJ7xAeO6NjX9h6F5xQbqLo0/AT0XWVEj/sTBNItFEB3XWUGW9ZH3Iv8QR4uWZ2OMdVeWZa0/qqVH1p1ME4FLdW7c88Dl0UQDY+Oy9Nzk8F5JnKmjb4ReOhue9TPKGO4gMiwz+DgRwD5n7pyovL3nGL47Z6GTGnaT4i0vWIf0L6kyWHvLvHhHH+s76iq0oa2tBasAO/b/hgLONvb0XtwqKrXcMxIEmsIgJrwUeH82QM5cm+PBPBaSEQn4lVs7lkiOvE3pNr0CexaN9TdOES3wKAkjo4ZpMhhk0qVLhCFKbVtNJU4ZdjMvknD/i6HPjcx135tYDDH+Wb93b2A4DEqGd0f8mpNuVn4qh29EsBCE+9atR6lQ8xM4q+ItFxhp5hx+GpwvHP6Nwa26Z2IOx40dD/vYKN4fA/N3otJRSTKm2GmeFQXp7adBxwanbFQ3VyEINDYglosXgvBM4xelk5Lzrx3rKokoc3Fwi/gdMKAIi8qw3EKnTtULaZAdyb88+AVXOkGvXEllxqJ9ypxBGlbWu0/kKHe6gkKg5U10OanNTMpzIg4nr3hqXdnXWhuJVhsg1ZR8xqbCBP7daWbybRKdJ6f+goEaKf3nnut2xHuIz/LZB3gK0dy5 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14aa7b8b-497c-4a7a-142f-08db71cab2ab X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:40.1012 (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: GqNOE9QlAyE+NERVjc1DRPiG2vbOzHnDrOyo/Y/sV3wjErTwU7a6WlQHGJFobd+9Ni5SCYs6wMS/6J+SZYh7qw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254440098553336?= X-GMAIL-MSGID: =?utf-8?q?1769254440098553336?= fixed build error reported by kernel test robot. >> s390-linux-ld: fsl-edma-main.c:(.text+0xf4c): undefined reference to `devm_platform_ioremap_resource' s390-linux-ld: drivers/dma/idma64.o: in function `idma64_platform_probe': Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306210131.zaHVasxz-lkp@intel.com/ Signed-off-by: Frank Li --- drivers/dma/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 644c188d6a11..c1065c444cde 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -210,7 +210,7 @@ config FSL_DMA config FSL_EDMA tristate "Freescale eDMA engine support" - depends on OF + depends on ARCH_NXP select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help From patchwork Tue Jun 20 20:12:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110692 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3924928vqr; Tue, 20 Jun 2023 13:36:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58kgykE8hm/RYEpfbAbK1GCrZzRTo1W3HpD5nUmWU/cBMTa0/eljYGVuXzz9tbksi+WVjj X-Received: by 2002:a9d:6c5a:0:b0:6b5:8bd2:51 with SMTP id g26-20020a9d6c5a000000b006b58bd20051mr4090390otq.7.1687293417278; Tue, 20 Jun 2023 13:36:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687293417; cv=pass; d=google.com; s=arc-20160816; b=0lMcgGL5CHnDzFq/C5WKsHQ6IzjVeyiviZznbPVqzubspu78agwZisdzCndPkXUZsz zfOBIOpvjrR2n+Un2rnq3YFsQ+BA2q1AVxuQwF8y7ue2ompzn0W2cv+FQPmsGEiN/WUD VGkFie871HMBRQA/7bleLp2bJbyCJ6qbBsQ2N8Q0D3ueF3jgMVGUxRgMilO7rnBAoOcI TYH+4ZM7kBjn/b1d51V5gGLHYecaIVXfB/qjXh+Yh+pqZFh3Yw+ed3Ho23giszUucZ2Y U9b8E7J8H37XVyT84omX/3CBRsxlivSNCDH7NYY8tClUIJqrN6KQJWBJXccgcar2Uayp DotA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=RKzz/DKQcGPIpSzsnHktT8UhEcS2xeQdpWaKphJia7o=; b=fjqRYlXgNBNkoJng9pp8RKmOr8cK7K1i9oWcBOoTYXNon70ACUn2+OSZP6GigvhdsL 6nSzzVZo/HNn5Ka4WLirM1ZLLX5JVqIAmqYcfqGSA5Zvw+7Z02e32kDBF/mS6uuhrCyZ ZMqDhECXrTf+uz/VH9F7gBVZoE4CtNDA/VDMBh0BdY75Mc0Fz8FbYIdGhcd06syfQxZs BDiKiaJPp5qSUR9/c6FmNxlafQQQHOxrG8L0c5JKwXqxwh5+Cu0Q9U3oNl44s1DafE1R Z/748m2RpcdsWocR8CQKgvRItHK5aFNYKFU8Di3X4m/Ky0Dqh6Vt2rCHaBW2xBt6iopg Mc4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gQ4BIl6J; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a637111000000b005504f5316bbsi2549123pgc.614.2023.06.20.13.36.32; Tue, 20 Jun 2023 13:36:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gQ4BIl6J; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbjFTUNA (ORCPT + 99 others); Tue, 20 Jun 2023 16:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229987AbjFTUMr (ORCPT ); Tue, 20 Jun 2023 16:12:47 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2063.outbound.protection.outlook.com [40.107.6.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B2310F0; Tue, 20 Jun 2023 13:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NI3L6EvQGXiEjSol/nAWLvTawgbEPq3xdy0XXxZ6uqvwzRCibFqq2KoDsh8xOe47rRuFVnBW1Vv7fm0j4P36Sx5TxtVl0KkTuUBGGHkxlLYgAmARFQ7D4Kg1H2kRrUARd4itQ8zUBfWgPUIzDyJ7Odftf4UYH3KCqfmukzyW5febkvTO6abqvB5DBFhJc7FDTw+x9UmarQrG+Z6HzUwpfjGSFtJnU/tnQNKQTN7YvDSAFktroB354gQ8mlMqHrGci44FShsLhNHPZjynO4sZlBRCeIUqiwd6Jk+IREZFRHrMIfw+smcW1xbR5gaGygXlm5knwz8ElUbwH04E33UtZg== 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=RKzz/DKQcGPIpSzsnHktT8UhEcS2xeQdpWaKphJia7o=; b=k557igwHHdp/9zDY7B2yzoUpk4Z1XQdHNrl0jAls2gNnBmAQUkmK5hbmLP2JPsPacjKLUn3+t5TSIy+6uJ/H89+zRtxFbhZm6e/hsXskb+q+/sOMSUYR1FAfIosdAMGaBLCSPTW48QS/u5rQ/xBVeA5ibQthdXWxE50Ru5xb1NFb4JKJETBUXva6XyXcTHJlzXl40Cxsrn+e9ALYSKMPLWPhrNeY8Yc4ZMofIOly+xYbtgybVDA5vTCudB7M40HlAyYwwu6be1vChJFJzdIE9zOIXHoYB4IUfRBVVSwYoqgZVwa0OzhONOTZTtYat6MLGT+RZUKNzrjh4sdUhV/xcg== 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=RKzz/DKQcGPIpSzsnHktT8UhEcS2xeQdpWaKphJia7o=; b=gQ4BIl6JR4VQ+DysI3nAauAiqznbEuMRHDMqtC/SASzL76oeAu0UL4FjiQOY8J1Ez1UZDLE+Zy5V2WGUoZ4H8Ylbhko1UNB0oasjtLkSF4jEyxrsB4C+f9Ts7EC6aKnmBTd8DP+xXN/wuipPbVS4XdUWWkfpoUP2HVc1WsTbYpw= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:43 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:42 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 02/13] dmaengine: fsl-edma: clean up EXPORT_SYMBOL_GPL in fsl-edma-common.c Date: Tue, 20 Jun 2023 16:12:10 -0400 Message-Id: <20230620201221.2580428-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: fdcf4cd6-3de7-4a55-4580-08db71cab46b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8NCM3HTLSb40DQWK8Bigh4SbjN4zUvkUxYXS7lDwXVMh1VRs5k67ofk7RkwZ/OQRM6Dw7q7D8b0QfYS7CxniCTGatbERoCtoROEzaJ6BY+CQVF1aHr6IwiLLpgVqR8wrCMlLhLMDJPdQ4RU5Dzzk0H3dKvjDPWjsgxnrKGAByKRKH/m+dpemxLADTaNhEYikKMvhCv/xqbqs2zcDNsn8GtZ1ZrGN9KeSC6Pqhr/OWuGPhxiAmSo5GoiWfr6+X9obj20BrtayI4cIyLDePqeErUxBYw2us5jXzF4aZ6vArDpEtCzBfdqZnZG2KPJXw52iPmaeW8haoAdKf6067obJYHQ9CHA8Zbhpw3V11ZmhziFW61RGKxJhaWKoy76SMZFq4s8r7gb2MRzUU/t8UUFHHdEqo2XSGEdVOeUeL+VjBzrEHqM+3dyq0b0y+I3h/H0UykupBaPHY5osnbIhSO1DV+FD0rwFD3PtKWVtJjxQTvOeSKwrvAaW8SJ5DVBUf/tMhKZmr3ske66cSH3xP6UONH25EGCN8ZIzQBVNU848Nm/wXpMvcElVyo+NKPhNNXxXkPQk2Cwte15tOjZHHHk0Y4a35hXVGDlGElEiFhBrxK1a3sRxpWbmf93tx6S95GiTRSRyK+1SYzQy7IlakMIJ4g== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mLC9bKKFvxG54CSVwA5mrJhR90fMA39rvzVkmzZllhUpzJB09ugmLxdTAvyKcklwdoatc1RuuIsn4uJU/0rZojVzqa/lKyLVcO+yzBxA7WmqloiKtibYqK1n87BjERTOs/hHWCXr5gHjQacMPsQX4oKmqZQDDWncGLD54C14UV+XJYHEDYXbTIvr6VwORRqz7tdRwLOHEOASlbedrU3+OAhiZjHt833bBuBFygjgRFjyxXxrwMD5j064JqrDbP7dorXF8Y+rC2oCUjTqLvsxZ7zL4DjHEGN6HJMpzyXHoezwsh4QnDe7WN/IgRv+FgToFqqS1oMlMEE5XZEBZgedB/iRANXnRrM1sd43vZ9wyGLKbJvVwcSmKRkanXPWwOgWSQlCTgy9wyjqo7TUyp3XhGidw2VxXNIZWZqNzDXehRYBi9WW8jP2GwNRB3AXKyMsVe9mg0GDyRn3oThG1dkGMJiWQ8o7thyFL4dd8H5KtK8KtApHAn7hnYYjuzf/8ug7BVZY2h/uxSLiHo3evJkPit/q6yks3a5rqs9+3nRWMY9/z3F4EdXn5CKh0MOUqr1LmIw45lVkPey/CfN4aHw99jwrEye0WnOx3t7qst7jjnYo3L20gnW9FdEWj4w7tdMRVZjD5UGXV6gp/WeorTFvpX+LB43GO5A1O2nsWC/lbpL+DPwVlh9LlYn9E0OaMoEGpp5CaMjdD0pWuykLIOH7HIiUUjtWFAcPeAsXbDJD8tiwX8YkgoKeNpJYvh/AHw5tVYCkjSYvP0Jx1sS4FNo9FdRbpawsfiIX8PM795UgDhDbTDNxw0XuGDVq9JTnan7+ckHR3SbsC4Q29t04dg7To7A5FaUEO1LnCXEUsgqpDdEKqujJR52i5ojzyu0sGjg4UI/BLBrBWfTSFywlnZdtYQLl9eUuiDPpbjTvZO+fgEd+VqETY3JBcmb8qhAU+gxky6vv6MEfJFufLzdTHeVt8cP6vT8rWh+YBRMVdviHYWSpPpnm85uh6rJuGOR19BgzSgMPKp4tUDZJEVmQVRObzPcjxR1euTfDRlyFI05X8DzTKQD9QTVOS6vinMJ1dQN1FtE0P+LB9QWvMGDViIxjBFtUcG6wGFUiTwtUDAaK6j1NL6x6Dk0M0qhQvHEoDvoq/rupOr3pS/DMTghYTXwCmj0oyVpJT0KgrN4cFo8iZmnKtAsh/9InnyWmDcqAMPDC3wTsXGbLnJUnGK22r7SQuzVC+frg7yPFjE+F3xS7iy6MueEs77mcq9lxU8K7WplEKjLYStNAwzSrTrU5nqtjZMNcVN5/XkmLQe4CRsH3ZV0aQL0x1zXXVUhCdl5ApSxt1JAoz3uRg5Stg7rgMoAL43gYpO1Oq92bT4tRbTwejI6s794ELBscGSMbvKlBJiVXmHMKxyPeOuuPVkEgh5/d73LfL1HSsRkGqOnzZ1N9lC+cnBYreOPsGRw2Zew7871H6GSvlxg1XXwgmsfb0WUib6HsMlYjGFHwVJNQx6euQZ6H5bDUn1AesUxD+4r9CI0I6llMvN0pCrkU01l4/MN/dfTzr6rKGEFa1thmsKcpTwW6qPSVfVrGWrcCxPun8kE1 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdcf4cd6-3de7-4a55-4580-08db71cab46b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:42.9448 (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: 79Ybu512vM4oMp/NMIBn0EBTVLE6KtlT69mII8oGDVB2/r4F8nutfADvc4DL5qcNoC1jzVFGO4M2fTIiVMzXZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769255382220482902?= X-GMAIL-MSGID: =?utf-8?q?1769255382220482902?= Exported functions in fsl-edma-common.c are only used within fsl-edma.c and mcf-edma.c. Global export is unnecessary. This commit removes all EXPORT_SYMBOL_GPL in fsl-edma-common.c, and renames fsl-edma.c and mcf-edma.c to maintain the same final module names as before, thereby simplifying the codebase. Signed-off-by: Frank Li Reviewed-by: Peng Fan --- drivers/dma/Makefile | 6 ++++-- drivers/dma/fsl-edma-common.c | 18 ------------------ drivers/dma/{fsl-edma.c => fsl-edma-main.c} | 0 drivers/dma/{mcf-edma.c => mcf-edma-main.c} | 0 4 files changed, 4 insertions(+), 20 deletions(-) rename drivers/dma/{fsl-edma.c => fsl-edma-main.c} (100%) rename drivers/dma/{mcf-edma.c => mcf-edma-main.c} (100%) diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index a4fd1ce29510..7f3d62c9dee2 100644 --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -32,8 +32,10 @@ obj-$(CONFIG_DW_DMAC_CORE) += dw/ obj-$(CONFIG_DW_EDMA) += dw-edma/ obj-$(CONFIG_EP93XX_DMA) += ep93xx_dma.o obj-$(CONFIG_FSL_DMA) += fsldma.o -obj-$(CONFIG_FSL_EDMA) += fsl-edma.o fsl-edma-common.o -obj-$(CONFIG_MCF_EDMA) += mcf-edma.o fsl-edma-common.o +fsl-edma-objs := fsl-edma-main.o fsl-edma-common.o +obj-$(CONFIG_FSL_EDMA) += fsl-edma.o +mcf-edma-objs := mcf-edma-main.o fsl-edma-common.o +obj-$(CONFIG_MCF_EDMA) += mcf-edma.o obj-$(CONFIG_FSL_QDMA) += fsl-qdma.o obj-$(CONFIG_FSL_RAID) += fsl_raid.o obj-$(CONFIG_HISI_DMA) += hisi_dma.o diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index a06a1575a2a5..ce8d7c9eaf77 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -75,7 +75,6 @@ void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) iowrite8(EDMA_CEEI_CEEI(ch), regs->ceei); } } -EXPORT_SYMBOL_GPL(fsl_edma_disable_request); static void mux_configure8(struct fsl_edma_chan *fsl_chan, void __iomem *addr, u32 off, u32 slot, bool enable) @@ -126,7 +125,6 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, else mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable); } -EXPORT_SYMBOL_GPL(fsl_edma_chan_mux); static unsigned int fsl_edma_get_tcd_attr(enum dma_slave_buswidth addr_width) { @@ -155,7 +153,6 @@ void fsl_edma_free_desc(struct virt_dma_desc *vdesc) fsl_desc->tcd[i].ptcd); kfree(fsl_desc); } -EXPORT_SYMBOL_GPL(fsl_edma_free_desc); int fsl_edma_terminate_all(struct dma_chan *chan) { @@ -172,7 +169,6 @@ int fsl_edma_terminate_all(struct dma_chan *chan) vchan_dma_desc_free_list(&fsl_chan->vchan, &head); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_terminate_all); int fsl_edma_pause(struct dma_chan *chan) { @@ -188,7 +184,6 @@ int fsl_edma_pause(struct dma_chan *chan) spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_pause); int fsl_edma_resume(struct dma_chan *chan) { @@ -204,7 +199,6 @@ int fsl_edma_resume(struct dma_chan *chan) spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_resume); static void fsl_edma_unprep_slave_dma(struct fsl_edma_chan *fsl_chan) { @@ -265,7 +259,6 @@ int fsl_edma_slave_config(struct dma_chan *chan, return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_slave_config); static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, struct virt_dma_desc *vdesc, bool in_progress) @@ -340,7 +333,6 @@ enum dma_status fsl_edma_tx_status(struct dma_chan *chan, return fsl_chan->status; } -EXPORT_SYMBOL_GPL(fsl_edma_tx_status); static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, struct fsl_edma_hw_tcd *tcd) @@ -520,7 +512,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_prep_dma_cyclic); struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( struct dma_chan *chan, struct scatterlist *sgl, @@ -589,7 +580,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_prep_slave_sg); struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, dma_addr_t dma_dst, dma_addr_t dma_src, @@ -612,7 +602,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_prep_memcpy); void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) { @@ -629,7 +618,6 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) fsl_chan->status = DMA_IN_PROGRESS; fsl_chan->idle = false; } -EXPORT_SYMBOL_GPL(fsl_edma_xfer_desc); void fsl_edma_issue_pending(struct dma_chan *chan) { @@ -649,7 +637,6 @@ void fsl_edma_issue_pending(struct dma_chan *chan) spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_issue_pending); int fsl_edma_alloc_chan_resources(struct dma_chan *chan) { @@ -660,7 +647,6 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan) 32, 0); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_alloc_chan_resources); void fsl_edma_free_chan_resources(struct dma_chan *chan) { @@ -683,7 +669,6 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan) fsl_chan->tcd_pool = NULL; fsl_chan->is_sw = false; } -EXPORT_SYMBOL_GPL(fsl_edma_free_chan_resources); void fsl_edma_cleanup_vchan(struct dma_device *dmadev) { @@ -695,7 +680,6 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev) tasklet_kill(&chan->vchan.task); } } -EXPORT_SYMBOL_GPL(fsl_edma_cleanup_vchan); /* * On the 32 channels Vybrid/mpc577x edma version (here called "v1"), @@ -743,6 +727,4 @@ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) edma->regs.tcd = edma->membase + EDMA_TCD; } -EXPORT_SYMBOL_GPL(fsl_edma_setup_regs); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma-main.c similarity index 100% rename from drivers/dma/fsl-edma.c rename to drivers/dma/fsl-edma-main.c diff --git a/drivers/dma/mcf-edma.c b/drivers/dma/mcf-edma-main.c similarity index 100% rename from drivers/dma/mcf-edma.c rename to drivers/dma/mcf-edma-main.c From patchwork Tue Jun 20 20:12:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110691 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3924252vqr; Tue, 20 Jun 2023 13:35:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hdcE++hdmjvCFPm3ZLf3pDBMm8JBx/Gnzkj6Kt/yT2KMtnoM4EekkJk9/Otof3+Lr0MXB X-Received: by 2002:a05:6a20:3241:b0:116:d935:f742 with SMTP id hm1-20020a056a20324100b00116d935f742mr12821047pzc.20.1687293332693; Tue, 20 Jun 2023 13:35:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687293332; cv=pass; d=google.com; s=arc-20160816; b=JffgEREdRJGw0WjfVVgiOdo7k54ZG+tOJlBaM+mKm6+2g4/cJQ4Wl2oVA0rZcpPkpy 3l6We7TJ4+SxXqbRijuBV78/wPwdeZtSdMJAghshHypL63w9Mqj3t/AaFSFELteip2GC mB09gS004bHcP3GxcbVtfZBESI8ljxXR7Nv5wdVUdmfW8rDeSLebgoYfM5rR9Z4jvTgS WWJ5yTxCHyeSlv41/7AQJtP6UhOH/a01SCDVnaiGxHei5Gt0VksI3uPI1q7YJyFJ/Fg+ sxxVs9OjzUgLwi8XB3/G6zZHLSEc88L3zuft6qy5+rjjGiLzI8e1xh2XDwVbJaCdqvCX rK9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=QI8n0XPwXsaaH6UZQG+Zvq7pxrcY++lIzGOz4LgaYtE=; b=p+yhA0Yo0XKoOhRtHNjj2JFE8c2WBm6lJaTojZ+I+tJRIZAt0btNsC0SeOjd3SaANV bBDSmm7jtCEcBIeTSdf92Jt9am+3cmsFJK6dlfFqkqDccBKzy33gJtsiziRZSxmja4F6 AA1vn/rRKEhUR3PST/aCu1BPuDVkchjzess/Qtl9YwNKqtVYpaeg7/bIW2HVrJ+a85XF 7AsbS/uFGK73zKsUTpxRMroBT2K929PM9OTHcViNkMbJ2ky/88cZOioaZgQ3E9uMBdn1 QScJEVMBxt9zyT87kLVsVU9JEH+ho5dkBkdOyX1EUIh/fG2p+ar+SiJjci95ENv7CCxp YaWg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gEdhM43X; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y63-20020a638a42000000b00542b188b326si2360486pgd.876.2023.06.20.13.35.19; Tue, 20 Jun 2023 13:35:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gEdhM43X; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbjFTUND (ORCPT + 99 others); Tue, 20 Jun 2023 16:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjFTUMu (ORCPT ); Tue, 20 Jun 2023 16:12:50 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F001728; Tue, 20 Jun 2023 13:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dkSRnZnW14J30Vc3ugyJLPTHqljCce/qfnpJdGLwBoiM109pt2RW9UNNTVAAAP/stQx3cDuYPUgbJ1vhK+hx8K6LXOFcNhm5BsbJRxYc4td8il2cnsVQ0BmWiQ9ulVra5nE/Qi+o7LoezFz7qIUbVY7Bw06NjeQyw6bLlS9VIhhYSLNcGjMb5hek3KrPAVDWXgIQltCbzHc+gSJSbf0rhhIghLw5z8wC1WQZDreeNucPB4AE6XI4vcNMw2+IQ571Tjh7BL+FG9Ev19ltLEASp9Y+xR8x/2u1ffzTHGMV0oou0S/IkQsQAvwmP1WfjFLUCKpw/LJo4Vih1JpKHcQfrA== 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=QI8n0XPwXsaaH6UZQG+Zvq7pxrcY++lIzGOz4LgaYtE=; b=KRelEUIE+PzuzANgVEZUyCW10xJ/SB893ob0Cd9fdLzCT++DQrKXw2zoeV5G6GwoTGNbacmdhuDxK5qI4BUsfv7udnRRjp0KHGE4ra3lonLQWc1JoPlCk7fh+g5tLmausUXPQ+ivHbUIvECPnG1/tvEWdhovipIUv0mSsFqq09+hqoaGqaMpIY9mJjwe6ynELb6i9e0W8hmjjLVkPq2G/b6uey0ivWdJxtyg5fC+F1+ZOPh7Re3lbJ8qw3hPYFIBHVdr54yRZN4OY8mnqnZYf4jnya8qvHXP71HMHeTXHMrFzJcucHnV0/L6W629b6D3j+zioW8hCqq7ilR/FNynfg== 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=QI8n0XPwXsaaH6UZQG+Zvq7pxrcY++lIzGOz4LgaYtE=; b=gEdhM43XWUua0sHQsgGwua9MakxmThjBZZfgLbJoeqcqEop6TP7p6NwXZKBgDiu92nKRxB8aBFVl1OOtxIUkIn5HO1HTZLh8KZklE4vL/e7hfIjfUF+owiv/wBoepTr6RB9qK1dC2T0muvQkHcV4B2ooTNwgs+Mut5unHZ/gbiY= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:45 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:45 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 03/13] dmaengine: fsl-edma: clean up fsl_edma_irq_exit() Date: Tue, 20 Jun 2023 16:12:11 -0400 Message-Id: <20230620201221.2580428-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 46027cf8-060f-4c5a-b22a-08db71cab626 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gp+ttxQT7vjRgM7LSFlpsxScnooCIra+bYVo9WknjuRoaqS9ujqr6nskwNATjc2ImsZtRb+P96zmf1E/8socbNwhbe+6HtXR+JU/C+d7zjq5FZaSwdzy+eH29fLjEWjpBhvpO+sRxVmKrf+t7TM44vowO2d3mULrWoVEFVf49OycLn7ckFQwtCWkjFwVbplU0EUUnbiyolPSEErWR0BJmZEPvD0UJWcjVuk6elcUsY63IwDSqPA4DctjyfR+azpUEbe629E/n1RraBV3ebG5QvZ4KYtkNy4umVTncSJ3tMrN830cMeYqTLoln7y+SNdTkD3TD3EzF+1ZapGa9lBuDGYA1L0spi21pnfraWP+CI+0REhw+MZZb4QO6iWpxw7Yzq36A0IcRrpaQABuNBcbnLt8RiQ+U5e8v8O7Zr2Wwd5n/AmLzq0vTtUALVsTX8ZoqDinXx0NG1bx0NlvN2shE0re3CWNT3+WNA5hoPy2QHzqYFYibZEOfH4RtKoK4u57Ts5+ysp6Mc52yN3/pLTeI5VJe5OZhEo+3Sf5nHs4k9/JBBy6mgFiMN5xadWwYE9Q1mKnH7zlTv88wPP4/6mf/RHmA7jDOXGkpx/tY9Zst9hO7O9qEAfj7vp8oF3xoVw5i4SI6INFeIWtPoTYK+2VqA== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6boJ1Z38BV27ugACHumHqICt7/Ah43SJogu+iGbvrc/blcl4PSO8kpZyG8XdqhL3pR1RmMVMiBA4jy+3CLrp1Z81wVXHOplmqdfYN4fH6UgaTdxcFH8Z44dfieNlQvpBWXLmIHBQk2Vj8MA3ThnAhPdYlPtCI1h5UTjEE70TYiYS+xFRS63qhmpCVZcjjtSX+mmxW6RilQ+m6jgU+oIzeCVh6V/JCxsIQZ0DilMpzTXleijcNG55KvrevECHoIoVwjwvqAXcB29pIyhv+8kq5LqTsCdTqIN1Zni3X6qXYQ/fK7ReAt2luXRrCPIUJXredN9Xak4nGKiXlIuZ8SHQ31xjpxZfqEuWpsacU1QJBi3auD+vKPr/pEbaWAwyM8aeGUyGZnojy0akC2YtpuauAAec7rj9dV5TmjYlphgD2yLS1lb5cCJoJVnf9oPD0WiKtPxwsAJPJwFSRP6HlonIeDLELbYiw5w2l0EEzLhQGcIQSm4qeCzIAgz1F9SHp3DiGVmm0KRpMFYv+aD/0hVI/+kk2YkmKzID67XNe+pUp9MNe8f2MTLSkOv36xPhbqqfpSvN2DgWXl9s7vDz+J05rUWdYviouxnP1cv8KfOiQ11BvM+tn/FgQsk+Sg12v4AHeZ9in2DflC7Gg0/6b/TBye5OU1wwHaIb38812+J9gMeYSzdKrf5OUd4TR5UdPxN2eyIXGE+2E8mgrEd056rJU1HW9mouj2toP6fDxR/xbJZdri9tvJDU/eQeI7lPwbp7y8N1mEQO2gX8wFVP64pzQggJYF75Rn4eKOO/z9HL/dxW1ZB61OBzrkUi/eZJ7012baamW0SEV57iZ9Yv+xeORVD7l6xmvBwh5cR0e2TRwKkS0YGIM6Aayamtrn3M2FoypslYB85s/+t3QE47f1fG3GBktp9la6KE98KAIOWLuE16+N1B5sMlNb5IPz4yyKWI/o4qxHkyzc+M439Q4IxbFWVqCQpzCNW0HGXs+4TtnkF/hYhRonMzdRglHpcUVtAacSymg6EqQkM6jP9gJVnSRYFb9kXmW7PJ+LfjJk4Vedma5hrFrIZ4uw6XUbhbbIr1Z8CMwAkOwzSkN8+tNnfr9w3HbzwPyr8uhpSl77IsA86QjrwHpnV9yjXenzZavF2JVNW+Mc5wDCPQxRPVRuqfjzL2ddSE6HksBs2lrUTQdl4koSHSo+BTV0F4MjAo5IdqxHlijlheO7x/WLBxNcHNGeAziWnBW1VrGoBSUBykgJ0WaultUpxH0/xSLw7seHyxm6PAAXja5/WcSCks46bvYoMxekuXg3R+cWuXN0fFLT8KeL4Q0i6K5x4VrBF5AycT0JMRQJlbK3SXXJQGjlO7OJs0Hwom+Z0Oy3rgUTu3U6CZUylHmKHDVw+gUkFseL+o/AQFjYXTF53uJ8cixnaceIHNUVEE42LO9AAzQgA0/89aB+iDoNiM75BDtlNadd4FQjHGcrQEBntuIR6bk7YxO7ieTBzplTX/Cpimx9olW0oviIC95DE1eAV15EEr+ig4TMA7HTDlRIBmMNUpOd9Hw3Qpp9Ydupb0WQpFxmxwiuciDd+Sg4vLVE2agHly60w5 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46027cf8-060f-4c5a-b22a-08db71cab626 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:45.7839 (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: uaVPJbTCu0FXqJZoPz106TEX/YQqC2da9rKSU6s7gYGj+BuifqzgUIiGEBUdVr75nTs47l73EnC36gHmPcFeVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769255293861618779?= X-GMAIL-MSGID: =?utf-8?q?1769255293861618779?= In the probe function, devm_request_irq is now being used to automatically manage IRQ. It eliminates the need for manual IRQ freeing during removal. Signed-off-by: Frank Li Reviewed-by: Peng Fan --- drivers/dma/fsl-edma-main.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index e40769666e39..16305bb9a2ef 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -216,17 +216,6 @@ fsl_edma2_irq_init(struct platform_device *pdev, return 0; } -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); - } else { - devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); - devm_free_irq(&pdev->dev, fsl_edma->errirq, fsl_edma); - } -} - static void fsl_disable_clocks(struct fsl_edma_engine *fsl_edma, int nr_clocks) { int i; @@ -427,7 +416,6 @@ static int fsl_edma_remove(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; 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); From patchwork Tue Jun 20 20:12:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110674 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3915146vqr; Tue, 20 Jun 2023 13:15:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7gjfARZgwgdiN7GkkqGdMyi+y6ClNSFMoEXzgVeAJTUIzzLDlCUybNWU5T/G7a/FgVdpNM X-Received: by 2002:a05:6a20:8e19:b0:11f:7aa:1b27 with SMTP id y25-20020a056a208e1900b0011f07aa1b27mr9152242pzj.51.1687292150665; Tue, 20 Jun 2023 13:15:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292150; cv=pass; d=google.com; s=arc-20160816; b=J0lNz5CMJV6YnP81SVbeoF6zshc5QIsR7GH4qBcDWK6G80KycZVjF4M/H9OCiPjbwZ yHl4CwAFwXyMkdWae67uJZ+twGzuK2btSurCfPX4qZFoatfZy+6W9rNLwXSdjMA51ZEI va1UrzPNjhQlOokp31+FFMVtxh46SHww8o8bUfQcjt7A0VPqeVWl/ufwdCbV3fYGJLJn ftIH4HQZujarc+VicVGsHBpUQ0Br+otH01zzQi1kjcLLwLcxjpUtheT8BXWp+7YceQUe fo3K+8QU7Q6UZAKcUXLMegnRqAi2MtNDu3hQ0ygV2cvXOgNRQfMf+5KIPFABzOgi6X2O gjTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=w5Juf3kOYMDDqoTfA5YQdmkMKOm31LEp8hl7IUV/jfw=; b=F33nXSFr8KBZkr0qHmtPv2/JcabMZ6KcJkaF+lyLRNnMpCD9mYqkNwTW43fpbrjB3D oWQFtEp3uXJl1pnZ44KTzeU7c0s5xGMaKS/Fozfi1GdRYLU7nMEIe5+ljULRhiJZo9Ly Vt5LDhrBtVmRsI2XJlmlOyZiWG/gWJLsW/KHyTsAADudl5hN7hFqQJL3qhRvDdZUJqPv YYKCkEqlXRFp68ctaoxaH+PubYUyhxLqJxbPf4z+1AeekTmPt1lmovPSrL/S+5z9G6UQ rhKi6PgFRits678mZw3RuP3VpxEBlQU2bvq07QA/ckM047hyV80kWMAXrkmDzg0LMmsR /CjA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=YA0Zv42p; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y23-20020aa79437000000b0065dfb27ee3fsi2390191pfo.246.2023.06.20.13.15.36; Tue, 20 Jun 2023 13:15:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=YA0Zv42p; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbjFTUNG (ORCPT + 99 others); Tue, 20 Jun 2023 16:13:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbjFTUM4 (ORCPT ); Tue, 20 Jun 2023 16:12:56 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9F031987; Tue, 20 Jun 2023 13:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oW7+9Q34irE0BsisNVnNxb438j0kmAL9xk9uu6rh6jFCj41/JsbTia2N49CoJNAFxy70lPFOr6cAQAU6Thj4wgWV72waQFxSCNBiv0bmPPj4hEYnfpFnyFB7o4mewY95SMSFkGyav78V7GivBhGbI227vbkoebjbxOtxXJG0MnEN/BBetfrR8Ob/3/KDDl6st6uPP0MpulVpLqQ8lcxxYUmagI6fQhb7ilr0qKnmtu30cvgg1g2oVwTL7l7oILRH9W+yMc7VMBRD31J2QtsVyYanwfHFIqW9pkHdaLcnefg0YbiveqWh2CEfcfJMRh0NkrXDU82s1hGd21k8v9n3jg== 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=w5Juf3kOYMDDqoTfA5YQdmkMKOm31LEp8hl7IUV/jfw=; b=Cv34LkGhRRi4Zv4Lu9KkGe/4YeCuF+kvyXSo1tX2Plml5NJy1Y9TRTzGukZ/XsTVECkf3rymfut3GTbUZgkVFItWR6xl6lExbMwYzMmzcB6wctaIg+zNkHbAK67fLSnQHSncSRzAvNRHnRuiXdxN5cyo6VAOTRdgiEV4aMVUZMMXpx3BO6s+jWH9rBYB7DEyBdWAZBAb0US7O8ldRsR77CAZnQdIxmHGkFRgqqn6sc/TXp+LbNkawK8Pa104gWpboeT25kKiOWoiqfMfRwqSC9RmAq+GIYJSHOjfuaK7tZrSaD5y+pL0Vo3mX0cOiAfMVUVDC+WPYfM6xi8xud/9PQ== 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=w5Juf3kOYMDDqoTfA5YQdmkMKOm31LEp8hl7IUV/jfw=; b=YA0Zv42pMo9jl1+JBE9Pvnzxh0MHk47pR1rWYjdRy5Mxd3RgGgktUGDUPIV7Luzv/GPqAM5PoPxwq9h3FlEQKYCzXyq0PYnXzbmucbxSd80cxNn3qGl2PxLbRL12uiabl3Rykrhvp8zUVFc06HhmdAEA+V1Vrv2m8AMylisnj2w= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:48 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:48 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 04/13] dmaengine: fsl-edma: transition from bool fields to bitmask flags in drvdata Date: Tue, 20 Jun 2023 16:12:12 -0400 Message-Id: <20230620201221.2580428-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 60745534-d4e0-4ea9-8345-08db71cab7c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KPvIjusApt+nrqa6C7nbqgEJvccRVX4tKAzTNlF1DhRHW/mo9tAd6RTFPYFtVoPSwuynxBY+f5WmcTyG2A4lvufDq/hhYQG0Y50SecqaN587VRL/E/YRHGLTnYJw1w0MD3fZAp40tmkAJcryQzxlKwJ49Ru/gcAUynT4DeRPLe/7y6YEJYgaQICClh4SJDaTXRILSBDZxTI5YqdI6f6oXn+cUIriUHjS3PBVRtSKTU0zKUNg86uDJbyRhwqCJhRjh6tlD+kyCcz2Nzp7ShjzG5/hRzpfBgrtck2KVA06DJIyWV3MXMZADkE9Sk6X43jtA1bhdTMd6JqpDde8mSlB6GFj2CK9mH9uyxjegX3qISQUmWNxUZDIu1Ayyg44YzlxJwL4+EW4NLFi0/6C2N+/8+ta50YZA5RnKDf8fZQbqfFe0XzmDTmyKkUObECdfRUFsW3cIoqdwrrIoYgXgQAMua7zQrfHYAgDkp3r0MgGSL/Zi0y7s5lmPiMA864OExBn01R1Kz87AhnFLsGaltsQiOiU3b4pMZrkIhaVp8JwBEbwJNVOKZTYX0gh7IMYRvMVtT8hEoepzlhksC7kcx1AsclY2qv1pa/JeQ6XZoufbvAilrde7veNHrxpaNF7kegAZvlP657iBQp5iOlLzUSzlw== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UXcSrbKntIEAG8jtCmrV3O8BpEUw11hvgJipgw7wAgYXYo7/dcix9+su2UVfaZkCA/LY6jGKIvN45fT5EFAWy63Y/tpJ4NGUWR7rg1QMhX5w08mpXCv4WhvbSPXo/PCsrf2a6bryZ1cOg6m1fBfHbdJImz0XK8cr5NgxvJw/fzz7vncSZ+IFOuPtRB7jFFqceylcXfUT6hedZxDXj9xe58OskWyN/TcD1cOP3if++fAiLSVLu2BFJietEmVykxl8duLsMhilLahc6tDO0206LXonFMnR/Y4zdI+e91LP/Y1S3rcidnojT05BoGStaI+emm9gi0qMWSF7RGiqq1p1FUNhRGRz5pApnz18+sV9f6DRk1b3Aho2UR9wEq9ySvM6PN7nFejCje7+vxoWZohEm+dL79QfPIZy9whO1gwZjsF0Fjc0cZrqVqaWGKI7tXH7h7Enoh+h6ENu+dlFZiPa+xzjikBQiGaai6ozZ8NIURUtUypXFALWHH21Z6f7A0S4SopDX+2mqFbly0L8vCppQ8IkHIKqxsGs9+Rvn81ub2I5DFE5z6ULt+xys9sOsjVp7Zbf2waJA9dDeshqN00X4d28kPwl7c3iWexxtslDLoRgozJ4Ytjj49Gco0sZ7KPGjyYQLEqOOqt04U1hZt4Pvbyf02cZ5rKE2sFhmU6ey5k16Yd5Oj/Tkp/FNuczSywBy+vfkEYfI9mslWTtlOnIAbWGXh6I4dz3TY/wJkp8qK5w/aS9YwbAXe0a+9Pnh1oFXYju0bBMjKXxE8zve+rVMehni6yycIDEZnAMLKwxGepPvFhajY5mVSFZqOZmSVPpVOQ6L6XGyVlayCzcJkF1SzoHMda1uPN8/CBoFJWDCrI8/l4paclFeL15X9lJkmdJUNtTEVqgmecX7/HF0QAaWKcwoLPkFHDjnLAKEaGr19HBvUSxIRJBBEDqFTJYs4FKuH60aqIn1lEMfgKVyAbDRmrdz0uyLvYw3hegvDg5FvUGYFbjS1WBrzUmS8b6wtK0SuPJj2l4MkmOPJNvAg5q4bKZlpjoVl3cuPyI9vRbP4uiaA68H8lifhB9+1kYARm/8F9HM15aTEBSyqhfmC9qMq/rey1DptQhOITSl2Gjn7lIlZ/4vL0+cbQHIE0NlbeDy17WWLFVDg8gzUqmCOgDxQ4ksdY7ud8LfPWzB22JVLkSjn/yem7v7K75Fk+4INn4SQpm2JidOAxUMmz9LyH6ssNFqfAxStFOnYD2xGrpPyW5Fu74SHMRGymOjppTEHBTwXBjXIVomW0fx4FPAoL4oWK1vzUV54JfndD2FtbtQMxRvKtKfvcGrB4Hbp/9pvR/HFMZsqxKkrxEeOnoxedvZbjnGbQUA2AQfK1iHrSnCP+SoLhxw/An0nhbCrmwo62IYy0zV8UrMoQK/tstzJ25BBrmIFBarqfyWEiVT07aopXwGwa/Fgmq/28j/CPFZQnezh4s3dhfB2uMLmMlM9UdJG846TXauBol+NtSn1INlVdXPI754bDWmEo9SnzTWSRKDiSqOTjOax6PfZgBTLqafeTZ0dIabxTMgQbA/+M7B4/29iIC6TjWuv9YZ2VVkBK9 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60745534-d4e0-4ea9-8345-08db71cab7c5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:48.5008 (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: AQ4FLdc/vRoC4UvqwS1n6VbKF+VmV0pRAExYFBQmypDc5VmbT3zb7jlM+S1Qndmff3ZktDfDTd+ux7KSmiJN4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254054194131072?= X-GMAIL-MSGID: =?utf-8?q?1769254054194131072?= Replace individual bool fields with bitmask flags within drvdata. This will facilitate future extensions, making it easier to add more flags to accommodate new versions of the edma IP. Signed-off-by: Frank Li Reviewed-by: Peng Fan --- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-edma-common.h | 5 +++-- drivers/dma/fsl-edma-main.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index ce8d7c9eaf77..10dcc1435d37 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -114,7 +114,7 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, chans_per_mux = fsl_chan->edma->n_chans / dmamux_nr; ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux; - if (fsl_chan->edma->drvdata->mux_swap) + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_MUX_SWAP) ch_off += endian_diff[ch_off % 4]; muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux]; diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 004ec4a6bc86..db137a8c558d 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -144,11 +144,12 @@ enum edma_version { v3, /* 32ch, i.mx7ulp */ }; +#define FSL_EDMA_DRV_HAS_DMACLK BIT(0) +#define FSL_EDMA_DRV_MUX_SWAP BIT(1) struct fsl_edma_drvdata { enum edma_version version; u32 dmamuxs; - bool has_dmaclk; - bool mux_swap; + u32 flags; int (*setup_irq)(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma); }; diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 16305bb9a2ef..f5cf95d185f8 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -233,14 +233,14 @@ static struct fsl_edma_drvdata vf610_data = { static struct fsl_edma_drvdata ls1028a_data = { .version = v1, .dmamuxs = DMAMUX_NR, - .mux_swap = true, + .flags = FSL_EDMA_DRV_MUX_SWAP, .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata imx7ulp_data = { .version = v3, .dmamuxs = 1, - .has_dmaclk = true, + .flags = FSL_EDMA_DRV_HAS_DMACLK, .setup_irq = fsl_edma2_irq_init, }; @@ -293,7 +293,7 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma_setup_regs(fsl_edma); regs = &fsl_edma->regs; - if (drvdata->has_dmaclk) { + if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) { fsl_edma->dmaclk = devm_clk_get(&pdev->dev, "dma"); if (IS_ERR(fsl_edma->dmaclk)) { dev_err(&pdev->dev, "Missing DMA block clock.\n"); From patchwork Tue Jun 20 20:12:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110686 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3921633vqr; Tue, 20 Jun 2023 13:30:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7it4yMbI0vBifJw2jCw1l5AW9U2sVOtU4S1nGr6o/PUzhnd5sWGbRJB/7X+iCtkZhts7zd X-Received: by 2002:a05:6808:1449:b0:3a0:3144:dd3c with SMTP id x9-20020a056808144900b003a03144dd3cmr6980830oiv.2.1687293029399; Tue, 20 Jun 2023 13:30:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687293029; cv=pass; d=google.com; s=arc-20160816; b=lSafgRvY8WmgI+52kovG/TOLhmLLiIEMfRD0eQPJt2NtXeMMryBjxrGknFy2Kw3cPn qYXpPFQJzx1Q5dKEBBOBxRzRqFeKNurlEFO6pirKyUfrzoy9U+F43HfoPO1AjwxppiZT FnHQ/HtWeJKFxdhPY2SLV014xfm2RGktDBDCTqb6l64Bj/B5Sg7FWDMXwUJoRCEZqOI4 t7K0oLgP2v1hmZHh6zMoOZAaNm8CILI265dVcmFojX73fsH/RW/CKmZPIIwOBuF/L4Z/ NeQ3Whv1ZUOdLWzU7z55WbbHxO+2HaQZdvRlrpQGgkvYSccY+Co2Rut1o4lG3cfNqNk8 Vnjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=qtVmb2w/gc4SRB2f37IwBcHKtbBBAdft6k4Ina+w9xI=; b=x1YNE5WKQs3PQXANxmChPXrYTKpG58lkLzfVWjT29JWfmcun0zNpRl3nI9itIVkk7q GyIjViiCRKzNgelCprS7a1+C2xrdkKZtDnfmhju0GqYGFb2pc+hltey8uWVz4ruBmUM1 PXj/K0JRMEZgEQM72Zf2TrVm2FdehkOv/fagNOYtbq2onNs9NVdqF8102xgwyfJOCE6D 945j27gR+HvywaRMdehfAVEIA2aIY99eC99i/PhUcOjO/rG2tbgMxscA8LINE2VJxBxZ 50BMkcN3L1OFfm4NUABaYiqBTXXhHrWy3G10EUEoL1fultFrF4HqivvQ/Z7JHxbOeJ3u Vrdg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=YlP+dS9O; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v185-20020a6389c2000000b0055392732f68si2400862pgd.496.2023.06.20.13.30.16; Tue, 20 Jun 2023 13:30:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=YlP+dS9O; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230125AbjFTUNk (ORCPT + 99 others); Tue, 20 Jun 2023 16:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230196AbjFTUND (ORCPT ); Tue, 20 Jun 2023 16:13:03 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C27B19B2; Tue, 20 Jun 2023 13:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NQnAmdkPBiwl9eBgju5XXL/XKVnjgeYrd+q0Em1vc0m7f22KCnvvTgf9ASYBh4lB6+Z4t8fRm9Xlno4lk4nIXCpLZ49us2M4XgUoIsV7JnYAfFKv0EXUxX4kJ6QxCpKgqg9l7l1hT8pFXxxia0/l/ZtV1rvoDODth9AGIdTRGhy9uA11domaIMSIFZ6UiwU6MBUF+mGvDgPD7rnNb0vF46if+NwfCDsvhdAlXr+cPLNbm+wCN5uskdAPY2SFS+bD1biVUVaeRGUyZrzeBEhcIK6psgVPNM8ZorTIGIo3h6QLEqcyzXd2BDJA7KaB15hhofpeXlPhusIS0gCdsQvrJQ== 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=qtVmb2w/gc4SRB2f37IwBcHKtbBBAdft6k4Ina+w9xI=; b=npvlVuE0t21KGizOZ1v2RLAX1vb8sY1F9DIJ9RG7aA/bhxMbGKx2v2Bz86XfMA5Msp4yZwyFYc3Sda3azAvSsXuncNlFp0d34SCQA+UiPJhBjvOayh64y8sITJidwHQE1FTr7NjJILIiUDvuIAWrJj5UkeqgutOYt8vP0zWYCo09r2WPsZPptVF0IjdCCdy3kExajUGn83HBbqPj2AzhDYHTecwJzX1Tsh9e3StjgvFL2gU1LSWCW8syrZaOuvYZsZ9yOs7djRrbW73JQUqifjrOtcmMLj0zKIlSWEkp6qO7OSaOMWFwaZavSkDmJpoHKwkTcslANmulMkLwBJ25TQ== 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=qtVmb2w/gc4SRB2f37IwBcHKtbBBAdft6k4Ina+w9xI=; b=YlP+dS9ON4dwxUnqowDyXKDDPm5F0/UpVhjns+prpdkqwJ/SpwqewnnSszU7+wEPP6lpVP4W02XHz6f1vVU4VS2blu/wIwwhWsSHLGHcFSDGZyjDcn6AoTsVlvSBv+CZlzbA4gAvXiMVVzrzt4KpFlV39YH3JENTxUrNQ3e3PXw= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:51 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:51 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 05/13] dmaengine: fsl-edma: Remove enum edma_version Date: Tue, 20 Jun 2023 16:12:13 -0400 Message-Id: <20230620201221.2580428-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 77ae3abb-3004-4a1e-546f-08db71cab964 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qhNbVE0oDsVguqaP6xvtrEpQNteteW7H43ZNOKkEka5sP2FrstSpoAk30jWnGcmMzSCov3kdPb7F5FbfHDI1TJX2y8/8Fkkq+giJANiuRqb2sAuD0QCSfp2JgIy9UCRMNpoWjo6N8X7UN11UQKYtJWC3xIxtoyPSMkNzWD2yWY0ljkTaajvbnq3O8udE4GO4fr3hZk3FFvoxVOAMCpQpqJJgb7bvCHEdCoXEG5g8fctzFzjyqibJAft0RwNk2FGoVMCdJ2cCLmSETsRGBfC7yUFmi7Wd+g2/z5RVWnri5Lg4jlbCDVhdmwieD30F+uKQQ4xJUOdigR1mMoREDK8lozmlt2cSJ0YwkPjVyddBQG4EP/GKMRkFiL4vgDUey63lJvaTk+Zs19hWlmLWCouZFteD2mbuF5ME1vAHOkm0Qu+t6xNeMlYRS/RVqvPzzbGuKMbwW0BwEAZeTyfk6EsRHaAK0Iz+ScvgR4+MTesOEILRJA57MBY7/BNgswbRAV5BHgXG2lyMEMXLL1bAox7w47n+eKrcJqs2lQyQZ6yWSdRChs4k/5kxZLXU0LpaOZZ8tdp7a3VM5nMszxFzjplKwNCqJcfdqkTxtc9maIP7mCw3s3SbABpLmBS+Q1ZtZgTOVaUsdEKpITrRr8nBULfrZOkeevvumZQkCkC822dX00Q= 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4CPMEJaeJzRzlhOVORV+hIJGsWsvRT6aUbzlVCHoT3HjlMUEjtGKwTHKrIR+Zks7UKtPaBe9/jCn0bqCfCi+GRUqhfsJ8AHu8EZtOIqAEaqyKMHydD73NU6XC7ezP8XXgnQubvySr96e67c2+OYCoSpS+moAMkSrejEZFg8Qg/BrFN7LJ+eWbny/Lv1Wrew3yJ0aUpxmyRuQy1wAKXL0KrDsUL1p/ocRWmel8lTA3lxN46xPxhAmpTPKdtG+//5HQt8DohbBBe5iWqTZlUuvSE79WoxoyiNATGy0r/HrDMK3rH1oyOnv5zalKYKeD0cr5eki5jvPuUh28EMcAgdXQqVqvB2ZQ6rNnDjuUc69tG0GXJNbBCDSpcq+k8SPcmfdBvHh13K6nQm34pj9eP4NKlAP9ooPIwH1DdnyD/nmiegKna02a0yi/Hou7K/ePM2pZ+KSC98KXIw9olbVHeZht5RnzjfgJUIrc/nHDMm9Vq/QzmCTNycXhz+8PhPfQTY4YuO2Kqx2a6xeNqY59VESK9RQQ9wKpLKLvMvhEE0p7PHPW9ZuqNnRmy8zglQdeO8wnwmp+vgBETm2xqqFTbJ2HahGsgpgIOmG3xoMIiGdYPQnmNpL7/8BuViBtb6pHCByCaW2UxyMKrtFFxIoQFH2d+GB08yato7XVQ+x7pa3zDrW0ElHUbtxuBOWvtUTEehgDdp/13S9XKk0jYw8KdaSOtZlztU8W4FXuyginO5SnmwHtEgATR5X4TY1wxpnr62mcw8X1tINU5HB8rsR0OOBzeed9lz6KituOJwkIP7cXSsjrtjFJ0uSGWtVk9T9msVbXonGH8AS9T7kFULf0Z0SuA4Uw1h8KbLIacLg5JldhgQkb+iIqUxtdGKqWXq/QqqHVkFp85xWrGLkETve+zLBmMHmPaMR/FcE37KyK5xvP99Lg8C63QEqQa6pDC7Grb2X+tlanAB32NTDro6vme50Mq3Ho7ZcuSTURQ968Qg1vLwS+ITBo2ZZtyUnzqnYvExrIt9d754sy86oS9ogDmrcNLoTtbHUABxHCS5HCKcMBSuDGdkcP94gEvksKN5wX7YQyDhguBfIACFIM6xEuruLiBVGm9RtQB6FpbXvZdeVUwLAVOO40/m5FDfzzDA7Ij0/88zpVx44r2J75edNHH0/GswI7DwCc4ntjuoAGeUJpuSftU0ehDcpezlbNwhEU4NQvmHce8QgirxSJxdXHpfrQkBwivfJCz4ByMnOvaR9Edb897bOjR2JE55u5Uin9ebpWLRoRJ96xcSELpHH9ItOL0jkrCd/iC+DWJ2rXXGvRNT75GZxJXDkOpe+xz1LHmxiR5wko+l9rjOAmQZe55ZnJwo6iWhW7YEidEBTJoA6jUBVuvzmwQvkYa17/zMejopbZSHO9k6L1ng478KC1/e+RQN+H7ITpe5uFHqEtTYtTNTwr0m11QSP30WXrKyPUNY9XO4zkQHybsEnwo9OZAv5I5SDGTBNTEZYRDHf+YLnIub0E+qSxRzHm7/Tq40pPRo4g8yn9D4Fr3UGE/mP8DXrB65u3R/YV7wktqHjgGgyzAlNCsKLTan0fsfdnWE7k4V1 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77ae3abb-3004-4a1e-546f-08db71cab964 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:51.2430 (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: gLfRWuZ1o1i5UcoyLjlNmM8/YKFqDAmeUH7JAVZb7dDO837KIHb4tkeGOG1wvYwVC9n2oIpiluEMhT0SJNlgpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254975387054923?= X-GMAIL-MSGID: =?utf-8?q?1769254975387054923?= The enum edma_version, which defines v1, v2, and v3, is a software concept used to distinguish IP differences. However, it is not aligned with the chip reference manual. According to the 7ulp reference manual, it should be edma2. In the future, there will be edma3, edma4, and edma5, which could cause confusion. To avoid this confusion, remove the edma_version and instead use drvdata->flags to distinguish the IP difference. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 47 ++++++++++++++--------------------- drivers/dma/fsl-edma-common.h | 10 +++----- drivers/dma/fsl-edma-main.c | 8 +++--- drivers/dma/mcf-edma-main.c | 2 +- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 10dcc1435d37..9948babcadf6 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -47,7 +47,7 @@ static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) struct edma_regs *regs = &fsl_chan->edma->regs; u32 ch = fsl_chan->vchan.chan.chan_id; - if (fsl_chan->edma->drvdata->version == v1) { + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_WRAP_IO) { edma_writeb(fsl_chan->edma, EDMA_SEEI_SEEI(ch), regs->seei); edma_writeb(fsl_chan->edma, ch, regs->serq); } else { @@ -64,7 +64,7 @@ void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) struct edma_regs *regs = &fsl_chan->edma->regs; u32 ch = fsl_chan->vchan.chan.chan_id; - if (fsl_chan->edma->drvdata->version == v1) { + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_WRAP_IO) { edma_writeb(fsl_chan->edma, ch, regs->cerq); edma_writeb(fsl_chan->edma, EDMA_CEEI_CEEI(ch), regs->ceei); } else { @@ -120,7 +120,7 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux]; slot = EDMAMUX_CHCFG_SOURCE(slot); - if (fsl_chan->edma->drvdata->version == v3) + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_CONFIG32) mux_configure32(fsl_chan, muxaddr, ch_off, slot, enable); else mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable); @@ -682,9 +682,8 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev) } /* - * On the 32 channels Vybrid/mpc577x edma version (here called "v1"), - * register offsets are different compared to ColdFire mcf5441x 64 channels - * edma (here called "v2"). + * On the 32 channels Vybrid/mpc577x edma version, register offsets are + * different compared to ColdFire mcf5441x 64 channels edma. * * This function sets up register offsets as per proper declared version * so must be called in xxx_edma_probe() just after setting the @@ -692,33 +691,25 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev) */ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) { + bool is64 = !!(edma->drvdata->flags & FSL_EDMA_DRV_EDMA64); + edma->regs.cr = edma->membase + EDMA_CR; edma->regs.es = edma->membase + EDMA_ES; edma->regs.erql = edma->membase + EDMA_ERQ; edma->regs.eeil = edma->membase + EDMA_EEI; - edma->regs.serq = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_SERQ : EDMA_SERQ); - edma->regs.cerq = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CERQ : EDMA_CERQ); - edma->regs.seei = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_SEEI : EDMA_SEEI); - edma->regs.ceei = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CEEI : EDMA_CEEI); - edma->regs.cint = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CINT : EDMA_CINT); - edma->regs.cerr = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CERR : EDMA_CERR); - edma->regs.ssrt = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_SSRT : EDMA_SSRT); - edma->regs.cdne = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CDNE : EDMA_CDNE); - edma->regs.intl = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_INTL : EDMA_INTR); - edma->regs.errl = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_ERRL : EDMA_ERR); - - if (edma->drvdata->version == v2) { + edma->regs.serq = edma->membase + (is64 ? EDMA64_SERQ : EDMA_SERQ); + edma->regs.cerq = edma->membase + (is64 ? EDMA64_CERQ : EDMA_CERQ); + edma->regs.seei = edma->membase + (is64 ? EDMA64_SEEI : EDMA_SEEI); + edma->regs.ceei = edma->membase + (is64 ? EDMA64_CEEI : EDMA_CEEI); + edma->regs.cint = edma->membase + (is64 ? EDMA64_CINT : EDMA_CINT); + edma->regs.cerr = edma->membase + (is64 ? EDMA64_CERR : EDMA_CERR); + edma->regs.ssrt = edma->membase + (is64 ? EDMA64_SSRT : EDMA_SSRT); + edma->regs.cdne = edma->membase + (is64 ? EDMA64_CDNE : EDMA_CDNE); + edma->regs.intl = edma->membase + (is64 ? EDMA64_INTL : EDMA_INTR); + edma->regs.errl = edma->membase + (is64 ? EDMA64_ERRL : EDMA_ERR); + + if (is64) { edma->regs.erqh = edma->membase + EDMA64_ERQH; edma->regs.eeih = edma->membase + EDMA64_EEIH; edma->regs.errh = edma->membase + EDMA64_ERRH; diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index db137a8c558d..5f3fcb991b5e 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -138,16 +138,12 @@ struct fsl_edma_desc { struct fsl_edma_sw_tcd tcd[]; }; -enum edma_version { - v1, /* 32ch, Vybrid, mpc57x, etc */ - v2, /* 64ch Coldfire */ - v3, /* 32ch, i.mx7ulp */ -}; - #define FSL_EDMA_DRV_HAS_DMACLK BIT(0) #define FSL_EDMA_DRV_MUX_SWAP BIT(1) +#define FSL_EDMA_DRV_CONFIG32 BIT(2) +#define FSL_EDMA_DRV_WRAP_IO BIT(3) +#define FSL_EDMA_DRV_EDMA64 BIT(4) struct fsl_edma_drvdata { - enum edma_version version; u32 dmamuxs; u32 flags; int (*setup_irq)(struct platform_device *pdev, diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index f5cf95d185f8..47bfef1c562c 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -225,22 +225,20 @@ static void fsl_disable_clocks(struct fsl_edma_engine *fsl_edma, int nr_clocks) } static struct fsl_edma_drvdata vf610_data = { - .version = v1, .dmamuxs = DMAMUX_NR, + .flags = FSL_EDMA_DRV_WRAP_IO, .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata ls1028a_data = { - .version = v1, .dmamuxs = DMAMUX_NR, - .flags = FSL_EDMA_DRV_MUX_SWAP, + .flags = FSL_EDMA_DRV_MUX_SWAP | FSL_EDMA_DRV_WRAP_IO, .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata imx7ulp_data = { - .version = v3, .dmamuxs = 1, - .flags = FSL_EDMA_DRV_HAS_DMACLK, + .flags = FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_CONFIG32, .setup_irq = fsl_edma2_irq_init, }; diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index ebd8733f72ad..7b05e303ba51 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -172,7 +172,7 @@ static void mcf_edma_irq_free(struct platform_device *pdev, } static struct fsl_edma_drvdata mcf_data = { - .version = v2, + .flags = FSL_EDMA_DRV_EDMA64, .setup_irq = mcf_edma_irq_init, }; From patchwork Tue Jun 20 20:12:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110688 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3922819vqr; Tue, 20 Jun 2023 13:32:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kpvEVTBLYBmAUOH9puHqpIspSgQonkVznmTKy95EcE6G4AzMcJdNH4/v8a7n0/ZMlrzGD X-Received: by 2002:a05:6a20:3cab:b0:106:c9b7:c932 with SMTP id b43-20020a056a203cab00b00106c9b7c932mr4692604pzj.1.1687293159144; Tue, 20 Jun 2023 13:32:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687293159; cv=pass; d=google.com; s=arc-20160816; b=y/aYw7YwA52Q8+9BPGjQLuZiDu1HkOijMnB1ubiaLGPKkGmmufXLPF3pNLIOZlIlKQ d9UfWmN8rhDzcK1e+Z2kROwmrlm3utuitBTUJnu68rI+80V0+5IO1EsVrsveMoXomQtR pfGY7msL/JAvWvgC5FHe7tT/dyy8F5aM9lj+4ooqv/aJcdL7DwLNJsuTou07KwBijb0K gQRSFbAWlje1vnZIkTB+Yg2BBXI9PwjoYudzh4p2jqmXcmt/xhn6wGo5YTzqxZpylfll 6zJflvQLe4JsuUTxT1I3pJx1KJz/9tOsXjTGH+82BWnb7Epmg5T1Yc7A4B0m3cv/ZTVL IhZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=i8SowlELrPWxkRr9/us8d8rvbeSkIi6e/pnhOSy9jcs=; b=vHaWz0JWZhv5GSlnHmMrLNz9QeuZytSjz6T5NMP1NZ1A1/zSqprBXQhIZGmi8KSRkd 6mVHwTJwwHvKy510C6bFJpXcTa8fMhNR6Wj+dRzlxQwkFfSm8y+rszimvVs587ryFJ1I WfMfi9bOfkokXjSUbQuC+Qrn3OPlDVtnOAWkavEykpXDJtbUIToAOUE+jZ86Yhlmf3CB mIhcriA/Ico32zL6DWO04YNDLZw8sE9DSMUuqZ4oUiH2D8fw0hwFpxRZsvj8JJ+Ue8aE bLfrZ0/EhT319Y3EbqBXQbRUX0xW8Pp9nRQtPqAgPVT+L3HHpoMqTqeZnQsHEqMTbDUd gKAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Rs9pdT6g; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 186-20020a6300c3000000b005538a3e801esi2362552pga.535.2023.06.20.13.32.25; Tue, 20 Jun 2023 13:32:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Rs9pdT6g; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230268AbjFTUNr (ORCPT + 99 others); Tue, 20 Jun 2023 16:13:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjFTUNU (ORCPT ); Tue, 20 Jun 2023 16:13:20 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB78E1BD3; Tue, 20 Jun 2023 13:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ntHt2sRZ7Kvk9Hcs0pTSQ8nWsgPxE93C7QssBAv0KqGuyNOEq9OvvIn19OJdrbHjcTnfHrCCbXKGdqqhbHnSetKlQd+j5MMAJxETWxHyUE0J27RmQxGmaXQfq94VOusYij+bxzNrzE7Xg/0JP+P6o1qa5/Y6ioso8im1rBZA835ZGDoBvqH0KaVpei+9eFsmj4D64f5Oi8LoNEDhTTJ40XHVnmKVGvzV2diPLRHNFOV72VFI/7nNdl8lHsuOc7UZYRxhnsZF0p/NVKtLydCqIR5m38KNPlEcyEiWbdHMbbdcifnLktZht8xPtHwlXrg5mhqNQ0cGZt4t4SG35tTIww== 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=i8SowlELrPWxkRr9/us8d8rvbeSkIi6e/pnhOSy9jcs=; b=h7d4w9udTw1g6TroCNGmUATQj1jqBa8yowBDNy9KD14bFtUL+h5j5AL4KEY9I7rfQf43PKU55up/IEgeUqakOZWDHd5vNrPKLgEfnQ3US4mnB4EdSt8/MNDL5t8e6W3lvjm2z45FwwjnRSkAtYm8k6KaIPIi9Q2Rvs7NYo4MczI+QJ33l3Nq83T9ThR3KACMpvyxlD4nK56GKJKLlUgxmDG6n6zDmeVrFm+pR4VIzgkKy4KDnTuzQt3wU26IVujxpNqFmlIkSkgn6CClcWs5IsT1D4vDqJ4QFZ2xH4fYzXiqhjokDq1uZzPKyYvRoEtr3qMXGXB8EP27a44wXHFL1w== 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=i8SowlELrPWxkRr9/us8d8rvbeSkIi6e/pnhOSy9jcs=; b=Rs9pdT6gRieLdR4yqOSj3TRYLJisH3QXXcbb+Y6Lxb0rHGvZBl2eWjXI9IK6PtwGOueUqIxKT+9gRdN8ohArQMmb+hJJ2Cr8h/agImtxR/q9BQmVcB9m90vogdcd38w6tm40BHCVSmhwoGCrXOK1YQGL6CjiYUKjkRQRV0tQxNk= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:54 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:54 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 06/13] dmaengine: fsl-edma: move common IRQ handler to common.c Date: Tue, 20 Jun 2023 16:12:14 -0400 Message-Id: <20230620201221.2580428-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 39277f8c-2bec-4511-aec0-08db71cabb0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a/shknRCa3Avs9lTS3CcbQbZASWm5cIb5Gpgr1cERgyz+xBJaLtHB8xuq7Sc+lKbf0VekS4PTMVya7QTY4vxqwcFWw+Lov+sQWK2Et/apExQHd4yvvI77JziIoTjr+3duoBaQB0syXkIfqYtLApfsAz1ZZkJdCQp16VyCQeZgxzjBRk+4tMfs2OBAUbGbONuva76zIlDG7oPLs8cwjhN/7yTS6DNygjCiQkGnys+gK/MeZAEgYSdLhauT5nbYb1cWb2wv3lV/qw+VhOrZl1pQv/YWEBawmwtEjgV05SMwYWxMXXKXc838s9OfZjNjnYy8xAs7XBnXg+S7O3KAUHVGBTiAXsgUYB8weqwoDiqiuTEAYy1lhmFcJt3n8Ow2Zq4/qDnvoBUpDdYgS29ZL3llPR/k+pyRzc7nN7r37m1BIrr8rsq1Evl5DZhGTAltH0ugJSIvgwoUJVbPxRJ9rEL7eQVP4RKpYCGJqbn9O/yYvGVif8gn915I+hkz4N4XeVlPlzZDFnjJ2bVAlsj5YTOnhbHDW2xe8ut5r83w7dKKhk10w+qJpjHMkY5m284NAV+B47/WNfD2Bml4qNatMVrpG1vDw83bzhR2lW4vzySaBXTiUjtRkst1SgLOAj0z2EpDsyqQ74CupEPrLzT6dIBgg== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mjprSYCBwdbk/l9hAergQ5ODkiY+spxM14fBcN1l1VVH2UGw91jJ+Lr2tiBa89UZgtWz08VQl2o9kwfdjymEf70zkzJ6mQBCmkL0H/VbNeQaUi847g5MMdxEGmH+3t9NkuI6qwfiXOgX2SByDr02KK2pu4wEAeAlvP8x8GQ/ACykOqDUWIqmKPtar4ab+VSVM4WpgRY6x/Lp0mhTWFQYwCp9NjRcO0wsOfRZLhCm01aKdoI7HlFxuOwXJgXSuLvV2Pmd3MvuHuki2SlK2WSRbCzbDLkqD4yNU2yx7w8NMX9KEfiBJEzZfRW5vJp5Gm7w1/XksEvp0lyo6cHWIsVpyypJEXlIzwzpN+poBsUHUsxa8A2qxXV2bQebvCwqEz1/ZKzPlfK97l2rdkntXyLIJyOu6RDZHmLdokHxF9X05C2tKukwsj/XrSTO7a0RwM5XzaZ98Xcq0qMLhjhT6ZPgXVfjdRsGl9Ic9PthCGLw3+YvxPNkB4Pr0Wu0CB6T/YAo035UmyAfKQzNDfGk9WEEoCUCUUha3WlvhdszzP84hxgXH5StC9OMBiKKZyPYyhDE/AoRVLuo2MUJpSulP1bGdxuSBGWe2SN5xfyj0siSAY5spqEjEMVrEi6kYj7WK6lTxC7lPKzCM4NFwwGPfj2h7GDNsOTgfecX0904Hi/RJsTJP4wT7QdtDKEAddvV9/CDK4LR9JP6kaA3LofMM7482cyIRpbyUqe/KnPdHg4OM8UwI8YBHxCALNWwEjJQ9DcP9Bh1QrbYwpn/xcF7t3SqhuH2lgXgTorz0Cm96U9f/NF1YVyLE6bhFh9VqhN6XS2bhmPGWrlBaoLJjWMBV1njEYY7evkza96NruQn/x/ldXiDqtIDbr7laDp/KUrl25/1FygRam9LT7jQvhQVLFff+7ZnLtx9U6Nh069DQxdMx5/d7EXVVszjF4sSmG+uHl+EQMro00TB8JI39ByGEiqSox5dFDNteaQ1ZNkK4XZslA98htPCdMHIZqWVgKeX8J+w7iXdtsFZzwSEY/4iN2CYUM310IO0Ppv3PM00QVurZX4J405TNCcD0DeK2PFQ3zCCuqiJIf7ZQGzQaRowB9XxnNg+ruagJ4Q5yLQSltgTeDRtGa+WS4DJwPEfjCWzDz9CQ1jev4xkMttYqMCyCVJ+OpCbXGJy4z6iGych1Ly5jtV9JQ279lhkXeTEDCuuFK5ZmxDDEIOVuyRcLjjYgTmlDXyGZT2wifOu2P3U2vCj9aiz9q81la0qa6q7nw5uaRX3gDxtV5AA/5oeVtEOAh1ih8O0BkuQVB3qtmIJYeVr/nmkN/5aZfl7vqFqqXKsnfbjTcTNnYwE7If58DM8M+Ef5yZzWNG36nvucsGxBrlYisv27vf47MoRP8Q+yUxEOkiFFoeUZKKK+eOxDX7ja+XNL3q+9S9fZL7H/LhnM2jAGGm0A4LDzHra1KvBNU8XsK+++oZOEm4RPH3b0dRjzriKyjDLC0gSZSbwdBAp3lP//91PALJC7LX+mr1xm0ON9AOPqVaCXGl1RSZNbfWZLBUWxGCQyVxzyJj3d5/XzI4aPK5T7kK6BR/yRdy0c2fXv21g X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39277f8c-2bec-4511-aec0-08db71cabb0c X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:54.0029 (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: NrhsuKUhGFwBBa30MkBW3L7ibOtJQpG2qXMedlBV1qYyOx8EkQAn6n8yRtGSbWI/ctfZJFzaDxZridH72UjOdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769255111911558165?= X-GMAIL-MSGID: =?utf-8?q?1769255111911558165?= Move the common part of IRQ handler from fsl-edma-main.c and mcf-edma-main.c to fsl-edma-common.c. This eliminates redundant code, as the both files contains mostly identical code. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 26 ++++++++++++++++++++++++++ drivers/dma/fsl-edma-common.h | 7 +++++++ drivers/dma/fsl-edma-main.c | 30 ++---------------------------- drivers/dma/mcf-edma-main.c | 30 ++---------------------------- 4 files changed, 37 insertions(+), 56 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 9948babcadf6..a9d17cf142fc 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -42,6 +42,32 @@ #define EDMA_TCD 0x1000 +void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan) +{ + spin_lock(&fsl_chan->vchan.lock); + + if (!fsl_chan->edesc) { + /* terminate_all called before */ + spin_unlock(&fsl_chan->vchan.lock); + return; + } + + if (!fsl_chan->edesc->iscyclic) { + list_del(&fsl_chan->edesc->vdesc.node); + vchan_cookie_complete(&fsl_chan->edesc->vdesc); + fsl_chan->edesc = NULL; + fsl_chan->status = DMA_COMPLETE; + fsl_chan->idle = true; + } else { + vchan_cyclic_callback(&fsl_chan->edesc->vdesc); + } + + if (!fsl_chan->edesc) + fsl_edma_xfer_desc(fsl_chan); + + spin_unlock(&fsl_chan->vchan.lock); +} + static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) { struct edma_regs *regs = &fsl_chan->edma->regs; diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 5f3fcb991b5e..242ab7df8993 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -219,6 +219,13 @@ static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd) return container_of(vd, struct fsl_edma_desc, vdesc); } +static inline void fsl_edma_err_chan_handler(struct fsl_edma_chan *fsl_chan) +{ + fsl_chan->status = DMA_ERROR; + fsl_chan->idle = true; +} + +void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan); void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan); void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, unsigned int slot, bool enable); diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 47bfef1c562c..a0e54ca4893c 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -33,7 +33,6 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) struct fsl_edma_engine *fsl_edma = dev_id; unsigned int intr, ch; struct edma_regs *regs = &fsl_edma->regs; - struct fsl_edma_chan *fsl_chan; intr = edma_readl(fsl_edma, regs->intl); if (!intr) @@ -42,31 +41,7 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) for (ch = 0; ch < fsl_edma->n_chans; ch++) { if (intr & (0x1 << ch)) { edma_writeb(fsl_edma, EDMA_CINT_CINT(ch), regs->cint); - - fsl_chan = &fsl_edma->chans[ch]; - - spin_lock(&fsl_chan->vchan.lock); - - if (!fsl_chan->edesc) { - /* terminate_all called before */ - spin_unlock(&fsl_chan->vchan.lock); - continue; - } - - if (!fsl_chan->edesc->iscyclic) { - list_del(&fsl_chan->edesc->vdesc.node); - vchan_cookie_complete(&fsl_chan->edesc->vdesc); - fsl_chan->edesc = NULL; - fsl_chan->status = DMA_COMPLETE; - fsl_chan->idle = true; - } else { - vchan_cyclic_callback(&fsl_chan->edesc->vdesc); - } - - if (!fsl_chan->edesc) - fsl_edma_xfer_desc(fsl_chan); - - spin_unlock(&fsl_chan->vchan.lock); + fsl_edma_tx_chan_handler(&fsl_edma->chans[ch]); } } return IRQ_HANDLED; @@ -86,8 +61,7 @@ static irqreturn_t fsl_edma_err_handler(int irq, void *dev_id) if (err & (0x1 << ch)) { fsl_edma_disable_request(&fsl_edma->chans[ch]); edma_writeb(fsl_edma, EDMA_CERR_CERR(ch), regs->cerr); - fsl_edma->chans[ch].status = DMA_ERROR; - fsl_edma->chans[ch].idle = true; + fsl_edma_err_chan_handler(&fsl_edma->chans[ch]); } } return IRQ_HANDLED; diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index 7b05e303ba51..316e637b00c4 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -19,7 +19,6 @@ static irqreturn_t mcf_edma_tx_handler(int irq, void *dev_id) struct fsl_edma_engine *mcf_edma = dev_id; struct edma_regs *regs = &mcf_edma->regs; unsigned int ch; - struct fsl_edma_chan *mcf_chan; u64 intmap; intmap = ioread32(regs->inth); @@ -31,31 +30,7 @@ static irqreturn_t mcf_edma_tx_handler(int irq, void *dev_id) for (ch = 0; ch < mcf_edma->n_chans; ch++) { if (intmap & BIT(ch)) { iowrite8(EDMA_MASK_CH(ch), regs->cint); - - mcf_chan = &mcf_edma->chans[ch]; - - spin_lock(&mcf_chan->vchan.lock); - - if (!mcf_chan->edesc) { - /* terminate_all called before */ - spin_unlock(&mcf_chan->vchan.lock); - continue; - } - - if (!mcf_chan->edesc->iscyclic) { - list_del(&mcf_chan->edesc->vdesc.node); - vchan_cookie_complete(&mcf_chan->edesc->vdesc); - mcf_chan->edesc = NULL; - mcf_chan->status = DMA_COMPLETE; - mcf_chan->idle = true; - } else { - vchan_cyclic_callback(&mcf_chan->edesc->vdesc); - } - - if (!mcf_chan->edesc) - fsl_edma_xfer_desc(mcf_chan); - - spin_unlock(&mcf_chan->vchan.lock); + fsl_edma_tx_chan_handler(&mcf_edma->chans[ch]); } } @@ -76,8 +51,7 @@ static irqreturn_t mcf_edma_err_handler(int irq, void *dev_id) if (err & BIT(ch)) { fsl_edma_disable_request(&mcf_edma->chans[ch]); iowrite8(EDMA_CERR_CERR(ch), regs->cerr); - mcf_edma->chans[ch].status = DMA_ERROR; - mcf_edma->chans[ch].idle = true; + fsl_edma_err_chan_handler(&mcf_edma->chans[ch]); } } From patchwork Tue Jun 20 20:12:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110676 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3915442vqr; Tue, 20 Jun 2023 13:16:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ481Y/RysuWD/BcGXp1gX7BiLeMsYRII10LzkwNym4Bg2YZmxjvHHHw9doYBTIhe8uDz/iq X-Received: by 2002:a17:902:e744:b0:1b1:8ca9:10ca with SMTP id p4-20020a170902e74400b001b18ca910camr28146033plf.33.1687292187697; Tue, 20 Jun 2023 13:16:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292187; cv=pass; d=google.com; s=arc-20160816; b=HQjoIdH+kF0ONNovgl2mQW6fw608ljAXtSeekFByqRxSwaniEalhrif1A8FNqnnLwr 2vrhmXitFy2rgEksEWAqv3PgQUGobgX2nFtVW3QMLIeT9Hwhf1HW76fIR9PHWqqfzUhE stYZqACva5qi0y3uLOpzQOqiacgYfjWKS0fbqo/ZN4J/ygKNaEEnv1E1yFtijbZ3yf1B vHaik5XRr5BMSulXDOaWAfOGv8ZDs8r/YKGrs5FVuIYPiZTI7bdel9qSk0zUlsD5E0aT Rg1pcA+tQIz2jRM6FtTXt0is2VDn4ZJTqGXwcxrXm700NPxVkmQ8YsnwTSa0vAjGZNsR VLFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=s1+6nOaISVZ89Qy4+Cr3cnXLzqMpnDganBMJUwxpjWY=; b=aYeKLaKIV4cH2NQNldBpwY16TiTjoLlijDA5KDkdbhzNHxjyOTI6EmiLFfiI82rxLt mRRrARVSGYsZZpDhnpJwB3gwxwFLMMz25NxapKlR+KBZWLnPP5YhtLjDFtYdCEaSiIyR DvjJGYoyqLkWZ86BcuPrNActMlxdcqZEJH6mv/xDZqfiEkeJQ6hdYBZ304gq1644NWYA q0clUz9yo0ldBM+KrYPQhkkLzdxOfSFO6FsMZCkN5qOg/C19bykcU9U0woaNWYEj/X84 LzjjyDW0JjSJ+dyu89F6r4fsf2UjVG5kMY2eznkFyTX9Hxw9x0KQHM9gGPK7aooHfRP/ Ealg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="lJ/OpBVp"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a170903110800b001b526e9bb3fsi2822611plh.584.2023.06.20.13.16.12; Tue, 20 Jun 2023 13:16:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="lJ/OpBVp"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbjFTUOJ (ORCPT + 99 others); Tue, 20 Jun 2023 16:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjFTUNl (ORCPT ); Tue, 20 Jun 2023 16:13:41 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2056.outbound.protection.outlook.com [40.107.104.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B73021981; Tue, 20 Jun 2023 13:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+RrcQAN2RPr8AYHCdbMi6vwFOtGQZYrduxDKkFdUzm+kw9aoTRIZ+Dw/zbl3w40Dg9AW+DOPOxcgikHQMI1thop5jXSQZffCeSBNIyZcerNNf7yh2zNnhacpOvId1lDidJkYOZnOLS2qmwAFrAT046cBv0D1pBtae5WgAncq7Nf5BKGeFkxilBJ9VCctLqbz4whpYkBk5HpjyIFrycAMKYm+AKVkULIOx8kcOPKJ7cYd8DGPTMZO0mRB6UUxFtDn3e42ecEga+1fWQkBz33tbQ0dTezYl5BQOeJhhGoYSJi8VrisWToYtcOLUlnSMc6Mq5bkmxpTtAEAcyXLzbE3A== 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=s1+6nOaISVZ89Qy4+Cr3cnXLzqMpnDganBMJUwxpjWY=; b=RHiiNjN24j1qN3BOWszw/RHm4McCKeMkldkY9VwTnY7Qi00qpwjwwmy6z2K0qUVj07gdPaI9RJl+29O4aFfxXBzF9b9BcPqvIz59R1ezyy1kgZY8Jl/JEy/e9qtSGutt2ix9Im1BAIdbrFmXs25btQ0RMkMy5CBAQ+mYYaY5pdjBN7O1oxbApFdKts3WMS+RXqljLF1Pdgr8oPR3Nnu+xlirP9JSmKYnOAD4bq0hBwn1bH/gcjaEsbI2Sf3MtGESm9y7kSaRUkNCxEvJfoHgAjU2YVqkOSGjl3WBcPhR8flkIC5TEt4KY3iyO81tWr6zXDQlb5TlfIYaAH0oAoiFhQ== 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=s1+6nOaISVZ89Qy4+Cr3cnXLzqMpnDganBMJUwxpjWY=; b=lJ/OpBVpjdfrAoyViAHRja7g7Ug/CGR3j7a/FaTrbB+oL4PdowY8SAzK1wGAj8cvR1C29M68KbqTPBIjiJ38X8J8BE117/+dd7Hvx9o0Qswv3E0F5D4nyWhTB+Yd2ge1cPAsd1I6Cd9Lgos0Co+/ox9/dEnl2Mgt1LJgxn4kHpY= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:56 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:56 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 07/13] dmaengine: fsl-edma: simply ATTR_DSIZE and ATTR_SSIZE by using ffs() Date: Tue, 20 Jun 2023 16:12:15 -0400 Message-Id: <20230620201221.2580428-8-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 881b9c56-9c36-48fd-7fd8-08db71cabcab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eifTkMABSGLHxzgmL9iByqj0Ueh3tlq+rsaNTrrah8zcbrlv5uY0XVzyeR6HCepr5jVcPAag1L8OFy1hkv92itJX6806KpJ06QaUgXPYZjgEoNnArpN+ysao5AHOWazk14G33Q1PP3Z+N1lywoyJePaBcZj9Ve2rejD0qAzsnD/qYI12NQF7F/eyEAhYst1lE5J3q2hkSK5HukW4eJa189YeRo9GxqSYvI9wwkVD0Kk+Y5Tst9vzjn9AwQpD/bRTueWkdHbXwk6W7lXmBoiDIrao9PgtguCzWtV3eWgeCMDg0dB9wYYRy3oC6vsImFpsFOlsRrjq+9M0RBrvTtl6kUgmGKMu3y7K8Emhb9k9bPdCEM1xlaZLE7x9udJsaJf+PCo3Q9NF4kZzgKZsDs6e72Ocsg1hRBUGluo5WuMIGUhmCa4T+xG6SiocbKBmm1hF8wAR/99976YiuOve0EazRVlNepTMDdjqjk2rF8vhFRLSOcmP6Ke9sG3DNI7F06KAp5w/5sIiUgytdLdERLTe9iXF6hoC6BrTV6Ss9AuOr7syhZBpd9D/duDclyoSdQ2wM2E5gyH0kREQ33qvWuKiR1Rvc6MRfkpiVIsDVFg+DzV96Gent5Uzx8Au63WBBjMz 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D8Qh5pYVXJsr9FMiomLue7XNYgeY54UJItw2W1FGqq3GF7HKgNBznD7dN7uysOO+FWjAcVRnBG6X0uG+sAEKneF/nnCa3GR5+vd0H7eg2k22RdaXztU48XqXh//iOgZBGCaQCV1aCX59iX26NwIvWyaH8nekV6QFGobpB9fgXl23CLqM4UPL87ZGG+QIFxx8ttqJKhktonNjDAr6LGRtETAEeb2MM//x6SXcjDZf2LQPu1d2RC3/rXnJqE9WUK2kNikUCetFCwOZyX708UVZrJplpHs2saPip3QBZ/JA/ycDTk5Jp0NfJPJ5U3w3C6GkSLadFnqBrrWBoaaujBYltCqsuXSDVVMv+8bgVd/XPxkE//UViQTyD3P/XVcLdBv9ph9J2VB4NEcLDDcixykfw/kDOSVSyrDzKWySoYjL0rM2nyjqqcaYC1hml8inp5ZZ8wLyzBt9/0F4JkHJLGxDTPFi78u/7+5ig5MliJM/0DX8u1JnugDz6+RIJdmqqRno4lWD2yTo30ESvLcsxRfFTqrwppIo+bLGomvghp+0lwmWFm/6lxQvOFWxPFqRw1kzgof30Gc5HizgaJsC7jhijpUAq0RnyTrK54HWcXgHvpzhlcYN/k57msI9ulBzi+YbKYfLjpMrbT/MCAEMi/izgTAcZgJqP7dt6uqoOivIref0VW8pKh7xom4T/j9yxtPEGniFCS8CqPC2xUDXPrd8E6DXAmlbIxLxnG1HH+lmtLf246cVLN8dsj648peRWOQj2k+SCaLQD1+cJsQ3gQz68z4NuwWjgTE/QWF9vInMcCzOKeyxZ0+ZpUa9aEch+F98KCDfk7SSNs8qHqvIf0Xd8Tr05MCyc6FfMKKo7z2qDNf9NOIXlwgsigKEvJ5o3Sxe3H50yukYv6kG6HfDkqoubg8MOpgopmC7TVTuvMXdg8pHcWmBdzW4A4Q04w6jRL6/3uMxCbkRwjdnpq/rxG2BdkdV1ePAsqPbVcfFrznI2FK1Ar+lEhNgMMZhICwUfIfujQcg/O3r0FYrWj6BhJArqjogVf6riV5xlAHQYNBKALyYe+wVa5vR8lzhdSXkNfJ5ZNLhTj88fD7N4C5ajp8SORjtWvO2SVn7oDpLBJ6R2EArIrC7V+C0n53Ynsu3B7+8WpOTdvGXDr0fsrz0bsfLBMhy2HqIRfFroNRTdIMqmtILE7V4wCynt2Zr77QFLjaYRtdhKXdyU7lPqIMf72PJamZ7U3eoyDsvECxfbHTOg8xS2o05mRIxCArGPZTi0WPGgKEelWyQ4aC1yzjKcTuiKZ2iKUU9QDfy+n2CQ8fUpsIfl+dyUJ5OVYAH1/TXOI0cinJyYs1GVJpFHzGLt9MwQSURNW2ULhZ/nCmUq0UnAV7alp/W6DbWfH9sAgj63JyyLxbdLHXoUJO9nMUjYklwoXqSwhSLEEiKJGZGUe7x8EkbUo/Jmv8gfyagjaPUO0jXg3n79aqYNqJOPwCAB1xIiywGeM2DgzRQZ7w+tfN8F92sIQAGqc7OvjvzwivCMp6diN3Rnzr8XpZsP3CTVJyae76X/q2rc4tYt0hjHNafctpLETSja0zXQhGzynFDGgj4 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 881b9c56-9c36-48fd-7fd8-08db71cabcab X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:56.7369 (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: Rw8jccQU1hEdwnsVvxXGPiEhmutJ889hJ9Aot+NOGMbFmeFeazb8hVxiVBAsQ3LYaLMjUznMz6vvGY578uYlFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254093064003922?= X-GMAIL-MSGID: =?utf-8?q?1769254093064003922?= Removes all ATTR_DSIZE_*BIT(BYTE) and ATTR_SSIZE_*BIT(BYTE) definitions in edma. Uses ffs() instead, as it gives identical results. This simplifies the code and avoids adding more similar definitions in future V3 version. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 21 ++++++++------------- drivers/dma/fsl-edma-common.h | 10 ---------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index a9d17cf142fc..51fbd7531c74 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -154,18 +154,13 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, static unsigned int fsl_edma_get_tcd_attr(enum dma_slave_buswidth addr_width) { - switch (addr_width) { - case 1: - return EDMA_TCD_ATTR_SSIZE_8BIT | EDMA_TCD_ATTR_DSIZE_8BIT; - case 2: - return EDMA_TCD_ATTR_SSIZE_16BIT | EDMA_TCD_ATTR_DSIZE_16BIT; - case 4: - return EDMA_TCD_ATTR_SSIZE_32BIT | EDMA_TCD_ATTR_DSIZE_32BIT; - case 8: - return EDMA_TCD_ATTR_SSIZE_64BIT | EDMA_TCD_ATTR_DSIZE_64BIT; - default: - return EDMA_TCD_ATTR_SSIZE_32BIT | EDMA_TCD_ATTR_DSIZE_32BIT; - } + u32 val; + + if (addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED) + addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + + val = ffs(addr_width) - 1; + return val | (val << 8); } void fsl_edma_free_desc(struct virt_dma_desc *vdesc) @@ -623,7 +618,7 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, /* To match with copy_align and max_seg_size so 1 tcd is enough */ fsl_edma_fill_tcd(fsl_desc->tcd[0].vtcd, dma_src, dma_dst, - EDMA_TCD_ATTR_SSIZE_32BYTE | EDMA_TCD_ATTR_DSIZE_32BYTE, + fsl_edma_get_tcd_attr(DMA_SLAVE_BUSWIDTH_32_BYTES), 32, len, 0, 1, 1, 32, 0, true, true, false); return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 242ab7df8993..521b79fc3828 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -29,16 +29,6 @@ #define EDMA_TCD_ATTR_DMOD(x) (((x) & GENMASK(4, 0)) << 3) #define EDMA_TCD_ATTR_SSIZE(x) (((x) & GENMASK(2, 0)) << 8) #define EDMA_TCD_ATTR_SMOD(x) (((x) & GENMASK(4, 0)) << 11) -#define EDMA_TCD_ATTR_DSIZE_8BIT 0 -#define EDMA_TCD_ATTR_DSIZE_16BIT BIT(0) -#define EDMA_TCD_ATTR_DSIZE_32BIT BIT(1) -#define EDMA_TCD_ATTR_DSIZE_64BIT (BIT(0) | BIT(1)) -#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(2) | BIT(0)) -#define EDMA_TCD_ATTR_SSIZE_8BIT 0 -#define EDMA_TCD_ATTR_SSIZE_16BIT (EDMA_TCD_ATTR_DSIZE_16BIT << 8) -#define EDMA_TCD_ATTR_SSIZE_32BIT (EDMA_TCD_ATTR_DSIZE_32BIT << 8) -#define EDMA_TCD_ATTR_SSIZE_64BIT (EDMA_TCD_ATTR_DSIZE_64BIT << 8) -#define EDMA_TCD_ATTR_SSIZE_32BYTE (EDMA_TCD_ATTR_DSIZE_32BYTE << 8) #define EDMA_TCD_CITER_CITER(x) ((x) & GENMASK(14, 0)) #define EDMA_TCD_BITER_BITER(x) ((x) & GENMASK(14, 0)) From patchwork Tue Jun 20 20:12:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110687 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3922108vqr; Tue, 20 Jun 2023 13:31:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/MJO4cGiZtrWiABsqJchUeXJIMiauxgBVp0yYuY9aGtBiITYBNmPt+qgRyz4dkOWPCOm2 X-Received: by 2002:aca:100b:0:b0:39e:d35f:4648 with SMTP id 11-20020aca100b000000b0039ed35f4648mr6605539oiq.20.1687293079582; Tue, 20 Jun 2023 13:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687293079; cv=pass; d=google.com; s=arc-20160816; b=JQTvBXiPyvNxWmBn2zvDfDl91NhK4UjijlZNv8gnn0JoJNc2WErmQ90vEJXaAnNtMz xplPToCI/s25qT0Q5at4zyZsSG823EHNJMWTOPtopF7QrJHFxyDYdYifSdPq9eiVHov7 NzYW4F8knWA5raSCOdY4YjqgbMSiWVVHEETzpwASf7qz9NL9Ezo/EmTlpBWwckcOyyKm z/4a3HWuYJe1k4vdATwpv2uaCeiS7NKR16oVxvfSv4ZXa+5bzXdCqo+ZZoN5HM1H5enf ZJpPrHxUoRtDo6ro/lvMPhq2soMtjfOsvqQ+Zc/chw/4LCO1haxLN8P+rnqM1ow8puA3 gtMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=EWGw4Zf+HBff2ktpvDNTKgNM3Qy6tvNMDZ1fjELGovU=; b=p+LOpG7f0hFwnRgMEXnFsT9Nr0YY2FNFpoU7CmE3PrIUIwNevnpi3ZLlRRRhGOX+hC FDHajpkq8vcr3l000NrfsV9+0RXUC0mJVMeR4rjfu2sRbwBL5Lmr2Mp7P1kzRp8FNhs9 7W9PFdkpyv8wL/P315LEauFiKJfIutQwRPoTzMzIv8osAKHX1bx7zJ0WUCrBDUscrTbI PZ/gjQPjeM8jgEEEt+0FZTiQ+DGLii9sTm1kqTawtJVImdtOTKBbn5yz9lJCmjS6eTX0 3JAZlWVHAcFkIHf5jeu6tUlhrlxuEoL7ZNwVTocWE8JmQdT+Q1Za+64MXFnUuxVULsQ9 WLMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=oA5JEksn; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a637d07000000b005440b9f013csi2354785pgc.899.2023.06.20.13.31.05; Tue, 20 Jun 2023 13:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=oA5JEksn; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjFTUOL (ORCPT + 99 others); Tue, 20 Jun 2023 16:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230301AbjFTUNw (ORCPT ); Tue, 20 Jun 2023 16:13:52 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91A9B19B4; Tue, 20 Jun 2023 13:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GXECgD2N7sH8xZyLqWGJjO0qZV4yUJZPIQF+QA3u5KqhtKD4L10QRAyXZv8D0RCeCV5Vabh8EBCBEAevIX+t/hFJI2QBEH3ujrNDnetnBp7aaUhMY7qzqAdfkDUFbsbEzhEDsobRjqo2EBIUrRywaJZbSawatEljJNB2Pyivh30m6id63a1+Zl8dv5TJ86YafoIjfJsfLg4wowfRztzVXhzOqSVxDUuVaCOeNShNnFeB+Y8/EdcaovLG3WQBpRFm2OowH6RQka3BigQTc1TVqSnoN556Cp7KvWaspCDholddZ7FRX8e1roshOHf3gskX/o84t7R/NbmiDuupjP+USg== 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=EWGw4Zf+HBff2ktpvDNTKgNM3Qy6tvNMDZ1fjELGovU=; b=kgX00qiUW7aPuRiq+jm3KOOcaazOyktzxdFh/8RTu35rJo8G+8qq23woY2madGhpJXIRejDZMdvcWRtufYCCGQ87K1fl05JLrPUB+M525G2brHUbaVwyz+ob2uFrjF89d5xbZoEYGHTy3cdSjVZE/0LODiqJ37MN7A26w8+kI5Sh4PqCYBohaERlSDiqijP6n7EWO4sKm/N6rjr/Lo1mwpWL358g/TrCQvOmUQtlR5vu4XirwU+66tMWzYKyQtwyb5wytoAkNCEDGYyFbN4eVSOuGmCTRa8MDOFiU09gO/1/2z8D3Ogq9dpEM2dNpbXhZDJrr+rrg7OwBzAyG3R5Cg== 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=EWGw4Zf+HBff2ktpvDNTKgNM3Qy6tvNMDZ1fjELGovU=; b=oA5JEksnC8CUKDb89laKFIvF4WQLGS9oVaeXVYAey7zeUX3CUVe9soPSk1Yd2rHXIFHYHhKSn04DfqY9AT8iAXWAOPn65U6y2wT1MJbMUtkEqY4o95HuE6/On316xwKjgDMbbXY+oGZp4oktJfDLdYeTlMtmiHxxYg52uIiFBRo= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:12:59 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:12:59 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 08/13] dmaengine: fsl-edma: refactor using devm_clk_get_enabled Date: Tue, 20 Jun 2023 16:12:16 -0400 Message-Id: <20230620201221.2580428-9-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: f91d0883-339b-450b-3c92-08db71cabe56 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ANxSQzmW7ct/55eQXo2QQh1u63sGTCKSEaRnPLh4Gw36KH3XS6xZpJdruOeLFzrYw3bGIwsW0GC48tINDidYxnevQQnJr1OnD/OzI8G8172Ojgn9u//5bwmOjolbbckeoJs7guvG2zPU8dF+wvYt0fgbC0Pe0Af/jbTVQVRBqLvC3ZIcIrpPHVgnDoL0WO4UuqaKDXPKOopGjLoK1JGcyxcc0SoWo+tYm5taO3ikVLS5HL6CDJ/vasaQvnCUPXz6ceYefHJNUfg3X2L2+9iDM67xoNzgTN5pHY5bsyVTecxo51odavkIb6TyS49EqizpwjDrLFkDoOrzJ0kkJ0HGlAVBC7OWKXzFbzPkM1HVuBQOSW0VXKpZwFvIBw3Lh4UMRPzIp+WbM8PiL2pLLCElu5r9ga3T1EIYBky1KVFo/ZRaziCs4LK4agc8AXT4GbWynpbhnCDgXaNzpgXDRqSY/Rw/X/aWss3Zi3/H5TutVXRwFinuUVi5LOOua2dB+qz3DGGVDfVHf2My64ytPUxYQ5HMykEGqAALXDn4GnP3x1e8X19neuw0tFRb8YT7NdyeZBTY1bfWN8YRwGmcUIOROfYDTp+ftdiuwsbBdJLWwDLQ1l4NBL0FQmiUf7PCdtCrGI12G4DmOdCgdH57iljC+A== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Be56q2rBeaMeoEc7Lm0/h7P8O9mfNt+mGU3gIdk7GOiiHdglzEi5TXKBcaeoDsFVJUEplvOpe1z70m0HhJa9rFrQ1uMosQ05titnCSlON+vnR4sufr0gH7217bFYS7iSrPGyEnuJBOiOJDduJR8DtYcatvwmg3qLESp3BbmyfnVGGfB9jGJsbuSIcgS/Ub5Q7TWb/MZsb0Xs+h0Zb/tY2LIaupUFoQylczvcZ+757G2j9FlOaXsu37nFUyWTIbgBadAe6agQm6VyEHa8z1lzm2sTAOoe5ykQ3JfynNEkLQm91ds71OYTFFG7VaGTOBAXMMLxoDAM1GcEjGNDdjAJkXW67O+uT94zH0VXn/af4abXz1nSCOve7A4Dv/eGphlvyNuawu9vfR5a5l10yxOdkDO1TVa0KgZ+q4UWVHMJSiJ8uRdQya6ingqt7q7xKLLt5dm5gtGpCR4dbzGa87sTiOc9/9ZVJXG2saRM1ynaz0QUS7fotWbvarjcp4MfRVWy1g6IXEuCM4mPYldzGo0B5ZJOF2kDSHZeOdUqX/jEPbO7Ep602P4gXKzkkdGsB39B2vY8qXxAqco9N5AKcMEbUXkeL5U8QDwmahumd9J2hdSIjSyuirbE4ufx8AUfhnMoDZoEmp1Zsmnxe5U6LO259zftLNRhLClMiVPaNUibrShaBfeLsznoHYEAk3ZYkWsO+Hw/1RJI2ZcaT9AdXen++cQs7DLx8g/dZMAiufcraT+PCmyKtjK+TGWReTk0QHEcQWSSQ8hLUa1Qxlel/yb/X8WwTCOtvVQqYUTFg8/m0uyrMyjUR0aEokhwEu6gSR1lK/E1PPJg9QL704Uaxuk4ZqRLkJAYBj58f4qjPY8TN8+gFfOsPYhWLdJDqmGPR7fEYXsQXLl7npX5Pw5HDVT8FjP/AVnsDud0mkazmE+Ll3U0yYwHIMsPLiwy6wdETLG36GnlBSSwRMjFoZOyybea4SKM3vIULEtZPp7xsmLyhVCfKm/wJSJsRzoHle2mUQba3mKcKGfjX/fs0MgNGdqTXAZBaRrsELh6q6Ow0AXMLx0Wa6wAIGgh0Rr9z88fJE38hnQZDSMGpOP5owbDXc9p+DQZ1vKI349UhCYMHzNygYIUCjlOI25s3hhnTYv6kKxX41d5DDrKCU3zeCYBjhsBIJOfPQCZ7VP/rpkZqB6jZFdWJ2fbiJnXvC9TqscqNgmeH6DX80L4bSFx/UgZA7HkdohRlYzjHwvBrj9hBEQw8oTZHw9TIibHpLtskzPbhsec+FCWNanA1pB1LhUvtEdv/FMVektyIOdiEt9HT81rE74r+5nbLvECnZIbGcy+Oqy3j+BxvQwWr8jSeEUBprmvcmAKc6MP4MiNQnnQ+qbCw4Flw8EDz4BVHaGH4f6+gWpFpbpDGG2rT2ZTc8RJxLkTwa9/kNGAuQ9tTjcoizqx/CMsmDWyZBJFwlOdG0lAnk01mi1imltgA3ybDjG5Ltuwmej16jW2KjFJjjz6UoFlbFzIel+Ck6YkzrM/mUxCM2c8048jPgOSc+coyT+p6fdwAKyed4yMWhLV9O6FWXleGogkLRVjdqy7VGINPIlgrrfZ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f91d0883-339b-450b-3c92-08db71cabe56 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:12:59.5444 (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: 45i2ZZX/ppklSfioFlg+xeAIPfkng1D0vVujvswdc2QawaPQRjZ6R42sGFtPtV9cjo0JVk1jt71fQA4cVAMSQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769255027760703057?= X-GMAIL-MSGID: =?utf-8?q?1769255027760703057?= Use devm_clk_get_enabled in probe code to reduce error checks, thereby enhancing readability Signed-off-by: Frank Li --- drivers/dma/fsl-edma-main.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index a0e54ca4893c..503e5ad5a8dd 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -266,17 +266,11 @@ static int fsl_edma_probe(struct platform_device *pdev) regs = &fsl_edma->regs; if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) { - fsl_edma->dmaclk = devm_clk_get(&pdev->dev, "dma"); + fsl_edma->dmaclk = devm_clk_get_enabled(&pdev->dev, "dma"); if (IS_ERR(fsl_edma->dmaclk)) { dev_err(&pdev->dev, "Missing DMA block clock.\n"); return PTR_ERR(fsl_edma->dmaclk); } - - ret = clk_prepare_enable(fsl_edma->dmaclk); - if (ret) { - dev_err(&pdev->dev, "DMA clk block failed.\n"); - return ret; - } } for (i = 0; i < fsl_edma->drvdata->dmamuxs; i++) { @@ -291,19 +285,12 @@ static int fsl_edma_probe(struct platform_device *pdev) } sprintf(clkname, "dmamux%d", i); - fsl_edma->muxclk[i] = devm_clk_get(&pdev->dev, clkname); + fsl_edma->muxclk[i] = devm_clk_get_enabled(&pdev->dev, clkname); if (IS_ERR(fsl_edma->muxclk[i])) { dev_err(&pdev->dev, "Missing DMAMUX block clock.\n"); /* on error: disable all previously enabled clks */ - fsl_disable_clocks(fsl_edma, i); return PTR_ERR(fsl_edma->muxclk[i]); } - - ret = clk_prepare_enable(fsl_edma->muxclk[i]); - if (ret) - /* on error: disable all previously enabled clks */ - fsl_disable_clocks(fsl_edma, i); - } fsl_edma->big_endian = of_property_read_bool(np, "big-endian"); @@ -364,7 +351,6 @@ static int fsl_edma_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "Can't register Freescale eDMA engine. (%d)\n", ret); - fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs); return ret; } @@ -373,7 +359,6 @@ static int fsl_edma_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Can't register Freescale eDMA of_dma. (%d)\n", ret); dma_async_device_unregister(&fsl_edma->dma_dev); - fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs); return ret; } From patchwork Tue Jun 20 20:12:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110677 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3915555vqr; Tue, 20 Jun 2023 13:16:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JxOAjstgred/FbqMBeW0kwmmD5aq0uahqyYjjiPm8F9uNNdt7lfc4gPRIADDRRgfo85Zq X-Received: by 2002:a17:902:c113:b0:1b5:253f:d05f with SMTP id 19-20020a170902c11300b001b5253fd05fmr3061436pli.29.1687292201271; Tue, 20 Jun 2023 13:16:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292201; cv=pass; d=google.com; s=arc-20160816; b=f1rvhg/1wI4pFwu2CVrnks2NTtnf4fINLW6WSPvINhLxgB62a3rcflhrA5DZZQVWq0 R2lb46XEZ+cuppi5Kfaj1Ncq+g3BbcuFChTHl8NCd5dCVDi8N7KNdi9kQrF5LrCE9SG2 hczJD24qnsNLW+5L8+LY5PycDSyb5B6mYHRi7/i1AYxENrpnxESM2/iiDEtqstqG4xn+ /l9PqQ6RCqNv434gYQByYXO25JsCc0tNxQWcHRkDc6gq0jGYcNqKwdQhsA5YCPqZcB/M azFgfkiCU8HIKhq4shAOKrwDhnIL+o4LrEqn9SG+dJqUZB86prqWAhVTlXVekfGHvLNy HH2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Q3jlBv0SLDnSXx5LFjozJINPkoX9ob6AsqXt6WuD2a0=; b=BF+uhw0MDcioU9a4uAx7kQS1saDieMpTiQPdsC3YH1ChT9DVEh6n+R6iaw/8CCrJoZ H/+srxoa3C7B0j7uuuAJdPRDkf2JS8LRRLNoCky0WSH4OODI8kCxWN0B9oTOkfyWJs7s szmKGHCZ7okOP3HT7TdE4Ww/kPgHk24QcPXc3hBA0g+JmMR91Hvj6Fm60fEY0dHRlUEH krnT70a5F/eAv8hcp3pPABKmkbVR8zdkcu4z+LY0YJ0HHIy5VuYy5ySYhixBHwOTZl2C ilRKudtv4RidJ8UlLw4Fa5jf8vwe7TdLJs0ouzHXxkMldLw5t9iJyocesz0KQHO35Nev eI6g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=j7+4aH11; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a17090301c300b001b692a5f684si911612plh.533.2023.06.20.13.16.26; Tue, 20 Jun 2023 13:16:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=j7+4aH11; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbjFTUOf (ORCPT + 99 others); Tue, 20 Jun 2023 16:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbjFTUO0 (ORCPT ); Tue, 20 Jun 2023 16:14:26 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2056.outbound.protection.outlook.com [40.107.104.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F5FF1BF4; Tue, 20 Jun 2023 13:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e7QWUHvvhOTeCjJe/BqHAYUDcfSd6PuuolK4t/ESBTnHDVpsR0bQoPwceY6EUpzuc1Xq0zaRLUMKFYrKe44op1DRaUZL1OBGJ8ZVWE5bN7QWPn5cDP1qFIp1vXlhdP9672b3Y055/7AZ1cM9xS1UVIEMZQWYOvlx6Dowk0EEtArxdmFpvcuS+PyMaR13hK1dwju+SJ8Y8H0bwuFcpWWVOmCBHNTkgz24sxFxCykSujjE6rpwGg68753Wy8MCToPCuEkqCO/WQpqlC0wjODRgKL4fpIJ+U6qYJ1OcXactG17PgWfToX5iTD4lQkLUN2RPvJj4sFSEWS9bsC+diP1vNQ== 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=Q3jlBv0SLDnSXx5LFjozJINPkoX9ob6AsqXt6WuD2a0=; b=gFefSbbR/WPmJIyHaW0hGE/Og40aPpTGaKlkgMXXQSK8lPzBCC04B6fcdFl3sSqjPjwdeYXH6YpbpMrT7yR9xBDS1EEBJ2yWbTedJvPXKF2j7/x2x2b+8298rsBN50MnM6Ad5bfOyIyORPRT/B0LSNQAJxp+OU2CGEADzLSBUdhbqnhhmV/NcRv+PLc0S8KYLB8Cp69U+WnvMObR91fAs1YNp17JoAkAJYrM3mQ3nL3vsDYNcse34AdUvTa0HRkSoaOAepnIz2t6V49LSY74Sn6hA8q8AObByjW64LKt0jdYRmfzLU3j1j14Xte7O/+vDcdDxH0biIhmixDFWceoWA== 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=Q3jlBv0SLDnSXx5LFjozJINPkoX9ob6AsqXt6WuD2a0=; b=j7+4aH11eCFyVij5R1SKuN6A1q2kACxtTHX5JKxkcKLPUldlkdeEKvM3lFNU4QPj5GGd3TKhsfizc695+jp5g5Ya9hjjOkRMYyLXeA1LYNQKD8IogJ6ZNiGU6jmD7EA2/4YSdkITLfm5FlNvO0i/yknpWgLtRKfxCEtFB09wpmo= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:13:02 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:13:02 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 09/13] dmaengine: fsl-edma: move clearing of register interrupt into setup_irq function Date: Tue, 20 Jun 2023 16:12:17 -0400 Message-Id: <20230620201221.2580428-10-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 10921907-3db5-436d-34b5-08db71cabffc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f5CS4KihdSdZeBKZQsd+bANubMvfPrfqPa58Dftilcfiypwx7wl6MlLDi7O5JR1AKSwPwgtRXakChqz3t7QrQ4nz6u6BcZ9LY7UUS39ZEEjvBp6jS3TSXxtsly+uiANOwzC7G3NEHlsa/feKIZmGjJ7APiM8bnQYu6AFCPag8Nzs9ovGGcaQMFOkLjwc8hJQ92kMXHe6CGA4SDhcruIy/tETizIrNSbMgaQmBBpAsFU66nmuf+b5i6FVYnhPKJs8GdrANrBG7jIdIFvsj/drKioJd+73lRHKZC1DLAPQyjgLGcqrbHc/vzxj3uVfz6Bnrupsf8MEHlX0aTf357dC/eCOos1EsrRpom29zQQCcCNy7y0AVWxrM6xeg88xrQI+2vQ9fk/AkUupxvAsHIVATqXq3ratqCZ0i3ZG3nk4HnA9QbN7s1os5Od/oyCz7/v8wKrzLQ2FUPF2DKQbRbV4Jgu6fe1bkZXHD0k6SUwJQYFRYokECsxnIZvag7FjDABgvfhNIbqspuA8gb828j4q+0b0ZC9+Z1wQBIAHb+ynMFAQDNXh1y8+QxfkCa182qA/Wvyx0S+V/0kIBmCZg7Jj3LXRArU0Kbd9jrwSmAtMbSr4aXKDGznTSC2t/TXRby9EfPrxjRGfb/xnb2JXqwOwzg== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OLg+OuLYhjUU8RtTveseBeuMwfhcZt228ZUlFhiYRlPKCb4pvTGqh/gG5vp2NuyxlrIK04XFp/IvHYXrHXdEaZn26HzLptibJIWNflFitbwXOwrl3ofHKD+9MMk/GIZltqyFIvNrFxhmAZfRe1FCCHB7I/LjrtEhatLudvOSHC9GgnnyPHsKtujTJ76Mh5UJZePnuX+uB2yJT8hsf0E8XcpMYAsF5ZLTAMqCpwWAUHHEMLfGD/AZLlYHUByJ7zHrs4xItpQPyiI3NV8Ow7owYqVGBTJLOP9NFxzDQjyxoqa7Tmt4c5eM+gTugoUI0RTiEMxWM7ffQ1sRkfbR/RTVP+k2AEDon7wqOcpBr/LVBtZYfpmW3bb1zE3GgR64+tYyj4g73WAWYFf0vXqj7n4jzHygBI2ZqV5RCENtx/R8LM/0PGwC5zwC28Kdhe3gNuV02BMJ9602AcWx3P524rcuBTtL84vMUOxH/1+JTEFwuwlp24lYzbaj56U3ksako8q9yQC4t6etbAwozAlNp2mbk/FRmgaTrGPpiqC2M+N+aXNxbGJtDKC4XQIphWWMPCAoanZGjEGaUb6S4Zn9ShtMmCmtPrmffU6kcGV/NUlt7MclXCTMo5nxkiqU9ugsttL41Miv/ZKvrPxzsuZtvwd6QJHbCqBlpe0VRLAC5XaFkNyPPk/vfsmbK5aCWV1QdUZ2u7akVfPy4xSNbE8GDfUBCJ8oyyhQOy7n2vAsY81u2iSPCShnPzZcCB4SUZqMPz9jE+dIr5QS0myuHxZrZFALUWkYinLOkoL8Rsexw+aa+HTXrnrFq8NsrMrCYlB1ORUz53WcP8q/6R7YXYru6spalDX4eeTInWMNX08P40fcP08S3ALaF3EzQiu+8s2RdMQipHIEBdpB2MNPY66bJGdW+2lFNC8t8g2/CT1WskeQA+1b5w9PZgcMHkol+OouFSaCq1G5QumTzemVygCPG9sWbr4kpolDxmN1tGIZ2QbzsQpQGzzCRZdTBYtZmuB102AUvMFith1xPVIWavIC4GM50+cD9VNBRKhSeMAugG9TLYCoJ/DwhVIsLJrKvCLFk5VxTAY/KwR9gCJ041QadxUat3ZKaIsWHG7fm8ziXsJIhvlPBTUi9vTNkH0CGsfXvm2vFxrk26EghpvBj+42FoggdRo74wIdqUU+UUjYkyAvJ8ejKXhihyqUNlD0Rcs2M2LH/KjArRrOzGUz/hir2KBDDoc1N/lVp17G9W33f748tcTosbNr5VhgY2iVuABdyiuT2Fg7ow2CyxcviPNKorzZq46XPc1hnsppoJqmXVfdqDXyzM1bgxHKuQGSBGsjc9TMuF+oF76omE4hJ4rrcqlp4YzGZhTCD1Q2h7XIBsQ9gxiFfUKs7SiwmVyCFaaHxlGL97GRz1MOZxvZeGOQ90uq+5/0JzYPyFv8T5aHzbv+VwDGTNXzielDmrvI/wQLUhJRlFfE6KMNy51FZ5F1WwRBnJraH+dBBqPDyjNVm3t/sfe2Jk1gycsY5aWOYEBfkFGSnXzIwNOMvrCsocubGHdRH2jKVSMWpI+Fgl1GJDqUinPbfpaAuNNEXyo9bl9ju0DV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10921907-3db5-436d-34b5-08db71cabffc X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:13:02.4308 (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: AsyjJus/7DXwJaUCq6GXbVrDHZf9Wwyj0RcrAEELGGqqIMvbYxVF4meYiUXwYFpM6SRit0jihMF10aJEusuZuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254107419507240?= X-GMAIL-MSGID: =?utf-8?q?1769254107419507240?= This accommodates differences in the register layout of EDMA v3 by moving the clearing of register interrupts into the platform-specific set_irq function. This should ensure better compatibility with EDMA v3. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 503e5ad5a8dd..e67aec3f76b5 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -113,6 +113,8 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma { int ret; + edma_writel(fsl_edma, ~0, fsl_edma->regs.intl); + fsl_edma->txirq = platform_get_irq_byname(pdev, "edma-tx"); if (fsl_edma->txirq < 0) return fsl_edma->txirq; @@ -154,6 +156,8 @@ fsl_edma2_irq_init(struct platform_device *pdev, int i, ret, irq; int count; + edma_writel(fsl_edma, ~0, fsl_edma->regs.intl); + count = platform_irq_count(pdev); dev_dbg(&pdev->dev, "%s Found %d interrupts\r\n", __func__, count); if (count <= 2) { @@ -311,7 +315,6 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma_chan_mux(fsl_chan, 0, false); } - edma_writel(fsl_edma, ~0, regs->intl); ret = fsl_edma->drvdata->setup_irq(pdev, fsl_edma); if (ret) return ret; From patchwork Tue Jun 20 20:12:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110678 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3915663vqr; Tue, 20 Jun 2023 13:16:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71QOZw8x5HGkMg3D8YLgy6R6rutDf0vadw8vZMmGEgdE6FuCjSBiS/PwTRshq+/ppEWAuS X-Received: by 2002:a05:6a00:22c5:b0:668:842b:be60 with SMTP id f5-20020a056a0022c500b00668842bbe60mr5680137pfj.29.1687292216238; Tue, 20 Jun 2023 13:16:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292216; cv=pass; d=google.com; s=arc-20160816; b=wEuKGqk3jB4NsyfXV/H3gs76QR3s/hsOizZFSoNptyZXYAV7aDF3V4obwMTYmspq/4 Qfbo/qdIApSy1QjFTZYKp9Opj/wneoRoUt27mqRYzIcC+0tkU7BGnlBtoTFsWM3OAGoY 48N9GFlRSef16fgtkwfLa5CME1lDANJ5yj0GlcM7lfxobWkj5QL8YsW9ebbyOit2TPD0 /vdAvDHASgHcGPJE21IrfSfUEpqK3fmxFrFRaHguw8epJAxn7t9tJnUK7IJhqUJtU4lR 92OLoLNKuYL1QToHIdu3IIR/awQrUHkeJW2jK/EscZ9/eP30tAnNBF2YUu+RSgXOKO05 1D2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bnuduEe23aVNqNQ/tr/oGRmipeDq3TVAdHibMWxJevg=; b=YYPe52ncFe4BIFKYIgqIjOwMRlI7Hs6L1ah+ECJEv3n+pMD9DG8+0TdryYfraPRF6v aaKLve4rZj7euFV4S1ALzkO3bClEzPKDWGKHTCmI+Ng5dFUo68homUdsHVMhVVc4GQjd SXUZyOR2/oJTJ/exX0WYpA4k8OCWijgzoStFOq3mpyXCEMFr5v1+LjNzinLyvYlQuQW7 0Jl0zHAHYndm0wpodjCK+lJKshqqBeJb6E05LWlHqPFKHIwtLN09bJAj6Qsl36XYF0YT +/QjwF5L59bTN9FuG2Xtv778wuqij9vDUpHKYpd2263NjRJPWd+nZdZfq2JNhCiccxzc 8PGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=GorKs4p0; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v190-20020a6389c7000000b005344b60f7ddsi2411592pgd.117.2023.06.20.13.16.41; Tue, 20 Jun 2023 13:16:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=GorKs4p0; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbjFTUPI (ORCPT + 99 others); Tue, 20 Jun 2023 16:15:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbjFTUO2 (ORCPT ); Tue, 20 Jun 2023 16:14:28 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E6FB1729; Tue, 20 Jun 2023 13:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QMsqmxwTDhHRpMT99HcvPOZot5mM0ccEP3Kz3uXb7DiE0YIr5Yup77DlGHJmSswjvzv4F31Qb6EsePLB6FFzI6nHaPCawAe9+PFGcYv2Y5XgD9qYXVwqWS1PS0kMWu2k7+I3AWcOK2WeZ+wYNrIoN+xmG73tDs4E/uoSxJUC2vE+ADGK/+3BOZT5qnQItYAeCQV+IMED2qrkMmq0EmSJtwdUw3eExz4MZo9rscitAiGGHtkYWJGoGlDR0xnSj86T/QsLcaWUhxe+2utbMqGtJWgxAkfoUkI/jHnqgkIcUGTCYRaN7fbQbuDtyEqxA1zLOn7r4KfhOk54hxJK18qy4w== 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=bnuduEe23aVNqNQ/tr/oGRmipeDq3TVAdHibMWxJevg=; b=l3WCknxC0PbTEYAgmKkPv9Th1/Jayq/kJb6hnZDJ2ALTat0Z1S3WgHNQ4tv6v9JGYl9oMpgYW0XeXDm1kDIuLspYrP1tY10pRprShr/PngAvfA7je9aFCR1ZDo1Q8SspK8DyIM55cm1koKRgSHtipVaLJyTty8f+yb/s0TgT58By+9vEKRG0NhmarApFli7xKa9dZbwr8m/GK9hS9ivSGDxUwAn0DSCcyrbx8j/3XkSkPZKeuE/PDJrs7Zs9MUDtV07vlwA9DORac2K4behqy6IB138bD0Yhb3AWeVt5dswCOLziRJvchn8muQPXZIkhJ/4tV7mo+Uq7NxYrvwCvDA== 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=bnuduEe23aVNqNQ/tr/oGRmipeDq3TVAdHibMWxJevg=; b=GorKs4p0HEr5F1551M+NiZYzQIU1FHGDJ64DTzF6WOZ4vmfmsgv4xDey29VesRetME7eHiCjoT5Q+RC0pYc1dHshL7BVHFuiWgxIO0CWqcUtpzB05JGg6COroUk+jwCMhG5MbaYq7vogCIdmSqi03U+GCdGzVbv3d4eDjvHcQgg= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:13:05 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:13:05 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 10/13] dmaengine: fsl-edma: refactor chan_name setup and safety Date: Tue, 20 Jun 2023 16:12:18 -0400 Message-Id: <20230620201221.2580428-11-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 96a15e49-af97-40f7-a197-08db71cac1b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OFv6TI4l8g8R5yt0bEAzlKf+4hwMCdL1t6Qc6kLXnCuKauQpzBSDLWOt3N1nxNFchOqUBtq0utP1i2J2jQIOWxoPx6yK7fJ4JiY+va90uHTN3EJJ4fW92iQczg29y5kJS09u+i+GT4kum9+QE/Rh9N+nyjh3J+ondGiys3UvCHJtT3gvRuyYL+d/ZJ7Q4cg+OeDoOtISbJ45S8hWn+BE1qzEP+Ra/QCEdzjqHENRQMRNT6dIdM0XRc6Ztb00TfJP/lSWaFr3Qgh3KwMEfg2kJgOocL3GVgqCLSH5C0dlresUHEGlTvHkpIKBZHJhoz4paRzMbJwp2QaKRBechYM/VP0bJYBPbqxGkb6RtajtoLzqsPdhs8CYIzXdldSJTR0laMmnTzBedmXXO711/ugIAieiYeRI4nv6i9isOL0r8dx5+9YZKc50ojqiWDkzWe5MnnsVJHkCAqpyJMdqHR1X5RGJz6K6sjrPV0jzJLRME1h1j2tEeCkB5fS2fsLDUu1wT3pgkPhttHb3HqhYe9sb4XIc5dYqeDQaOCrpNArt5MwpkB6xMr0ux6mALLokm6pGlPc+5PD6Bje+hMHOS1wTblRdM8A8uD+sKmDSFNDtG+dGFF6m6E0rFogKaaIuNoWkZtdW6VLqqsMQwN42H+R1qQ== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q78+3ZOMP9yXw3KEMJNTGBWtDxRe+APCgGHNt+4GvPGzTx4oLgxqbcZauq9Ul8qQ16LOYAvHJkQcV8Cz8yOPOfus18EiLxS//hoIozU+CWELoVWI8FNoNhu+o8qfPN4X2HxTP1zsdX6QAKNJUZcvrhbR8ctmg/gasDNEmr3dD8J1WmXS6IZ+qURg+8NFaqyQkb88GS8aDzgL3g9VBj4aJKR+13AHZ0KbkuYLlxM0OiFABwSFdB+sAhXo8E5m+DP77E+5hXyEkxsJiKhIQWAPw8EmDkXwPxGVFOjyivIWkQ4JX5tWWv9Tsnu6tAXOf8ylLIeY15RRLhVNVX2jjregoz0wywFF3SOlyhB5CDtY6GXfpqs+GC1qJYBUpNsB/qIu6fW7Boe8uVa8/aXPdYFhyglGIOXd2tq9dC0zYcvWMhj7eP5jGFpaMz3k7ZFuKGG5DyVFY5Wmjd1NYN8bhsQrQJQViANeQXhV3YYZMXleuCjB9XJegAlf2LXrL969Hs9X2ztzFKza3pvloQZUybA/n1m4TlT0JdD0NrSZvVDmCznY1JGwfTX6YpmK0ExGiBZ9J41sq3/i+RJCSggoZuSr8SHcKhQC3jnc0YxczFSjyrxyHZdLxCsw6+as1gO/KEk1aT0L3aV5UYBVvVAZHUcg58msFn7eF5Jh8xkGVCuYN3u2x9UMqyqdYsjqQvy8Oa11WfzdMMZRo8iuAWuDD13mIqRw7g0bIiFnhjD3yz4gHmQZYtKAcTj1LaltCRCR25MdEEReVV2/Pac+YcFuvy6La5S9SOPSXHB8nQOmlT1eXJHhXSCGUjRePrppVo06DjOCOMCvbjpAZVz+m4/RBE0CZIzcYTeG578RPcVL1rP80QUwqQiQbmTPMGR5NnLKkj3qJmVkAQyopMVai2/5XEb1mZh/HYepPrZ1V5q8eFDvmssl9uwfUfmXDa6rmtPfnIsO5aTR7PEY1gINX2QR+3lI50XnlV9tfVbpwEIdG6M72WEC0zhILp8OlqZMHuU2SEeD63hlBz8EwavYvX7An75vI9EBatbsAXHXJYmRedo1v3e179cj7nGmocPjUdpkoWUxfDgjYxQLWW4f1pOTpAtH/JRnZEJvondC1o86ZgeeBtwUUSsq7kA0WEftYbWCuc/bkhANf4NSq0v5HlMg0X2mPjAC8KoZLwdg++AR4JXTvpXEjbJRy0lOQO0E1jd+5tv/sg8jRJk2kHU0FDnH6Q7G5uwj8NgfbOcaOJI2k57jKOG/Gf3SHnq8imPTaGKNQCKjsBbZ6wA/ciTcogFO6UA/SzaJiqrQnC10WpT96/x2RhprGH9Z8TTGa+/Ur/FIo0IcbLuoURFmsRSzEBoVSJtvVLEUKqcmqXbmCIPfxAiPrxy0ix9D7aqQhmtbRog7MHNdeHKXOwGjW8hg6Dp7ub39phj++76HErI5/MKzGqFxpwZiVXHh7uAVqsK1R7pVReQm7DrLucWLJGi33DBE4gykoWjLSvds3uOMRbJk5rpbx+pzrEvyjPR96viecTr4dC8m4vSIz2dqiPUXzwvK6aXSrjUymcid4S3E+kvvD2COLCkr4ovHPwW2dLXfq1+VDrLB X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96a15e49-af97-40f7-a197-08db71cac1b7 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:13:05.2016 (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: +nlHxiMlV48v8qviwV2NUtXKnzdst3Zpqh03KC+ticbS8YYd9fPVmAz/MTTfjotsp+H9JBhpGebEO1tGaNlo0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254122809679341?= X-GMAIL-MSGID: =?utf-8?q?1769254122809679341?= Relocated the setup of chan_name from setup_irq() to fsl_chan init. This change anticipates its future use in various locations. For increased safety, sprintf has been replaced with snprintf. In addition, The size of the fsl_chan->name[] array was expanded from 16 to 32. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.h | 2 +- drivers/dma/fsl-edma-main.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 521b79fc3828..316df42ae5cb 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -116,7 +116,7 @@ struct fsl_edma_chan { dma_addr_t dma_dev_addr; u32 dma_dev_size; enum dma_data_direction dma_dir; - char chan_name[16]; + char chan_name[32]; }; struct fsl_edma_desc { diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index e67aec3f76b5..e2fbfaf9155d 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -175,8 +175,6 @@ fsl_edma2_irq_init(struct platform_device *pdev, if (irq < 0) return -ENXIO; - sprintf(fsl_edma->chans[i].chan_name, "eDMA2-CH%02d", i); - /* The last IRQ is for eDMA err */ if (i == count - 1) ret = devm_request_irq(&pdev->dev, irq, @@ -303,6 +301,9 @@ static int fsl_edma_probe(struct platform_device *pdev) for (i = 0; i < fsl_edma->n_chans; i++) { struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; + snprintf(fsl_chan->chan_name, sizeof(fsl_chan->chan_name), "%s-CH%02d", + dev_name(&pdev->dev), i); + fsl_chan->edma = fsl_edma; fsl_chan->pm_state = RUNNING; fsl_chan->slave_id = 0; From patchwork Tue Jun 20 20:12:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110679 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3915701vqr; Tue, 20 Jun 2023 13:17:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5D9xSDIJ/tOIu7x2XSdsFjjaAhSyta1QxHm6GB7iGdAl17Zr2BOhMvhrylC2JzdAbpR2VR X-Received: by 2002:a17:903:483:b0:1b5:e33:b0cc with SMTP id jj3-20020a170903048300b001b50e33b0ccmr8220866plb.4.1687292221718; Tue, 20 Jun 2023 13:17:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292221; cv=pass; d=google.com; s=arc-20160816; b=mM3rxWlfmN/yrWLahhG/Zja9TL5SzS8W7qxQ7nGSHBSIPLJjIfVVahmKZL03jmaTBJ rofE1+h9cQWG8Sh3OqNBSmhusWeXiAvQ6Hu5JppWk0SJJuv98+3Jqx5L01/e2wc76fNu Ufi561EkOQDH3dqCnDgvc/D5Yit+hfk4FswVpngR3yIP98wfWBU4jLnmwWF+MUA1AieL H3pflEvccCephHAhpHTtfeW+NurvAUgNJBWw86naXFQbINVzF/WfjDwDRIdqQnibNEo8 P+Hh7wnd3sanWp7OR56P9ACmRv0dOc4FHGJ2+ibwOaQsPnxnRVl47MuL1PP6mi6gsJTG aJFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LwWZJ1o2vN7Jj1Wd6gxZKukLqr0NduZpRCO/jcgnVtQ=; b=Vk4YyV+vm9bgh2lpIFz+Fj7ShilIzceGUE9ZGxLfb7swz1abPLah0Z6cKbUVNpSX4U otHBaGhkh0iK4aMZExrbs+TYh2ghjYxRJbTUwzAXtzVjV48hfGFe2tk3T1JKDBBA2i74 damBcz8i0sx2982tUYyDz1rJ8x45AV6zQpQCQspNE2+aXC6BSMYS5VqCfyucXr7AQk0r YZwn47iQhmIfUSkCZ1grbFC7YlBw8iH4wbeFsOIOQr6+KUnZsGzYaMXNU7hbnM/UlFos RCce+jPToNpMx1/CKU6OPhE9mDBq+JgRdICzHormlbfa+7SCL2muQwihTcxObRTxRxfV yk8g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=kTxt1VhQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a170902b48100b001aafe3f409asi2357674plr.205.2023.06.20.13.16.47; Tue, 20 Jun 2023 13:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=kTxt1VhQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbjFTUPK (ORCPT + 99 others); Tue, 20 Jun 2023 16:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbjFTUOo (ORCPT ); Tue, 20 Jun 2023 16:14:44 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2056.outbound.protection.outlook.com [40.107.104.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A5F1FE1; Tue, 20 Jun 2023 13:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j9oyWpTYAvdaWVFBnFAX/buFOgwK2CD5+x7+ZmdcoouA6AqE7UBJUQb2cnprvKs0t0lxMya7U8zfNzxLRCl50fM6Mhgs0TtxSuYdV2h6++cLh2c/QdroLc9tCNeGZ0bmCXBNIeDxJj6o+v9qW1NZqTPGQSsT6NDVMb04bWtfLzrkEcU+kg4EYV9FVHxmVldfzXAHcOny2RTVQLFU5OXbvtGzbq3OEUHgie7oxzXADsnPLBgioJXvRS8yap9K82eV3zu+246hJUUyNv3X+hwZLDuI+4HGLrEGuVK8PhNvGKK7Bxmdbkaux5NI1o15V+O6gyJMd/PFIJ+OjGD8qXbVJQ== 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=LwWZJ1o2vN7Jj1Wd6gxZKukLqr0NduZpRCO/jcgnVtQ=; b=b6gd/iymS4AHdx0UaiIJa4UOASEVBBeUtkd+FyDwalaMKm+/383mf4HAU1AM9S4uPKVDSBQk9qDg3CKuENZ/jvAanTAbWD4jpUHdrifCfxfTA0WnOL+9gHn1wOs03sJ+ORC+tpalIkXNVKF2pWuXi5GYNkQS/JYTu1brMZC4M+LA3BiZKwUrvvui4fQKg193sfs2meLDuH7wpsJHpG4FYl27CmIO/03JUzSUPRgXzwhV27PE1B77uMLKrJ2HqUZVmnjSrmkB6QnD+L45ZAfq0hTZheYJCFwXuTrmMfLYtnkRaeql2caWoAPoxHKFKqk/7uyUR8qi239HltWNFGmevA== 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=LwWZJ1o2vN7Jj1Wd6gxZKukLqr0NduZpRCO/jcgnVtQ=; b=kTxt1VhQ+db6VbtGc40ufrw0utoksElyUyHJQr7HQiKpc2XmUZXrdwCL1Sl78iM1OkrDkfsSaSXm5Knf4ZHmv+Z5sTWlksLeaEaN8ABD9tIaIqXqbnehBzEr7JAn/TiT9pqn2U0i89ATIGOggWCdHQHQsTIzUTptfE51dXU1MF8= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:13:08 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:13:07 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 11/13] dmaengine: fsl-edma: move tcd into struct fsl_dma_chan Date: Tue, 20 Jun 2023 16:12:19 -0400 Message-Id: <20230620201221.2580428-12-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 00f46712-0b54-44c9-99ac-08db71cac35d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qoiU76dCcJNPEYvMlMo8LwRxmaWgW9jQfLc+YbMOnZbh47/quN+kUAZ+cDcWf4Y5EzvdIG053Jbrk5LKk6Ix8XvrJiOsE0W0sLyBOCNG4cBbcdGOyTA9vjOiadWGuqUjDjZk3I6x8PfDbEdi4mFoOnm7nzeWqfuTIevfKKpyg1NSEkC1iAaOHitfz9GBvLQHQnIv916lF369uc2QO/cyqgSlcPM7VYTThDwae9Djjx4A+NwHY3RC4vOIr+h4dVbNcJukNT99jE0LjNO27FoXGG5Wz8uFdbn9GzvFFU9EI4yPPOxFEkCCgI6f9ZqpR1L2osR4jHaL01HziBGoiEuKZxyQNArTacRSIaXHwc2DyLHjtvkErukD5mY12RwupkHmbajWcuo4OEj0BhCX4p7ZSeQMS4OwM98JkzglvyqoJlsQvU9+U7zhJRbIB6LzQ/velNmtqYh9TyZpwz4+g8REQAUNlLcUotjm7xyd5jtrQrPC360xIQf2KBr7Wp7B5izg2riC8Dz+V0NlWOVfJiOJXM8L+ywLqt3W8SYvisrJr805xaEM/fAuOoLD2yh/ZFhwc8Cx1VeBxikeOgFBmkoNCHEuRDgvX+Sf+Sgibm0y6eKoBJ6NZnJYWJBT2Pl1nvK3 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(966005)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9obVFexMGZpmAr+rUoprcQYlInxqZYjFh7iQtdY7eQrPIiHZfCJkA9XTl+pHLQaSxp0DvYBLIJPrQ+T2HPZkQjlqB7olp4FgzjGOOrYurmJrQnIs6avgg0WDdfVmwmh372+li3f37dLKDmwCtv6QDql/gmwNcHGe6vbEvsTaOC0URaJndy3W4qGvvkJzFHfY+tLM/iulXsksgRQcadVifb+nrakA/EqFIYJTI41D/4GLiRi10IeIuLfhdOTPvBV0GE3/wmq+VhZbu8z8QPTD29eHNOWWu+aov5UXyEC5DluKNQwRwAjWV2jHQP7utaTsZb93mkTLWQiKLmJrLhqrUnBnGhJEyJ4DA+lzII/q68FdRkt9CieoKsjCD1EQJLDXwR5xw/GYCF0lU5ENBybo/HiIWN6UQekecMzBgmsTm1QqaGiSPdAGLG64z6wLN44bNFXq7/HMtflvlJxXhE9hDeDB2qPtFc9Vy0j+cH88qGnjZJ35wKP70u51931CJQcVbuOof6H38d5oGVFOi1+wP7ukNrvIABPR2FkJS74GeY1FMCUQv165TepTY2DXSSNpz0CUp68IKKOLblePK3Ydf877QcQPOiKIjGgyCzrIREHISl6+JMYS1w17/PbkdX0ZrUE7QEkVzG7rGcZfuwD0sd6AzrM7AVWmWaOxer8eaIphQ6OZxrCudmR4T7QcyyrihNIS9v+qvRGV3dFOv1xJe5XQ0SMubMNxQ2B0GM7ljrmBVG5ixOBod+ee40bbntyU+GqvqUpSv8FPkkmNa9wQON3Jf4W3ulgvMV9XGvuxTTaHNO3yi2ffso825+M1dp3A1t293dCXoVgLm43SxRmM+L11gST2tAFCZ0FAnzvfYyU43MUPC1VargMD8d0WzttZNozluJvi9GVlH1daF7Z19438X7BRdDTUkQMOR/XisbdJnrWXPcXX/GwWlsKnPXdur7CJxx6ps6TxpfKcLjC36aeZhN4DrkDZzhzKEgi9wgeBSm6kBdYATfoTBbYXVIKUFVPzlvrxVCBjE8MGVghNSxQuA5P4jVCxs10ZPuhHKp6sOk8YSEIb54LxKl4z6BqEADRCkzp+yZvNgUyOMqHilleF0pdBgQyYWYQX6GtLLaFoddcQCXgOrjcNVyUiGAxROsf5c6Ty+NiYVOtCllTyNFackt24IfcGyau60S48HG56ClEtpaDYFpOlmoCmYknI1pPQRr0UpZDMEmdlubLspAQEjf8sEK59LIKSj61Ufvq/tKC2X9/D2isVivmoTEW5ywgX4IxsjTdnNo0Z+0dxLH/Yh52Y8ILLFeQrrjj0P3hF2I7gJlSJEpSUWxYqrjXRQBcazT4xjtAve0D5jvejbx3nrUFexkAt2LjGcyfUWcTZk2R/gBtLbzEow+dloTJdHKWpq/klqe+cymtSfeo4bX836vt4Aa+6I8lB6P9as/jPS6Knvb45bdENyXe/DDMQ4SrWKyREDim2DFPhV0FiHi7IQeKfFQ0uIP9J/ycBT+wX1mC31xV1ELnoKqgnLpVXFdar8wIaEkv5BiTK06CYlG8wiVybvmuQ2SvgNNHtMI69Cv30qd1Vv/nQUuJtkxUR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00f46712-0b54-44c9-99ac-08db71cac35d X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:13:07.9699 (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: DrMDcRJIEGKsmIgEEiO5QDdSIH8ypc+4AqB8+nvCqiBcamhJ3qR5zp6gSn9/2FQJjVWHQYn7acWJm50wHzwI/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254128419890434?= X-GMAIL-MSGID: =?utf-8?q?1769254128419890434?= Relocates the tcd into the fsl_dma_chan structure. This adjustment reduces the need to reference back to fsl_edma_engine, paving the way for EDMA V3 support. Unified the edma_writel and edma_writew functions for accessing TCD (Transfer Control Descriptor) registers. A new macro is added that can automatically detect whether a 32-bit or 16-bit access should be used based on the structure field definition. This provide better support 64-bit TCD with future v5 version. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305271951.gmRobs3a-lkp@intel.com/ Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 38 +++++++++++++---------------------- drivers/dma/fsl-edma-common.h | 22 +++++++++++++++++++- drivers/dma/fsl-edma-main.c | 6 ++++-- drivers/dma/mcf-edma-main.c | 4 +++- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 51fbd7531c74..eead6a4765f7 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -40,8 +40,6 @@ #define EDMA64_ERRH 0x28 #define EDMA64_ERRL 0x2c -#define EDMA_TCD 0x1000 - void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan) { spin_lock(&fsl_chan->vchan.lock); @@ -285,8 +283,6 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, struct virt_dma_desc *vdesc, bool in_progress) { struct fsl_edma_desc *edesc = fsl_chan->edesc; - struct edma_regs *regs = &fsl_chan->edma->regs; - u32 ch = fsl_chan->vchan.chan.chan_id; enum dma_transfer_direction dir = edesc->dirn; dma_addr_t cur_addr, dma_addr; size_t len, size; @@ -301,9 +297,9 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, return len; if (dir == DMA_MEM_TO_DEV) - cur_addr = edma_readl(fsl_chan->edma, ®s->tcd[ch].saddr); + cur_addr = edma_read_tcdreg(fsl_chan, saddr); else - cur_addr = edma_readl(fsl_chan->edma, ®s->tcd[ch].daddr); + cur_addr = edma_read_tcdreg(fsl_chan, daddr); /* figure out the finished and calculate the residue */ for (i = 0; i < fsl_chan->edesc->n_tcds; i++) { @@ -358,9 +354,6 @@ enum dma_status fsl_edma_tx_status(struct dma_chan *chan, static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, struct fsl_edma_hw_tcd *tcd) { - struct fsl_edma_engine *edma = fsl_chan->edma; - struct edma_regs *regs = &fsl_chan->edma->regs; - u32 ch = fsl_chan->vchan.chan.chan_id; u16 csr = 0; /* @@ -369,23 +362,22 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, * big- or little-endian obeying the eDMA engine model endian, * and this is performed from specific edma_write functions */ - edma_writew(edma, 0, ®s->tcd[ch].csr); + edma_write_tcdreg(fsl_chan, 0, csr); - edma_writel(edma, (s32)tcd->saddr, ®s->tcd[ch].saddr); - edma_writel(edma, (s32)tcd->daddr, ®s->tcd[ch].daddr); + edma_write_tcdreg(fsl_chan, tcd->saddr, saddr); + edma_write_tcdreg(fsl_chan, tcd->daddr, daddr); - edma_writew(edma, (s16)tcd->attr, ®s->tcd[ch].attr); - edma_writew(edma, tcd->soff, ®s->tcd[ch].soff); + edma_write_tcdreg(fsl_chan, tcd->attr, attr); + edma_write_tcdreg(fsl_chan, tcd->soff, soff); - edma_writel(edma, (s32)tcd->nbytes, ®s->tcd[ch].nbytes); - edma_writel(edma, (s32)tcd->slast, ®s->tcd[ch].slast); + edma_write_tcdreg(fsl_chan, tcd->nbytes, nbytes); + edma_write_tcdreg(fsl_chan, tcd->slast, slast); - edma_writew(edma, (s16)tcd->citer, ®s->tcd[ch].citer); - edma_writew(edma, (s16)tcd->biter, ®s->tcd[ch].biter); - edma_writew(edma, (s16)tcd->doff, ®s->tcd[ch].doff); + edma_write_tcdreg(fsl_chan, tcd->citer, citer); + edma_write_tcdreg(fsl_chan, tcd->biter, biter); + edma_write_tcdreg(fsl_chan, tcd->doff, doff); - edma_writel(edma, (s32)tcd->dlast_sga, - ®s->tcd[ch].dlast_sga); + edma_write_tcdreg(fsl_chan, tcd->dlast_sga, dlast_sga); if (fsl_chan->is_sw) { csr = le16_to_cpu(tcd->csr); @@ -393,7 +385,7 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, tcd->csr = cpu_to_le16(csr); } - edma_writew(edma, (s16)tcd->csr, ®s->tcd[ch].csr); + edma_write_tcdreg(fsl_chan, tcd->csr, csr); } static inline @@ -736,7 +728,5 @@ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) edma->regs.errh = edma->membase + EDMA64_ERRH; edma->regs.inth = edma->membase + EDMA64_INTH; } - - edma->regs.tcd = edma->membase + EDMA_TCD; } diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 316df42ae5cb..cfc41915eaa1 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -48,6 +48,8 @@ #define DMAMUX_NR 2 +#define EDMA_TCD 0x1000 + #define FSL_EDMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | \ @@ -93,7 +95,6 @@ struct edma_regs { void __iomem *intl; void __iomem *errh; void __iomem *errl; - struct fsl_edma_hw_tcd __iomem *tcd; }; struct fsl_edma_sw_tcd { @@ -117,6 +118,7 @@ struct fsl_edma_chan { u32 dma_dev_size; enum dma_data_direction dma_dir; char chan_name[32]; + struct fsl_edma_hw_tcd __iomem *tcd; }; struct fsl_edma_desc { @@ -156,6 +158,16 @@ struct fsl_edma_engine { struct fsl_edma_chan chans[]; }; +#define edma_read_tcdreg(chan, __name) \ +(sizeof(chan->tcd->__name) == sizeof(u32) ? \ + edma_readl(chan->edma, &chan->tcd->__name) : \ + edma_readw(chan->edma, &chan->tcd->__name)) + +#define edma_write_tcdreg(chan, val, __name) \ +(sizeof(chan->tcd->__name) == sizeof(u32) ? \ + edma_writel(chan->edma, (u32 __force)val, &chan->tcd->__name) : \ + edma_writew(chan->edma, (u16 __force)val, &chan->tcd->__name)) + /* * R/W functions for big- or little-endian registers: * The eDMA controller's endian is independent of the CPU core's endian. @@ -170,6 +182,14 @@ static inline u32 edma_readl(struct fsl_edma_engine *edma, void __iomem *addr) return ioread32(addr); } +static inline u16 edma_readw(struct fsl_edma_engine *edma, void __iomem *addr) +{ + if (edma->big_endian) + return ioread16be(addr); + else + return ioread16(addr); +} + static inline void edma_writeb(struct fsl_edma_engine *edma, u8 val, void __iomem *addr) { diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index e2fbfaf9155d..8ba705080f5d 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -310,9 +310,11 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_chan->idle = true; fsl_chan->dma_dir = DMA_NONE; fsl_chan->vchan.desc_free = fsl_edma_free_desc; + fsl_chan->tcd = fsl_edma->membase + EDMA_TCD + + i * sizeof(struct fsl_edma_hw_tcd); vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev); - edma_writew(fsl_edma, 0x0, ®s->tcd[i].csr); + edma_write_tcdreg(fsl_chan, 0, csr); fsl_edma_chan_mux(fsl_chan, 0, false); } @@ -419,7 +421,7 @@ static int fsl_edma_resume_early(struct device *dev) for (i = 0; i < fsl_edma->n_chans; i++) { fsl_chan = &fsl_edma->chans[i]; fsl_chan->pm_state = RUNNING; - edma_writew(fsl_edma, 0x0, ®s->tcd[i].csr); + edma_write_tcdreg(fsl_chan, 0, csr); if (fsl_chan->slave_id != 0) fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true); } diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index 316e637b00c4..bccb5448e492 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -200,7 +200,9 @@ static int mcf_edma_probe(struct platform_device *pdev) mcf_chan->dma_dir = DMA_NONE; mcf_chan->vchan.desc_free = fsl_edma_free_desc; vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev); - iowrite32(0x0, ®s->tcd[i].csr); + mcf_chan->tcd = mcf_edma->membase + EDMA_TCD + + i * sizeof(struct fsl_edma_hw_tcd); + iowrite32(0x0, &mcf_chan->tcd->csr); } iowrite32(~0, regs->inth); From patchwork Tue Jun 20 20:12:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 110680 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3915788vqr; Tue, 20 Jun 2023 13:17:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5akN9l+HChznckaEF8kUvTO4rf404lqleg3ONkftA+HI5Ry/UjnXkoCpcenhguCOx82dhl X-Received: by 2002:a05:6a20:8f04:b0:122:ff52:5414 with SMTP id b4-20020a056a208f0400b00122ff525414mr964471pzk.22.1687292230069; Tue, 20 Jun 2023 13:17:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292230; cv=pass; d=google.com; s=arc-20160816; b=vuh0NfU7N775oT4YPn7gTpZJ7lAHTbVJM33bVnQXyYhb5cctN6spyoEAmorqtEjT4r NFJsVj19x1SvqHx527GZBnebnBu6J4T0r8h/0foRI+a0z43nEs0dJXWhGzV+qqulhEJV vjzePCFE/bJGPsO050Ld5SNwxkls0pBOL2XC4Thlko4TKrlveh6COyXzK/8X3z/yrrB2 RNPeZxSCF7qQxn8V8TOqrOQ3rTvWM6fczYLIx/BzcYeInq3+5D7KG3FRrNf7C/pXftPz gUCcPWts6h8vdtYA5d8YHSf4hvwRKBeeXiYqKcXgfFL4Zk/l10XemGdSI9yBtR6+B0HI GESQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=PeCMQBP8k+5S6/X9HD+YRizczLEve0pLk7+72KdnwX0=; b=cR8oR32h2BBEk3PtVjV6cF39zxGWbKPYWcQiLTib0WT9o4NmWRvXvzJrYwHtyJ4ezf PIK9BQqS6NmwhVsHUY4yeEcE/uYK8g3DRJgp++kI3vqxyhV7D3SOY8zXtDBV/6JQXe86 nxo5d4kiF4KgS4w23xUJ3qSu/ZvzLmoOw+NYT8DRLwNm+1a8AIqzhLXyVkGXDxFwvY+c t3CwADqIk60SQxgy6mi0mN1gjNPI3yJbQZmcn5OUzJAQi9YLyqENwGc5ZaKewkxkpU7V zdSnQpMcWfNOpjrBKAxNnRsJXZNmOyDKerpsNTzoFpB+/x9qaewHvFyetKwxVil67Fvj nZ3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=RNnCI1gn; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i11-20020a056a00004b00b00666abc82894si2285605pfk.320.2023.06.20.13.16.55; Tue, 20 Jun 2023 13:17:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=RNnCI1gn; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbjFTUPN (ORCPT + 99 others); Tue, 20 Jun 2023 16:15:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230429AbjFTUOv (ORCPT ); Tue, 20 Jun 2023 16:14:51 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB791BC9; Tue, 20 Jun 2023 13:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UhaLFcSopskPpgMpOicw1a4q7YhIwRk7FkREbieAy1tYT31UkO8ZZQJxvhyVVpqieNHOlGi1cu2CX+wpRp+JJuUYk4GFPU8/l7RYnheHbGFv2mAgvmrLykRIr0h81x3qCNjAe5PS5uZC8trsKN5fCxJswWpoPxnq/06fnnroAIioaXfA/X/GAthTTO+HltfslrMLt67Ll1pfUU3lz1ifjP5DwhcjXiAkd8L607UXQFM7ORvHQ95HxLtXgML2vhx4hvm3kb2vvwMcHJlp+/GBiUW9q8FPZxVjFOGBQOPViceyyrBXanmQGW9+8RDvL5ov83fvsD8G6zLESar6yz+FPg== 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=PeCMQBP8k+5S6/X9HD+YRizczLEve0pLk7+72KdnwX0=; b=TNDIDw60SB8eo+nSLtrCN2RIfPKX+MlJqtvLvfOSlpveFvdIOSnDvbZlB4xj+mzUqyIgNh9mftnomEEs3GWqXjgUhkrmzAnJlafO8EQNluqCs9702rQhAR6HeEGYKLDQysauFQThfVql121gwHObE29XDxN8kCe0HH3JJ4MZwgskJNmPaFK+2l2MT8d0Ee9sj7ehfkJhD9bokksB+DCVSCu7Drxun4kG3mpMzcehnHGR8WmMmp+8Szvac0lLCN5wWlr/vA6gyUXfgakDQI7YjYccjTrK/t0rNzPr0zhzl/5W0pQhlyTUClBPe6iKz3Y1S0xOJ5Xamq9GdoZXY0qX5g== 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=PeCMQBP8k+5S6/X9HD+YRizczLEve0pLk7+72KdnwX0=; b=RNnCI1gnhIqkcOCUwTUxPFdIFex0CCiOt3wKkDtVfhR1LgJoF6Hntmzf85FLJMKPOGp7oaC3951sQEP176UVKo7LfbiyB//nTNtXIwbKX4BQjTF9c5ZBE8bkh0dAaq1t8tyYo+/tUXdPj2kWd0VOPOGQ78IMeN6rvtW/LR49xKs= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:13:11 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:13:10 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 12/13] dmaengine: fsl-edma: integrate v3 support Date: Tue, 20 Jun 2023 16:12:20 -0400 Message-Id: <20230620201221.2580428-13-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: d4c8e6ce-3242-4e5a-2f82-08db71cac501 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3AKIc25pDuT5vH7x4bhcc1wYYpqXcpZwI+qWy34NO72GZUZ2HrARMUSOr0tDwAg97Tfo8RihKsL1v7vhtKJuMAP2EIEmwA6FXI92dex14Da/3mJRXaYqM3QmpY/pqlk6/cEqR/S3VGID0HGi5cYLX4cqQNatcv6UVZsXal14pE+TwBMFIrapDuiU51WrEqS8Qx2OykuCYCez6Ju4TrF6YxECSatXJnJenXSBXe74n1G3Lk38ZSBWU8bai5I5p3Sv/zDH6P7/JjH6BObhf//3msYJAj9kaTJT583ck6PkLBMd6h65kI2zP+B/R4mITZSpmeQBNeS4Q9QafUG4BRDA2owNcI3NXa0n+uWKMYUl9AIchV5rWvcch6D6365xwxBipDvrbx39rGG7hMJaKhl5V7Va1LJctGnxGdpnismDlIHBIGuRzcCVp/NPyPAHA1UN4vG58C721cuqy/udo9POmYS+7yDSqpk5WempK1CJGNCdB9e4IUqBo0mGvCXkzSYX84TEUcbHlFIXu5UbfxcX6hvXWDGcTrI8RyWFOREAbF959jnStXEq9Si4m1tQtGWbz3hFOhP6Dc8ZNxAGrppvt+XcNv5gmNPTc1OyL1+PbGeawR9SU1IXA6Zm/qIXYdyTz06uI3OGmpzwAQEzk0myiA== 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(30864003)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cj92mpiWdTEgN3HTKwTIA5WSywbW8TbVSUChys1Ma7Ch8265aCGUpMjQ/hqTj/UwhJpp81v5ex/GqmQ9dKVrB2eAY/l/0JY7mJy3XyMmxR/HQIuRWHPxW/F/ET6IglWMFBrDohJI0lM0oDUKFZala7CR3zijy4UkepNF/PcLQ/J2Tve4tHMKzYtTbwOAqmlyYVEtQYCCBvPzg5rh2oqypDKarlG5LikYvnfEboNipb1VhDD2p8b312Sxy6XkbgipDJ903FxJMV5KoZs+FTwWup9zALPqxBzQuCa6hNZw9QIxNCGVinEIqJ6Bq7m3wdD13EX9aT7h9gZ/r1M6owbGVdPFC+mOArP1CeSpRt8Ug3ciRSP7H+FYRmyzIHrEFuamripkI3agNhROMzbHDUIaXasyEadBDjvxKdCoe6REYhYHAyrsxZk2903JhHjgTVvKOUhhqsic09sUBcSppUigk/Z8ZdlmlzHjSzplRlyIym8E/td5v+tTF72uoNI5H5BALnzvTusDUK3KyZISyACcfpDvBQ4f+whngx0VXIBXq0py9qjiJEQMOCJBdbX4D0AEeQWS0XWp3BzqkCDwxicBfTrUd6QO0GxcSyzeleqXxEQuYDvBJXU480aYnLw7taBmVu60TblrOOnmIhqKlJmcum9dH1wo90pF45KFQT30MEYJyTPlwiHpm1jTIPpxyZEA/hmh8SKfpgNXi+mGmOUezWMJG0+wcWRLiLiYB4A4lyi79kL4vhVjUgAb474XlMwe6MQc4Sy3bE5ld4cJCot5neJKNlf+Zthu1gLReYQ7XsOjfhy7SMjwTe7vpAxyzBkJpyvZKJmZssX7Tb2aYXoO2vsQF9I1bDUaVHV6qfyHDWMZ98sBoOAoQONqQnwWTodIxgwZqJetQxop20PvY0zYqoWf6umbZ5aZgVB5zxFLkkSjBl7K+s/VNDUtBpc8UIeioxavNMAAKI6/ExvrM1lDH2tNmauUVxfh7ah3NexhBGYY3KMtTOdLWHsadVLhxhMqhPWF9puBEbpER0KC32vIJ8p9W7QoBJVZdQ/TCpHwMbfF+ieyxGtKWQtVf/o4+vaL1GFapPHjkPJtrBgbAIbevRbCqfy9vYCtRTAGwy8uQ4j2Oi3364xKDu6x7jevyfSjCd92Ycn0cAgRtQ8dMZlYt0zXXJ/YZfYnva9qPAOT+y70FzBa57z5X/KbHYbfD8uoHprK8voD2xmbYX2zA37hpHPAz5lMMK30PPHO8Digc44ZU5KZj9rD6A1bQZMcByKOLrwwxCpJkToR82cov6+DUCastwUl86Tld7oVSrn2faXvO8+hWkDEE7ZVnBIuMlrbhtezsgr/n4m3JKkwDyo517/fNrnyFzZjjykLp4PWtoID2MWTgjVSbPvkLF/kgrzBMcdhUDtvAWLHlFTg4e9382OWsqyQkv2foAiBKPCuB0pg/4Ad80sCQdfzV3L7G83rpJqJKtDxIewPEGfIbo5W9JV5PMBs1EbqmtNzxMylrcKJxaKRbQ9ngMayLVR/IYDiIQJMsv0Dvruf+XF8HwpJKQdtaRxy747cNlr6j3YwtXrw6tsBeByqWrOToLSApck+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4c8e6ce-3242-4e5a-2f82-08db71cac501 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:13:10.9186 (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: /TRhB+PHjFG7ljPm1Fj28zMLOx0gkmbQFlqcVznJ1k7/kJDvs7GEtonDCcrPjgwqAIIaCGptIX9ZUTxTEjEh2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254137310238085?= X-GMAIL-MSGID: =?utf-8?q?1769254137310238085?= Significant alterations have been made to the EDMA v3's register layout. Now, each channel possesses a separate address space, encapsulating all channel-related controls and statuses, including IRQs. There are changes in bit position definitions as well. However, the fundamental control flow remains analogous to the previous versions. EDMA v3 was utilized in imx8qm, imx93, and will be in forthcoming chips. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 158 +++++++++++++++++++--- drivers/dma/fsl-edma-common.h | 73 +++++++++- drivers/dma/fsl-edma-main.c | 247 ++++++++++++++++++++++++++++++++-- 3 files changed, 454 insertions(+), 24 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index eead6a4765f7..bec1f4d6a3e1 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include "fsl-edma-common.h" @@ -66,11 +68,46 @@ void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan) spin_unlock(&fsl_chan->vchan.lock); } +static void fsl_edma3_enable_request(struct fsl_edma_chan *fsl_chan) +{ + u32 val, flags; + + flags = fsl_edma_drvflags(fsl_chan); + val = edma_readl_chreg(fsl_chan, ch_sbr); + /* Remote/local swapped wrongly on iMX8 QM Audio edma */ + if (flags & FSL_EDMA_DRV_QUIRK_SWAPPED) { + if (!fsl_chan->is_rxchan) + val |= EDMA_V3_CH_SBR_RD; + else + val |= EDMA_V3_CH_SBR_WR; + } else { + if (fsl_chan->is_rxchan) + val |= EDMA_V3_CH_SBR_RD; + else + val |= EDMA_V3_CH_SBR_WR; + } + + if (fsl_chan->is_remote) + val &= ~(EDMA_V3_CH_SBR_RD | EDMA_V3_CH_SBR_WR); + + edma_writel_chreg(fsl_chan, val, ch_sbr); + + if (flags & FSL_EDMA_DRV_HAS_CHMUX) + edma_writel_chreg(fsl_chan, fsl_chan->srcid, ch_mux); + + val = edma_readl_chreg(fsl_chan, ch_csr); + val |= EDMA_V3_CH_CSR_ERQ; + edma_writel_chreg(fsl_chan, val, ch_csr); +} + static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) { struct edma_regs *regs = &fsl_chan->edma->regs; u32 ch = fsl_chan->vchan.chan.chan_id; + if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_SPLIT_REG) + return fsl_edma3_enable_request(fsl_chan); + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_WRAP_IO) { edma_writeb(fsl_chan->edma, EDMA_SEEI_SEEI(ch), regs->seei); edma_writeb(fsl_chan->edma, ch, regs->serq); @@ -83,11 +120,28 @@ static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) } } +static void fsl_edma3_disable_request(struct fsl_edma_chan *fsl_chan) +{ + u32 val = edma_readl_chreg(fsl_chan, ch_csr); + u32 flags; + + flags = fsl_edma_drvflags(fsl_chan); + + if (flags & FSL_EDMA_DRV_HAS_CHMUX) + edma_writel_chreg(fsl_chan, 0, ch_mux); + + val &= ~EDMA_V3_CH_CSR_ERQ; + edma_writel_chreg(fsl_chan, val, ch_csr); +} + void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) { struct edma_regs *regs = &fsl_chan->edma->regs; u32 ch = fsl_chan->vchan.chan.chan_id; + if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_SPLIT_REG) + return fsl_edma3_disable_request(fsl_chan); + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_WRAP_IO) { edma_writeb(fsl_chan->edma, ch, regs->cerq); edma_writeb(fsl_chan->edma, EDMA_CEEI_CEEI(ch), regs->ceei); @@ -135,6 +189,9 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, int endian_diff[4] = {3, 1, -1, -3}; u32 dmamux_nr = fsl_chan->edma->drvdata->dmamuxs; + if (!dmamux_nr) + return; + chans_per_mux = fsl_chan->edma->n_chans / dmamux_nr; ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux; @@ -186,6 +243,10 @@ int fsl_edma_terminate_all(struct dma_chan *chan) vchan_get_all_descriptors(&fsl_chan->vchan, &head); spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); vchan_dma_desc_free_list(&fsl_chan->vchan, &head); + + if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_HAS_PD) + pm_runtime_allow(fsl_chan->pd_dev); + return 0; } @@ -286,12 +347,16 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, enum dma_transfer_direction dir = edesc->dirn; dma_addr_t cur_addr, dma_addr; size_t len, size; + u32 nbytes = 0; int i; /* calculate the total size in this desc */ - for (len = i = 0; i < fsl_chan->edesc->n_tcds; i++) - len += le32_to_cpu(edesc->tcd[i].vtcd->nbytes) - * le16_to_cpu(edesc->tcd[i].vtcd->biter); + for (len = i = 0; i < fsl_chan->edesc->n_tcds; i++) { + nbytes = le32_to_cpu(edesc->tcd[i].vtcd->nbytes); + if (nbytes & (EDMA_V3_TCD_NBYTES_DMLOE | EDMA_V3_TCD_NBYTES_SMLOE)) + nbytes = EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(nbytes); + len += nbytes * le16_to_cpu(edesc->tcd[i].vtcd->biter); + } if (!in_progress) return len; @@ -303,8 +368,12 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, /* figure out the finished and calculate the residue */ for (i = 0; i < fsl_chan->edesc->n_tcds; i++) { - size = le32_to_cpu(edesc->tcd[i].vtcd->nbytes) - * le16_to_cpu(edesc->tcd[i].vtcd->biter); + nbytes = le32_to_cpu(edesc->tcd[i].vtcd->nbytes); + if (nbytes & (EDMA_V3_TCD_NBYTES_DMLOE | EDMA_V3_TCD_NBYTES_SMLOE)) + nbytes = EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(nbytes); + + size = nbytes * le16_to_cpu(edesc->tcd[i].vtcd->biter); + if (dir == DMA_MEM_TO_DEV) dma_addr = le32_to_cpu(edesc->tcd[i].vtcd->saddr); else @@ -389,12 +458,15 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, } static inline -void fsl_edma_fill_tcd(struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, +void fsl_edma_fill_tcd(struct fsl_edma_chan *fsl_chan, + struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, u16 attr, u16 soff, u32 nbytes, u32 slast, u16 citer, u16 biter, u16 doff, u32 dlast_sga, bool major_int, bool disable_req, bool enable_sg) { + struct dma_slave_config *cfg = &fsl_chan->cfg; u16 csr = 0; + u32 burst; /* * eDMA hardware SGs require the TCDs to be stored in little @@ -409,6 +481,21 @@ void fsl_edma_fill_tcd(struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, tcd->soff = cpu_to_le16(soff); + if (fsl_chan->is_multi_fifo) { + /* set mloff to support multiple fifo */ + burst = cfg->direction == DMA_DEV_TO_MEM ? + cfg->src_addr_width : cfg->dst_addr_width; + nbytes |= EDMA_V3_TCD_NBYTES_MLOFF(-(burst * 4)); + /* enable DMLOE/SMLOE */ + if (cfg->direction == DMA_MEM_TO_DEV) { + nbytes |= EDMA_V3_TCD_NBYTES_DMLOE; + nbytes &= ~EDMA_V3_TCD_NBYTES_SMLOE; + } else { + nbytes |= EDMA_V3_TCD_NBYTES_SMLOE; + nbytes &= ~EDMA_V3_TCD_NBYTES_DMLOE; + } + } + tcd->nbytes = cpu_to_le32(nbytes); tcd->slast = cpu_to_le32(slast); @@ -427,6 +514,12 @@ void fsl_edma_fill_tcd(struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, if (enable_sg) csr |= EDMA_TCD_CSR_E_SG; + if (fsl_chan->is_rxchan) + csr |= EDMA_TCD_CSR_ACTIVE; + + if (fsl_chan->is_sw) + csr |= EDMA_TCD_CSR_START; + tcd->csr = cpu_to_le16(csr); } @@ -466,6 +559,7 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); struct fsl_edma_desc *fsl_desc; dma_addr_t dma_buf_next; + bool major_int = true; int sg_len, i; u32 src_addr, dst_addr, last_sg, nbytes; u16 soff, doff, iter; @@ -509,17 +603,23 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( src_addr = dma_buf_next; dst_addr = fsl_chan->dma_dev_addr; soff = fsl_chan->cfg.dst_addr_width; - doff = 0; - } else { + doff = fsl_chan->is_multi_fifo ? 4 : 0; + } else if (direction == DMA_DEV_TO_MEM) { src_addr = fsl_chan->dma_dev_addr; dst_addr = dma_buf_next; - soff = 0; + soff = fsl_chan->is_multi_fifo ? 4 : 0; doff = fsl_chan->cfg.src_addr_width; + } else { + /* DMA_DEV_TO_DEV */ + src_addr = fsl_chan->cfg.src_addr; + dst_addr = fsl_chan->cfg.dst_addr; + soff = doff = 0; + major_int = false; } - fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, dst_addr, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[i].vtcd, src_addr, dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, - iter, doff, last_sg, true, false, true); + iter, doff, last_sg, major_int, false, true); dma_buf_next += period_len; } @@ -568,23 +668,51 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( dst_addr = fsl_chan->dma_dev_addr; soff = fsl_chan->cfg.dst_addr_width; doff = 0; - } else { + } else if (direction == DMA_DEV_TO_MEM) { src_addr = fsl_chan->dma_dev_addr; dst_addr = sg_dma_address(sg); soff = 0; doff = fsl_chan->cfg.src_addr_width; + } else { + /* DMA_DEV_TO_DEV */ + src_addr = fsl_chan->cfg.src_addr; + dst_addr = fsl_chan->cfg.dst_addr; + soff = 0; + doff = 0; } + /* + * Choose the suitable burst length if sg_dma_len is not + * multiple of burst length so that the whole transfer length is + * multiple of minor loop(burst length). + */ + if (sg_dma_len(sg) % nbytes) { + u32 width = (direction == DMA_DEV_TO_MEM) ? doff : soff; + u32 burst = (direction == DMA_DEV_TO_MEM) ? + fsl_chan->cfg.src_maxburst : + fsl_chan->cfg.dst_maxburst; + int j; + + for (j = burst; j > 1; j--) { + if (!(sg_dma_len(sg) % (j * width))) { + nbytes = j * width; + break; + } + } + /* Set burst size as 1 if there's no suitable one */ + if (j == 1) + nbytes = width; + } iter = sg_dma_len(sg) / nbytes; if (i < sg_len - 1) { last_sg = fsl_desc->tcd[(i + 1)].ptcd; - fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[i].vtcd, src_addr, dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, iter, doff, last_sg, false, false, true); } else { last_sg = 0; - fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[i].vtcd, src_addr, dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, iter, doff, last_sg, true, true, false); @@ -609,7 +737,7 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, fsl_chan->is_sw = true; /* To match with copy_align and max_seg_size so 1 tcd is enough */ - fsl_edma_fill_tcd(fsl_desc->tcd[0].vtcd, dma_src, dma_dst, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[0].vtcd, dma_src, dma_dst, fsl_edma_get_tcd_attr(DMA_SLAVE_BUSWIDTH_32_BYTES), 32, len, 0, 1, 1, 32, 0, true, true, false); diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index cfc41915eaa1..3cc0cc8fc2d0 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -42,6 +42,11 @@ #define EDMA_TCD_CSR_ACTIVE BIT(6) #define EDMA_TCD_CSR_DONE BIT(7) +#define EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(x) ((x) & GENMASK(9, 0)) +#define EDMA_V3_TCD_NBYTES_MLOFF(x) (x << 10) +#define EDMA_V3_TCD_NBYTES_DMLOE (1 << 30) +#define EDMA_V3_TCD_NBYTES_SMLOE (1 << 31) + #define EDMAMUX_CHCFG_DIS 0x0 #define EDMAMUX_CHCFG_ENBL 0x80 #define EDMAMUX_CHCFG_SOURCE(n) ((n) & 0x3F) @@ -54,6 +59,15 @@ BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_8_BYTES)) + +#define EDMA_V3_CH_SBR_RD BIT(22) +#define EDMA_V3_CH_SBR_WR BIT(21) +#define EDMA_V3_CH_CSR_ERQ BIT(0) +#define EDMA_V3_CH_CSR_EARQ BIT(1) +#define EDMA_V3_CH_CSR_EEI BIT(2) +#define EDMA_V3_CH_CSR_DONE BIT(30) +#define EDMA_V3_CH_CSR_ACTIVE BIT(31) + enum fsl_edma_pm_state { RUNNING = 0, SUSPENDED, @@ -73,6 +87,18 @@ struct fsl_edma_hw_tcd { __le16 biter; }; +struct fsl_edma3_ch_reg { + __le32 ch_csr; + __le32 ch_es; + __le32 ch_int; + __le32 ch_sbr; + __le32 ch_pri; + __le32 ch_mux; + __le32 ch_mattr; /* edma4, reserved for edma3 */ + __le32 ch_reserved; + struct fsl_edma_hw_tcd tcd; +} __packed; + /* * These are iomem pointers, for both v32 and v64. */ @@ -119,6 +145,18 @@ struct fsl_edma_chan { enum dma_data_direction dma_dir; char chan_name[32]; struct fsl_edma_hw_tcd __iomem *tcd; + u32 real_count; + struct work_struct issue_worker; + struct platform_device *pdev; + struct device *pd_dev; + u32 srcid; + struct clk *clk; + int priority; + int hw_chanid; + int txirq; + bool is_rxchan; + bool is_remote; + bool is_multi_fifo; }; struct fsl_edma_desc { @@ -135,8 +173,26 @@ struct fsl_edma_desc { #define FSL_EDMA_DRV_CONFIG32 BIT(2) #define FSL_EDMA_DRV_WRAP_IO BIT(3) #define FSL_EDMA_DRV_EDMA64 BIT(4) +#define FSL_EDMA_DRV_HAS_PD BIT(5) +#define FSL_EDMA_DRV_HAS_CHCLK BIT(6) +#define FSL_EDMA_DRV_HAS_CHMUX BIT(7) +/* imx8 QM audio edma remote local swapped */ +#define FSL_EDMA_DRV_QUIRK_SWAPPED BIT(8) +/* control and status register is in tcd address space, edma3 reg layout */ +#define FSL_EDMA_DRV_SPLIT_REG BIT(9) +#define FSL_EDMA_DRV_BUS_8BYTE BIT(10) +#define FSL_EDMA_DRV_DEV_TO_DEV BIT(11) +#define FSL_EDMA_DRV_ALIGN_64BYTE BIT(12) + +#define FSL_EDMA_DRV_EDMA3 (FSL_EDMA_DRV_SPLIT_REG | \ + FSL_EDMA_DRV_BUS_8BYTE | \ + FSL_EDMA_DRV_DEV_TO_DEV | \ + FSL_EDMA_DRV_ALIGN_64BYTE) + struct fsl_edma_drvdata { - u32 dmamuxs; + u32 dmamuxs; /* only used before v3 */ + u32 chreg_off; + u32 chreg_space_sz; u32 flags; int (*setup_irq)(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma); @@ -148,6 +204,7 @@ struct fsl_edma_engine { void __iomem *muxbase[DMAMUX_NR]; struct clk *muxclk[DMAMUX_NR]; struct clk *dmaclk; + struct clk *chclk; struct mutex fsl_edma_mutex; const struct fsl_edma_drvdata *drvdata; u32 n_chans; @@ -155,6 +212,7 @@ struct fsl_edma_engine { int errirq; bool big_endian; struct edma_regs regs; + u64 chan_masked; struct fsl_edma_chan chans[]; }; @@ -168,6 +226,14 @@ struct fsl_edma_engine { edma_writel(chan->edma, (u32 __force)val, &chan->tcd->__name) : \ edma_writew(chan->edma, (u16 __force)val, &chan->tcd->__name)) +#define edma_readl_chreg(chan, __name) \ + edma_readl(chan->edma, \ + (void __iomem *)&(container_of(chan->tcd, struct fsl_edma3_ch_reg, tcd)->__name)) + +#define edma_writel_chreg(chan, val, __name) \ + edma_writel(chan->edma, val, \ + (void __iomem *)&(container_of(chan->tcd, struct fsl_edma3_ch_reg, tcd)->__name)) + /* * R/W functions for big- or little-endian registers: * The eDMA controller's endian is independent of the CPU core's endian. @@ -224,6 +290,11 @@ static inline struct fsl_edma_chan *to_fsl_edma_chan(struct dma_chan *chan) return container_of(chan, struct fsl_edma_chan, vchan.chan); } +static inline u32 fsl_edma_drvflags(struct fsl_edma_chan *fsl_chan) +{ + return fsl_chan->edma->drvdata->flags; +} + static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd) { return container_of(vd, struct fsl_edma_desc, vdesc); diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 8ba705080f5d..b0ddb82862ea 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -18,9 +18,15 @@ #include #include #include +#include +#include #include "fsl-edma-common.h" +#define ARGS_RX BIT(0) +#define ARGS_REMOTE BIT(1) +#define ARGS_MULTI_FIFO BIT(2) + static void fsl_edma_synchronize(struct dma_chan *chan) { struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); @@ -47,6 +53,22 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) return IRQ_HANDLED; } +static irqreturn_t fsl_edma3_tx_handler(int irq, void *dev_id) +{ + struct fsl_edma_chan *fsl_chan = dev_id; + unsigned int intr; + + intr = edma_readl_chreg(fsl_chan, ch_int); + if (!intr) + return IRQ_HANDLED; + + edma_writel_chreg(fsl_chan, 1, ch_int); + + fsl_edma_tx_chan_handler(fsl_chan); + + return IRQ_HANDLED; +} + static irqreturn_t fsl_edma_err_handler(int irq, void *dev_id) { struct fsl_edma_engine *fsl_edma = dev_id; @@ -108,6 +130,51 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec, return NULL; } +static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec, + struct of_dma *ofdma) +{ + struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data; + struct dma_chan *chan, *_chan; + struct fsl_edma_chan *fsl_chan; + bool b_chmux; + int i; + + if (dma_spec->args_count != 3) + return NULL; + + b_chmux = !!(fsl_edma->drvdata->flags & FSL_EDMA_DRV_HAS_CHMUX); + + mutex_lock(&fsl_edma->fsl_edma_mutex); + list_for_each_entry_safe(chan, _chan, &fsl_edma->dma_dev.channels, + device_node) { + + if (chan->client_count) + continue; + + fsl_chan = to_fsl_edma_chan(chan); + i = fsl_chan - fsl_edma->chans; + + chan = dma_get_slave_channel(chan); + chan->device->privatecnt++; + fsl_chan->priority = dma_spec->args[1]; + fsl_chan->is_rxchan = dma_spec->args[2] & ARGS_RX; + fsl_chan->is_remote = dma_spec->args[2] & ARGS_REMOTE; + fsl_chan->is_multi_fifo = dma_spec->args[2] & ARGS_MULTI_FIFO; + + if (!b_chmux && i == dma_spec->args[0]) { + mutex_unlock(&fsl_edma->fsl_edma_mutex); + return chan; + } else if (b_chmux && !fsl_chan->srcid) { + /* if controller support channel mux, choose a free channel */ + fsl_chan->srcid = dma_spec->args[0]; + mutex_unlock(&fsl_edma->fsl_edma_mutex); + return chan; + } + } + mutex_unlock(&fsl_edma->fsl_edma_mutex); + return NULL; +} + static int fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) { @@ -149,6 +216,37 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma return 0; } +static int fsl_edma3_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) +{ + int ret; + int i; + + for (i = 0; i < fsl_edma->n_chans; i++) { + + struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; + + if (fsl_edma->chan_masked & BIT(i)) + continue; + + /* request channel irq */ + fsl_chan->txirq = platform_get_irq(pdev, i); + if (fsl_chan->txirq < 0) { + dev_err(&pdev->dev, "Can't get chan %d's irq.\n", i); + return -EINVAL; + } + + ret = devm_request_irq(&pdev->dev, fsl_chan->txirq, + fsl_edma3_tx_handler, IRQF_SHARED, + fsl_chan->chan_name, fsl_chan); + if (ret) { + dev_err(&pdev->dev, "Can't register chan%d's IRQ.\n", i); + return -EINVAL; + } + } + + return 0; +} + static int fsl_edma2_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) @@ -203,29 +301,109 @@ static void fsl_disable_clocks(struct fsl_edma_engine *fsl_edma, int nr_clocks) static struct fsl_edma_drvdata vf610_data = { .dmamuxs = DMAMUX_NR, .flags = FSL_EDMA_DRV_WRAP_IO, + .chreg_off = EDMA_TCD, + .chreg_space_sz = sizeof(struct fsl_edma_hw_tcd), .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata ls1028a_data = { .dmamuxs = DMAMUX_NR, .flags = FSL_EDMA_DRV_MUX_SWAP | FSL_EDMA_DRV_WRAP_IO, + .chreg_off = EDMA_TCD, + .chreg_space_sz = sizeof(struct fsl_edma_hw_tcd), .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata imx7ulp_data = { .dmamuxs = 1, + .chreg_off = EDMA_TCD, + .chreg_space_sz = sizeof(struct fsl_edma_hw_tcd), .flags = FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_CONFIG32, .setup_irq = fsl_edma2_irq_init, }; +static struct fsl_edma_drvdata imx8qm_data = { + .flags = FSL_EDMA_DRV_HAS_PD | FSL_EDMA_DRV_EDMA3, + .chreg_space_sz = 0x10000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + +static struct fsl_edma_drvdata imx8qm_audio_data = { + .flags = FSL_EDMA_DRV_QUIRK_SWAPPED | FSL_EDMA_DRV_HAS_PD | FSL_EDMA_DRV_EDMA3, + .chreg_space_sz = 0x10000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + +static struct fsl_edma_drvdata imx93_data3 = { + .flags = FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_EDMA3, + .chreg_space_sz = 0x10000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + +static struct fsl_edma_drvdata imx93_data4 = { + .flags = FSL_EDMA_DRV_HAS_CHMUX | FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_EDMA3, + .chreg_space_sz = 0x8000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + static const struct of_device_id fsl_edma_dt_ids[] = { { .compatible = "fsl,vf610-edma", .data = &vf610_data}, { .compatible = "fsl,ls1028a-edma", .data = &ls1028a_data}, { .compatible = "fsl,imx7ulp-edma", .data = &imx7ulp_data}, + { .compatible = "fsl,imx8qm-edma", .data = &imx8qm_data}, + { .compatible = "fsl,imx8qm-adma", .data = &imx8qm_audio_data}, + { .compatible = "fsl,imx93-edma3", .data = &imx93_data3}, + { .compatible = "fsl,imx93-edma4", .data = &imx93_data4}, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_edma_dt_ids); +static int fsl_edma3_attach_pd(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) +{ + struct fsl_edma_chan *fsl_chan; + struct device_link *link; + struct device *pd_chan; + struct device *dev; + int i; + + dev = &pdev->dev; + + for (i = 0; i < fsl_edma->n_chans; i++) { + if (fsl_edma->chan_masked & BIT(i)) + continue; + + fsl_chan = &fsl_edma->chans[i]; + + pd_chan = dev_pm_domain_attach_by_id(dev, i); + if (IS_ERR_OR_NULL(pd_chan)) { + dev_err(dev, "Failed attach pd %d\n", i); + return -EINVAL; + } + + link = device_link_add(dev, pd_chan, DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | + DL_FLAG_RPM_ACTIVE); + if (IS_ERR(link)) { + dev_err(dev, "Failed to add device_link to %d: %ld\n", i, + PTR_ERR(link)); + return -EINVAL; + } + + fsl_chan->pd_dev = pd_chan; + + pm_runtime_use_autosuspend(fsl_chan->pd_dev); + pm_runtime_set_autosuspend_delay(fsl_chan->pd_dev, 200); + pm_runtime_set_active(fsl_chan->pd_dev); + //pm_runtime_put_sync_suspend(fsl_chan->pd_dev); + } + + return 0; +} + static int fsl_edma_probe(struct platform_device *pdev) { const struct of_device_id *of_id = @@ -234,6 +412,7 @@ static int fsl_edma_probe(struct platform_device *pdev) struct fsl_edma_engine *fsl_edma; const struct fsl_edma_drvdata *drvdata = NULL; struct fsl_edma_chan *fsl_chan; + u32 chan_mask[2] = {0, 0}; struct edma_regs *regs; int len, chans; int ret, i; @@ -264,8 +443,10 @@ static int fsl_edma_probe(struct platform_device *pdev) if (IS_ERR(fsl_edma->membase)) return PTR_ERR(fsl_edma->membase); - fsl_edma_setup_regs(fsl_edma); - regs = &fsl_edma->regs; + if (!(drvdata->flags & FSL_EDMA_DRV_SPLIT_REG)) { + fsl_edma_setup_regs(fsl_edma); + regs = &fsl_edma->regs; + } if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) { fsl_edma->dmaclk = devm_clk_get_enabled(&pdev->dev, "dma"); @@ -275,9 +456,29 @@ static int fsl_edma_probe(struct platform_device *pdev) } } + if (drvdata->flags & FSL_EDMA_DRV_HAS_CHCLK) { + fsl_edma->chclk = devm_clk_get_enabled(&pdev->dev, "mp"); + if (IS_ERR(fsl_edma->chclk)) { + dev_err(&pdev->dev, "Missing MP block clock.\n"); + return PTR_ERR(fsl_edma->chclk); + } + } + + ret = of_property_read_variable_u32_array(np, "dma-channel-mask", chan_mask, 1, 2); + + if (ret > 0) { + fsl_edma->chan_masked = chan_mask[1]; + fsl_edma->chan_masked <<= 32; + fsl_edma->chan_masked |= chan_mask[0]; + } + for (i = 0; i < fsl_edma->drvdata->dmamuxs; i++) { char clkname[32]; + /* eDMAv3 mux register move to TCD area if ch_mux exist */ + if (drvdata->flags & FSL_EDMA_DRV_SPLIT_REG) + break; + fsl_edma->muxbase[i] = devm_platform_ioremap_resource(pdev, 1 + i); if (IS_ERR(fsl_edma->muxbase[i])) { @@ -297,9 +498,18 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma->big_endian = of_property_read_bool(np, "big-endian"); + if (drvdata->flags & FSL_EDMA_DRV_HAS_PD) { + ret = fsl_edma3_attach_pd(pdev, fsl_edma); + if (ret) + return ret; + } + INIT_LIST_HEAD(&fsl_edma->dma_dev.channels); for (i = 0; i < fsl_edma->n_chans; i++) { - struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; + fsl_chan = &fsl_edma->chans[i]; + + if (fsl_edma->chan_masked & BIT(i)) + continue; snprintf(fsl_chan->chan_name, sizeof(fsl_chan->chan_name), "%s-CH%02d", dev_name(&pdev->dev), i); @@ -310,8 +520,13 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_chan->idle = true; fsl_chan->dma_dir = DMA_NONE; fsl_chan->vchan.desc_free = fsl_edma_free_desc; - fsl_chan->tcd = fsl_edma->membase + EDMA_TCD - + i * sizeof(struct fsl_edma_hw_tcd); + + len = (drvdata->flags & FSL_EDMA_DRV_SPLIT_REG) ? + offsetof(struct fsl_edma3_ch_reg, tcd) : 0; + fsl_chan->tcd = fsl_edma->membase + + i * drvdata->chreg_space_sz + drvdata->chreg_off + len; + + fsl_chan->pdev = pdev; vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev); edma_write_tcdreg(fsl_chan, 0, csr); @@ -345,12 +560,25 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma->dma_dev.src_addr_widths = FSL_EDMA_BUSWIDTHS; fsl_edma->dma_dev.dst_addr_widths = FSL_EDMA_BUSWIDTHS; + + if (drvdata->flags & FSL_EDMA_DRV_BUS_8BYTE) { + fsl_edma->dma_dev.src_addr_widths |= BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); + fsl_edma->dma_dev.dst_addr_widths |= BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); + } + fsl_edma->dma_dev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); + if (drvdata->flags & FSL_EDMA_DRV_DEV_TO_DEV) + fsl_edma->dma_dev.directions |= BIT(DMA_DEV_TO_DEV); + + fsl_edma->dma_dev.copy_align = drvdata->flags & FSL_EDMA_DRV_ALIGN_64BYTE ? + DMAENGINE_ALIGN_64_BYTES : + DMAENGINE_ALIGN_32_BYTES; - fsl_edma->dma_dev.copy_align = DMAENGINE_ALIGN_32_BYTES; /* Per worst case 'nbytes = 1' take CITER as the max_seg_size */ dma_set_max_seg_size(fsl_edma->dma_dev.dev, 0x3fff); + fsl_edma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; + platform_set_drvdata(pdev, fsl_edma); ret = dma_async_device_register(&fsl_edma->dma_dev); @@ -360,7 +588,9 @@ static int fsl_edma_probe(struct platform_device *pdev) return ret; } - ret = of_dma_controller_register(np, fsl_edma_xlate, fsl_edma); + ret = of_dma_controller_register(np, + drvdata->flags & FSL_EDMA_DRV_SPLIT_REG ? fsl_edma3_xlate : fsl_edma_xlate, + fsl_edma); if (ret) { dev_err(&pdev->dev, "Can't register Freescale eDMA of_dma. (%d)\n", ret); @@ -369,7 +599,8 @@ static int fsl_edma_probe(struct platform_device *pdev) } /* enable round robin arbitration */ - edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); + if (!(drvdata->flags & FSL_EDMA_DRV_SPLIT_REG)) + edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); return 0; } From patchwork Tue Jun 20 20:12: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: 110681 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3916148vqr; Tue, 20 Jun 2023 13:17:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4PaAzN2zz88uoE6AmD4JI0fhoh+H6J8bXPyLZc+7AGt1VVeBbkryDKZlKAHWcWncBt33z3 X-Received: by 2002:a54:4d93:0:b0:3a0:3ccf:7dd3 with SMTP id y19-20020a544d93000000b003a03ccf7dd3mr2599930oix.15.1687292273498; Tue, 20 Jun 2023 13:17:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687292273; cv=pass; d=google.com; s=arc-20160816; b=D+SpePg6wtPoawuuwNoUwxj/tyvuM6FS2j2Z3LbTNYiGqZE6lNvQWbvkWlmbBGbRZD lgznrimRgj8wYRbfCPOYkXBlDjhkZDI2a+BVSaEGtsJR42+29QXI8JqqQwIlt9QYlJgF cWhuHly5lHrYBn/qb3vrtcGEaaWoggZ5kwl0VYmC7RrmZdswE0gQbq36mQahLcmMtHKi Rod2xqQYvPelwAnkUSw5bzagfyNs9PwJGd+6a5/e0AxfXccqBO8MNSMEklCYO8enQqZm YjhHSumHgVlr88oUxGwgNuTr1sbngHKq98aBmGH2oy7lZafOxoVpRQIeQjLeAkhVYyXr AVqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=xq4Iw/E/mh3cyEFC2hAms1m6XpyOfkMliNlCzrEMfG8=; b=pr/jPPZFef+InGcNB97ED2vEUOmDRC/I5JaN3meiFRszKYFvev5wyxi+sLlqUYBf0n 00aq2o5NjsP9/23708H4I9/T9eRSxVM81sVTQbEhaA1HGHujdhSydJ5YtPYl1I5hVLCr ICICyhN1iYbd5XlE0S2uGioPEw/UbYm4ISjSw5qhg2GOg4xJuY58pwn0OLIaj990NMjF ES1qh1+9/TI+Gci15kdTq9sdHh+Fvy0ex8xjesX3SS3cvnW7w8i9o1lDfqO8YSdHJAsZ XFCjk9ZYiEFMtYKXVvOh8p/dN/PEY3xBBiyug7enN0BmAhbv/wITWImKYV4s1HTyk1Qe 76QQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=MlquFqCQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a63e444000000b00544054a1555si2477772pgk.460.2023.06.20.13.17.37; Tue, 20 Jun 2023 13:17:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=MlquFqCQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbjFTUPl (ORCPT + 99 others); Tue, 20 Jun 2023 16:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbjFTUPD (ORCPT ); Tue, 20 Jun 2023 16:15:03 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2056.outbound.protection.outlook.com [40.107.104.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37CE3198B; Tue, 20 Jun 2023 13:14:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4/t0aPGuZ1L2zg98aiJF92nnagccoS/kO1Ad/6WrpA44F4hLywnK2JjHzrf8I+CSGxl5tERdkB5bRRe/WFwd57E4NyFrYVqhxepHo06+fcVE6RB7Qys+/9NQ3XZKvIE5EejPJ2s+JD8p5ZUWZp1kZK1FLOjskVe24b+zylqy+yUnaJFk5An1ugAZ6zssVMFjUkaToNCZG5jmW5WCv1ZJiZDK/Iaf9gDetTqQ2g2SfxrBIAp+0lu31QbEI/iqFZRFMcbT7jAPeFH+gR2WBOdWUPQ88u5dGARyYScmN73fJyLcWJon9YBK9udOXF1mh7sRQgJJZ2Yheva1a0lrrksqg== 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=xq4Iw/E/mh3cyEFC2hAms1m6XpyOfkMliNlCzrEMfG8=; b=INtcog2dUHCVj9Kd3E0SD81gCNgBAL6zMHNoRyghA288bn782HdpANGSwsfuN8Nz4UX+YoFsRN4S2X92C4O6cbSQ3zr3J3IhZbcZ2HZth12w5U7A6gMnqtKfm/NlNnbZzX5svnzQ8ZAXz4UimT/ZO+6R23TXCdK0BQRorqpxmbxn4cqxoO/6qgkaa0VcWb1OlZKEp4AaSAUzUlXztj1ub4F8HoZ96txlEZYWtTcCrqvip0oKctNGWVM2lLaPP/AAEaHC2cfZOw/kaHwt6r3pW8+5R2o86idlcAfANBc+S7LoeBj9WMM6XfsrH/OvDXcrXGGB6mFAmKu0UrEfYxaHaQ== 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=xq4Iw/E/mh3cyEFC2hAms1m6XpyOfkMliNlCzrEMfG8=; b=MlquFqCQmgYhoG7yNf+bwSAMGtV+1XwKSmovieC5VyjwkJ49Qpo2kyJZ3ACcuF4iWkUpExRmGavWk12+hN2BTidapLRBZAkjj2d/DoJv8p34H06gG7hIPizYTC8Fd9aMeOGt0z9maavuMy3hriSWT9qFLUgVmASfhi2ogNDJvy0= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 20:13:13 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 20:13:13 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v9 13/13] dt-bindings: fsl-dma: fsl-edma: add edma3 compatible string Date: Tue, 20 Jun 2023 16:12:21 -0400 Message-Id: <20230620201221.2580428-14-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620201221.2580428-1-Frank.Li@nxp.com> References: <20230620201221.2580428-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0086.namprd13.prod.outlook.com (2603:10b6:a03:2c4::31) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: e4cfeb69-81ee-4b53-610c-08db71cac6c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XX+y8EQbZ0pKO9RiqcCmY60IgE/Uxn+R1/2HIcomZ9iO6QRz1/UNZVcspNcdW8UMckOiBFMCPwdt7GR55vOVB3DL9tE1TyOCFs5jrxrFx6pUiuxgXG7E8kdL2ZWTe8hws14hqwBIXZES+N5+wKrgUlOeTCpypfN+FPA8AOHcbE6jg2u0DRWf2VSzycw0WR8ulsFTQnAJf2c8SdnxF4O/tjuqkC/kiR6QZ/gFLzQ8N82UC85zdMROpaFtMUdDA6uDAZaqosXJSgIfWvPi8eomvZwN2HwKtYolZq6W/DC1gXBLt4tffAFwAgenlzb2ch8lt6QRNjyiG4tD070MtPx5R8XLTa4MsZdsFx/K+JwPSUmPx47bRNWg6HakLfBMTZK9/YqGyE3qFT/HTQlZ++oQe3weqwqNGPn7LQdsltJvzV59TTxu2IZIdg5ukGUF8cvYqD+aeL7CC8RDleCY7tOsWoQ5sTJzDPURdCNo8/LbGs6kpp2waHMREom8l5pmD4LnIWoYja/SIrwohGAP+BcqLdKPRjLWTmz37BATBgbmhDzYGQskE2hIy3r8AIJ31OIERYFSTnFa8DwaIOzCTXaxV76HIEbSAhQTYoDRB1orNPQaYoK4S+MrwRkWpnz/Uuyw 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:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(83380400001)(66556008)(316002)(41300700001)(66946007)(66476007)(36756003)(1076003)(6506007)(2906002)(8676002)(8936002)(5660300002)(86362001)(38100700002)(38350700002)(921005)(2616005)(6666004)(478600001)(6512007)(26005)(186003)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Okevdtol618Mw0GtHPrJJ8lNcEtacisCuaYxMTFeC0la9vkmsYsnMqRmCxBtV9th/CKrvPN/O0R0hEoKMIzcu6JUhhZo32daFSRgP4i+gGjTNZKeW+Wpi77Er3G+geLdtofzNrx2u36JwfJJ2S1wsleJTL3LCEk/jsRia3cIbnn54elTQdXjghbcCJ3kq/f9OvXdhflySE86TP7ulBs/LgTWYaaho39eMK+/+LbWU4wGwCjrPk/ciJBI1YUk2G5mq469W9591XN6Cd7FFYMar5u2cTR5E9V9zzyljo9aZjAuE9FJG3TWsWTmaakAC9t/74Uka70my8nilv2r5sgPffzglBYE4pRUv+4OLw1AolLpNgllQebN1I0TyEjHs9W4T7hqN7uN89rg1whOVOl21EfWBDqV5wtYqOO8eP22qWBT3yGDmWCDJU3VnuKggCowFv+RDfvwibhWpKDDnRJiLo7UjnRPfjKAcKnrq5B36+P6NU8XG/IhMZVL0GBtkP3MINxYR0eGS9mOqTUdiyL4QlVn7pk8WZVnPLLhGeBPMPRxv9Ol8T5cMyykCpsqqENL+N2goS9yior/512LkvUhw5uuLm3uRKjOI58rXsCrzSNqE25o3b3q9ydLE6eKTzu7u4OcHwU6YnZcfHMP6p8XCegt//CTp+c7XefnPmdiSQcKb4FRcz7DpzgIvYhkUFrP1EgYRtoVhJpmogzqva0u+yArJJ4EQ8UvEUO5Rk029e5ekBwdNnZDBey7h45gh+D5YkMljfb2UT/A9EfTlUD4weLteo10+ksUp7YN9/d7huaZyi7+1y5apLIAUXLRSof9oWf98E1yGe0YzV8zBoC071RMDz8L+W1ejZ7FM5/5z6ZZpVgBU2DsIQBHugfWCtN2P6cEmsI1yUWUcOfVMieB4lX4vi98WezaL25eQVba8JX/fw5Alw6EiTdqngGqZDZXjSB00HSGD286sagpqP96Uxcxk+1mbDNEDvxG318OQmzuW02myltU+5r8EBOeFlWF3PNea1mv2cllkrS2iOGkNnvXzX7a1wBDTVZOtPXE+fZEdChxZW5jdHq0AWo7KCmer+D35SoISLGYhkGu8bZif8wIqpM6STa/q+P6QXSP3ZO/cDLp7BvknEkf2R7yeDMBzZ60RkpSK7VPeRXkSMqCKAwzD4BS0QN1NhvDaPuUPGHVE9OlPr9To9qhYbvTx06Aj+XBxz2y1woICRGmeYtuq4fC4E5hAVidCg863zDq9TwHJ1I7Tp9sS7vSaxS0K3DJ2YMABZRV8bKWN+wF4hoywRofb/mcM/zUt8MnAEHVVYc10NkI61iaOM84fsCptvLIdNPOVBmbB9Zo0uZNndNa0gIIwUv7mjIzT81m4JaJR4R7l39cUI+bRxumNznBCA0WTQ5knbD3TlbySu+/S7hOaQjXzBAk5u4O8VJGTZC0kTK6BcrPIFuQMofW7lydfDHPbapF9yNQhu7X2awQU7e/NetOtrLbyjIMzva+H53RqprhP5vUKSwKhAiNJjLrTZxJ6frTHWT6aA2UFMy+i61WP345Do1u6bskoT0+DCmpIYvjmsyMzbTnoSM1PXDtW5S+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4cfeb69-81ee-4b53-610c-08db71cac6c1 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 20:13:13.6348 (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: IwQ+FotIqU4/Cwrcm5ravt9W4K/TjkZ39I+MB4xlgK2CgZYL8+JfCY7JfZGypQBmaVbpzNAJEbDRJqIrqQVs+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769254182882891255?= X-GMAIL-MSGID: =?utf-8?q?1769254182882891255?= Extend Freescale eDMA driver bindings to support eDMA3 IP blocks in i.MX8QM and i.MX8QXP SoCs. In i.MX93, both eDMA3 and eDMA4 are now. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Frank Li --- .../devicetree/bindings/dma/fsl,edma.yaml | 106 ++++++++++++++++-- 1 file changed, 99 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/fsl,edma.yaml b/Documentation/devicetree/bindings/dma/fsl,edma.yaml index 5fd8fc604261..437db0c62339 100644 --- a/Documentation/devicetree/bindings/dma/fsl,edma.yaml +++ b/Documentation/devicetree/bindings/dma/fsl,edma.yaml @@ -21,32 +21,41 @@ properties: - enum: - fsl,vf610-edma - fsl,imx7ulp-edma + - fsl,imx8qm-adma + - fsl,imx8qm-edma + - fsl,imx93-edma3 + - fsl,imx93-edma4 - items: - const: fsl,ls1028a-edma - const: fsl,vf610-edma reg: - minItems: 2 + minItems: 1 maxItems: 3 interrupts: - minItems: 2 - maxItems: 17 + minItems: 1 + maxItems: 64 interrupt-names: - minItems: 2 - maxItems: 17 + minItems: 1 + maxItems: 64 "#dma-cells": - const: 2 + enum: + - 2 + - 3 dma-channels: - const: 32 + minItems: 1 + maxItems: 64 clocks: + minItems: 1 maxItems: 2 clock-names: + minItems: 1 maxItems: 2 big-endian: @@ -65,6 +74,29 @@ required: allOf: - $ref: dma-controller.yaml# + - if: + properties: + compatible: + contains: + enum: + - fsl,imx8qm-adma + - fsl,imx8qm-edma + - fsl,imx93-edma3 + - fsl,imx93-edma4 + then: + properties: + "#dma-cells": + const: 3 + # It is not necessary to write the interrupt name for each channel. + # instead, you can simply maintain the sequential IRQ numbers as + # defined for the DMA channels. + interrupt-names: false + clock-names: + items: + - const: dma + clocks: + maxItems: 1 + - if: properties: compatible: @@ -72,18 +104,26 @@ allOf: const: fsl,vf610-edma then: properties: + clocks: + minItems: 2 clock-names: items: - const: dmamux0 - const: dmamux1 interrupts: + minItems: 2 maxItems: 2 interrupt-names: items: - const: edma-tx - const: edma-err reg: + minItems: 2 maxItems: 3 + "#dma-cells": + const: 2 + dma-channels: + const: 32 - if: properties: @@ -92,14 +132,22 @@ allOf: const: fsl,imx7ulp-edma then: properties: + clock: + minItems: 2 clock-names: items: - const: dma - const: dmamux0 interrupts: + minItems: 2 maxItems: 17 reg: + minItems: 2 maxItems: 2 + "#dma-cells": + const: 2 + dma-channels: + const: 32 unevaluatedProperties: false @@ -153,3 +201,47 @@ examples: clock-names = "dma", "dmamux0"; clocks = <&pcc2 IMX7ULP_CLK_DMA1>, <&pcc2 IMX7ULP_CLK_DMA_MUX1>; }; + + - | + #include + #include + + dma-controller@44000000 { + compatible = "fsl,imx93-edma3"; + reg = <0x44000000 0x200000>; + #dma-cells = <3>; + dma-channels = <31>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + clocks = <&clk IMX93_CLK_EDMA1_GATE>; + clock-names = "dma"; + };