From patchwork Mon Jan 20 07:13:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13944794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42375C02185 for ; Mon, 20 Jan 2025 07:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=erx8eVIlp3RSDPcLYTeD6QYzg9uYKWXIG1suoWmMaWI=; b=C6TsnmIoQsbiorC36ELUFsu+Qe Bf4tupOaDZ4BqaAwv6UCPlZV9ZAAu8mTGMDaU0qTI5U7CVMHrJbeRfr+7KdMb7238HL7cdPnAeTr3 dGP/KXE83jtjq1ICdbsq747gnvu51OHSF5R3t3jdGEGjP77MUib1cqjVqgkR3tKNZp5CHkNzikPm+ jczdjNtU8AeXDKVf6CspjDUo0r0QirOah4iag98vS99OgFF8G83r54SkiRxtjX9el4+gKO4Fd2nkp N7SQozHMwqqwVNRjuD0wuIU+fj6/rEJZ9U3MI1Uf/Ogm/5GYn29OvYKW4LGhisqnUfN9eFcqxP0pc hxXi+ueg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tZm24-00000004tpZ-0kif; Mon, 20 Jan 2025 07:17:12 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tZlzW-00000004tVG-3s7E for linux-arm-kernel@lists.infradead.org; Mon, 20 Jan 2025 07:14:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KcKlGYpBVnwrbEOqQddcyWWESD1EpEpPOZYJQL+5aZfTw5EzcDOl7zL4aO9o4wo3QA5IHOqnYFdFhkOenPQuDQJk1TH3HkE6jUhpfPYXaZS+fb+avybi+S/4+6OsV8gEwEzog3cu7Ls5lqoN2fir7ZXcMKKyzQTUJkKrAW8Eyxe5GzlVXQF1Wf4jnMNQzh2+0yjGkWx0B82XZtmIQW++WJkwsWWXTg45yoH9OGyyam6w9gAXSQy73GlrBDNpsDUak12omubUXgU06qjpRPujr9OMYXBgfHG7lwYDaH7HpHRYmCE36FGlzB0LrTG4fLm6Cmg4KCKHxO36Exq2B6bhHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=erx8eVIlp3RSDPcLYTeD6QYzg9uYKWXIG1suoWmMaWI=; b=SKSQ5m3KDF4ej6uLrMC7CvJglp14LVENg3P0R/fVcp8G7uLqrm44FTo9c5sGsCMWsRM2G3mgCa2AWby0KlzeafI2CvjTYRvn6kJ89D9rx0fbuQL3aQA8YHbAyzZvGigABRbye+jk16uxLaJjFdoIYTPSXMQws9ZNfQP+bP206/1CXFLArIOIsYSyd1i32Amt8/pQkvVI5FD51bZmeGZd/xCltxcmckAyCtAgw+0Rt72QEKj1BSug3gDErKzha5BmpOwF8gPkOG/1bS0XDFg0XFPlvcwpCNlLVRl8GTv0KKIsxteD5mjICJy9bQAO5oVcj3eIWPQmziUqQ24qpEwWNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=erx8eVIlp3RSDPcLYTeD6QYzg9uYKWXIG1suoWmMaWI=; b=mtRUcaXs1Uj2BBDlIuVm+aJkDG2+pSTtajqihR5QXm63XA74uDYEhqO+XLQr+8k3mvjAt8CTYJjFW/i6AMpCAVb4NOySkzTy5kLKcAsQ5UPA/7nkn4QI5u0dOsUUTz+Z4z0Wo5gbWioGR2N2p9dvKTcHvbPU5wvdEHKmxVmuj26chbIBtdpPwRXgMVqL+hL7XhPwkiU2lpr/eknd8zQz9TwlsiHkk+Z8A39ZsQSBANTFb91LfG+di3ywGXOqLjP1dUugJW/jaLPGaBvF/C28wFCwdCDqTDiJOd8WJoTHgb9oJTO93em8gm9zjhY+PJ7zNNVnY9yG/g0YCN0UCbuafQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by AM8PR04MB7442.eurprd04.prod.outlook.com (2603:10a6:20b:1d8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.18; Mon, 20 Jan 2025 07:14:30 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8356.020; Mon, 20 Jan 2025 07:14:30 +0000 From: "Peng Fan (OSS)" Date: Mon, 20 Jan 2025 15:13:29 +0800 Subject: [PATCH v2 1/4] firmware: arm_scmi: Bypass setting fwnode for scmi cpufreq Message-Id: <20250120-scmi-fwdevlink-v2-1-3af2fa37dbac@nxp.com> References: <20250120-scmi-fwdevlink-v2-0-3af2fa37dbac@nxp.com> In-Reply-To: <20250120-scmi-fwdevlink-v2-0-3af2fa37dbac@nxp.com> To: Sudeep Holla , Cristian Marussi , Saravana Kannan , Linus Walleij , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, imx@lists.linux.dev, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1737357232; l=2383; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=TTcs1ka8AGza401JDsGE2qHEBDq+jKflhkDqiuEGx+Q=; b=1btUXnBuoQIXcElwpFmt/LWfmSpOvjKwRqA7P4VwXaKv7QpbsJCY1xXjKxtfoMKw0L1xj9tGs rqA0MRmQE18A7oVFSZgfW07JGdpYijAMYCdc3US6Y819BxGd9RU9x+a X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR01CA0129.apcprd01.prod.exchangelabs.com (2603:1096:4:40::33) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM8PR04MB7442:EE_ X-MS-Office365-Filtering-Correlation-Id: 2886f9c7-c03d-4110-51dd-08dd392214f7 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016|7416014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Byj0ipgfDkLPesimIZp+SyLFw/9hLnA?= =?utf-8?q?WFlYh/L0H2Z+X9nHDvX1cAP6rfvPsVsXE8IJqenUNN1wmjeHgvzDaz9EiEJhvOEOn?= =?utf-8?q?xx4BVoc54IegPzxxb00uhNy7PJNyxi2zYryRFk/IX1/ox03g1YwMzpUN5kdVWknTE?= =?utf-8?q?PtD6AMv1117+WZstoxHV921fF1rvZeB4x4kaqdesVbbyDpbHYAh4bDw45rXjqtqQg?= =?utf-8?q?IDdJRQLqrVCrLBK2rHYgYEUnVWQwEe8fFFjy07UbwbDlywKlDMo6cXIkLtxyFGokq?= =?utf-8?q?Zks7ec5HqYSXHbxr3AzUFT/tIrj9I5rt+C/+lrwtUdnqVBCMsVogbuUYvBRM4pLd7?= =?utf-8?q?twALEp4Vnt7QmoWP10NneZ5Q4v29Zs+GF6pfWr4gfrLx3lZdMULIhkycCHadasK1E?= =?utf-8?q?0Xi6HdFTVoF2gGwZ2oZRW5APzYmLjeRiL6XRjtScbiJPo9JHkvjloveKzobutvDrE?= =?utf-8?q?hIQtlJf9PeJfMK2+nWRUumCEzdTFU0y+jbQVtZ1DsdFSwPChB1xHW4hY0jLH3sayL?= =?utf-8?q?9CMWLVpfMdkkJXfTlXmd2FKFe44ps3TRjNhXoHNTT+/+QBwWTie8lvjzY8ZpBJ7/F?= =?utf-8?q?DC/vdZj58wKPEsDcatWMyFxkhpDvFGBFsaMeoF/Rcsv4LnCuAgsHOyO64lq4aUdlJ?= =?utf-8?q?Sj5FyHuYQQExmcFb6Z0Uq9LFfMPEB9IcCSQndf2OcEESGvYamwmuXXNLC0xm5RUG8?= =?utf-8?q?q5zhdO6zSjDa0xw9eJePm9siFfAyPgsN12ZCaPcVFdRcOqmYpqSb5gLH6EOqC55Tf?= =?utf-8?q?1NzSw37Ta8kR6jEGEiAPoHj0K4c2PEF9jMXnoutiYTqH1Y/jUo1DAVaEXG2SSvKq/?= =?utf-8?q?yBNOcvg+DVJkLS+KghMsgiWEfgOsJP2UIfmIxQx0m6zmTtxIHiY6HaCR0TWTaluXT?= =?utf-8?q?tobGbWGwcKYJKxOjjRko8bsTZZPMPmX0VFMdnJayU4GGMgVSUvCitVu6L98KYHu16?= =?utf-8?q?KW4AIqVi4RnnL04FphA3gD3sgfe8g/YJ8eYh1MtoWdEFtvNRFYR0CHfftZcDyGBiC?= =?utf-8?q?yPCNnyS8ot5RORqZKHBDWmXOnA/dibOpRXp6Y0v9Yiao5aXfBbxppbFyFCoYzgdef?= =?utf-8?q?UGYg0AsU82T/9AISKemrD8yyB/hN5T7EZF7+J1PrqFY6fNFDVVJn9BAj86nkqBG9Q?= =?utf-8?q?Bok1IBMoxjnrYyJV8QIEvcEdlSG3B5CPi0SMpU4j1zcXPHomViVbfLmKNaPYXPs39?= =?utf-8?q?BBUquVZaTVvPFASvSw4N0l7cwXzU2TdEdV1UHMfMMPgylcb2uaSPs6S3jSUF+U8pF?= =?utf-8?q?SqCfXFqNe+KYhQclXZyvGl2xWyAS5qG6FoY+dkQ89c884lxLnjXAsec3G+ORK3x4o?= =?utf-8?q?EiyGLIcbT4IAI+T91SdiWHSv8Eeivqz9qzQR8xwTeTlsxuHBb+ca4C10bsPHsdh5E?= =?utf-8?q?JmCvI05dlIGymP5y2IsFBUHuxykWdpk9w=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(7416014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?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Swdw6qOBHT0H6Ef8Fy10KTHaSh2o8ipI?= =?utf-8?q?vn/TJb+SFMXwmIdpESDo97IVuyOqtWIuXlgiDIDxIayhhKDzGVgSk0x790ER9H029?= =?utf-8?q?m1zFrJFWMnMtzeDl/niXFqifq8MRfzaTxZTfFJn2uvZCvg/hP9ZSCzwtIDYlgeutq?= =?utf-8?q?k3iTmSPGv/KnsUxOxXxdGfDTPLe64FGcvGQE/ef+WYSHqVA9uT9bjmpnReHWhshFy?= =?utf-8?q?ylJ5L9zJ26pyvQfmkXKJl4oiz281j6C3konrlClEjDG08ovPtOv+VfrYAnCkPUedm?= =?utf-8?q?U4O0N6YJIYoyTo+DEOzo9pbrSU4zCT87sMgXpRvWey+idHmoagt31jUznrNPBqvLh?= =?utf-8?q?3TS0aR5gbtPun+k7Nutb4zS12BO+lUszPU9Fnd1vdsGeMq+TNijo3+rNugGGOZHK9?= =?utf-8?q?jgcfI9wwVn4kKkglAjy+JLNsmGnTHHxTkwPmTt6LJA9mqeAVIX4tzzDMgmzcx7zlL?= =?utf-8?q?3Jtf/H+FTN86XNtjTM8N/nXSR9Jt4LaMuhGTP/UDfsVzSYv8mpt+QNWfDXdFRTsvn?= =?utf-8?q?aQiQRuZ5CSQgLw31Za6xTO+YOX7r156gGHWrUl1/L7kZvViT/ZxLkgJdVO1mjyzHx?= =?utf-8?q?+qy2CQIOcSC0iXqlI5Ljn7YJnz97y5UMjVOoSoj86LY/4tx8J0xk1DEJlBxQmWz2W?= =?utf-8?q?6rddpyxCI7uZ?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2886f9c7-c03d-4110-51dd-08dd392214f7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 07:14:30.1672 (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: SZJWl8Y2QBWHsU/kTRaI83yyKJCEToKmC2v9xd08BH1L2FQ4MgBg3+NRHD0XcAMC8Ex195IYWjimiK2LfUqbKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7442 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250119_231434_969634_483C72E9 X-CRM114-Status: GOOD ( 14.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan Two drivers scmi_cpufreq.c and scmi_perf_domain.c both use SCMI_PROTCOL_PERF protocol, but with different name, so two scmi devices will be created. But the fwnode->dev could only point to one device. If scmi cpufreq device created earlier, the fwnode->dev will point to the scmi cpufreq device. Then the fw_devlink will link performance domain user device(consumer) to the scmi cpufreq device(supplier). But actually the performance domain user device, such as GPU, should use the scmi perf device as supplier. Also if 'cpufreq.off=1' in bootargs, the GPU driver will defer probe always, because of the scmi cpufreq device not ready. Because for cpufreq, no need use fw_devlink. So bypass setting fwnode for scmi cpufreq device. Fixes: 96da4a99ce50 ("firmware: arm_scmi: Set fwnode for the scmi_device") Signed-off-by: Peng Fan --- drivers/firmware/arm_scmi/bus.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 2c853c84b58f530898057e4ab274ba76070de05e..7850eb7710f499888d32aebf5d99df63db8bfa26 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -344,6 +344,21 @@ static void __scmi_device_destroy(struct scmi_device *scmi_dev) device_unregister(&scmi_dev->dev); } +static int +__scmi_device_set_node(struct scmi_device *scmi_dev, struct device_node *np, + int protocol, const char *name) +{ + /* cpufreq device does not need to be supplier from devlink perspective */ + if ((protocol == SCMI_PROTOCOL_PERF) && !strcmp(name, "cpufreq")) { + scmi_dev->dev.of_node = np; + return 0; + } + + device_set_node(&scmi_dev->dev, of_fwnode_handle(np)); + + return 0; +} + static struct scmi_device * __scmi_device_create(struct device_node *np, struct device *parent, int protocol, const char *name) @@ -396,7 +411,7 @@ __scmi_device_create(struct device_node *np, struct device *parent, scmi_dev->id = id; scmi_dev->protocol_id = protocol; scmi_dev->dev.parent = parent; - device_set_node(&scmi_dev->dev, of_fwnode_handle(np)); + __scmi_device_set_node(scmi_dev, np, protocol, name); scmi_dev->dev.bus = &scmi_bus_type; scmi_dev->dev.release = scmi_device_release; dev_set_name(&scmi_dev->dev, "scmi_dev.%d", id);