From patchwork Mon Jul 29 07:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13744396 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 A6275C3DA4A for ; Mon, 29 Jul 2024 06:55:17 +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:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=lnUfI7l7G+dWmuKWcK0OFsh68QfLnYE/LBrRY1hamL0=; b=vbWhIMIGb0HhwVQhFCCDsVclCL rYnPwOumkrBLxjqG+AjgtOi8aQvYW5zuNY+Ua2JudoWJ3IUK3Fysmaj9HAoT5DJn/+pUbArpIPEAs pLPHdXorFzjFX+fwmZVmhcrtlze9C0EdObDGjnyjBUKWanf/kKESz4Yv7L+tiZ+cLifZOdv2mdB4d vjAcSAnsI0wsPcIpEFRvW/vGKqZ+f/hPde37ogFPme9LgEBxm5LKRubIpn+H4xP1i8qsFuIWQDf4s 3P9soUM+rgAW+La2RaHzC/oidq5ocgQhcrE/UKZmVISUdSHMPETBUg2WNDRK6Y49C94h2E/WL7IE+ yKby95GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYKHk-0000000ADZ6-3LVM; Mon, 29 Jul 2024 06:55:08 +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.97.1 #2 (Red Hat Linux)) id 1sYKHI-0000000ADSd-2eXl for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 06:54:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QZUPTN+023oyd8uBzRp+ALCSfHfaGeUbajcnb4lSgy63YuEFaKRpR/anff8ecWxxLS86G7OC1i0UseRH+GtCtjyNkgepV2kN34gJhUcpgs8Xx+wAmAXxx5XffAB+UE1yNpKjivf/INzwIhL+/17JEqEYaUlcFM4zB1xuvr9PqSl/Hpn1TMay5jSPzFSWFLIzpHFStI8PV5tKIppMuX0yKSM93fIvcc0yIKE4EjfbQP+hdcsNdnBo/MGnAD1uWdaUf5xeZznnfD5D/MeVQy3NDDFOUMVnhxivIP1RktC2WcCy33IHuvKgeiKS02E0penYs+HM/XwO2+F3IhtGm9ra0w== 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=lnUfI7l7G+dWmuKWcK0OFsh68QfLnYE/LBrRY1hamL0=; b=AzhPtfc6Lt3Zyfz/wj0pUwdGrJpHYrC3tQZxWKNWhRws+7XX+1UPlgaeqTG2VYo3C5GwKkxO9/c348vEApnOCyl2YJdTDzyumU7gZ6n47cvFyaRT7VzCJpQVy4JKmqAY8hEJIgXqrqnr5k7hE1x1nq8YY17TiRgK/EXVwpNRUdOmo+5XHD0B3xA8MAI66/gV1jhfLmzoZ5W5tTdLL7cIhN2ypI0pSgpjdH7yrq4yKuIsj07CEVyOwGkKvvFPhdfWZ2j78IDO+Fxz4/MRBZn60tLK4dc7ADC6/VpUrFZT6jb7N+fRpD/3ShploiI5+gn3a0refRrKDmvj9rh4WJ6b4A== 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=lnUfI7l7G+dWmuKWcK0OFsh68QfLnYE/LBrRY1hamL0=; b=m/UWzSW5az0n51BkzzNOhkCoAs6G/rc12zpf0ISHInV978Nlx3k1CMNUp7XMtVxp9nqj+txef5jIPwa6WtasrCLJXZbHNhVMVKB4nwKB1sdycjYUKwCFBdgSQ9tuD8+DHyBADm/9PPdVbhhxq8IxGTMzHW/TAvjZEHPPUunGfzys3C2QC8eZ6Yn11lkCJg6+a8dk8ljxrsxJYtAVioIrZ9lHBBhhMyH+VQPs8qKognCI6uk2J4yhqRINNigrnWngq+ynZkZEYuYGbDdCYp8iuocLj0Vbkn0MwNIqy5AuKiGWsoPArTHtI5XbMGA1m5GwXuOU49yvOYyfF7o158D8NQ== 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 VI2PR04MB10858.eurprd04.prod.outlook.com (2603:10a6:800:27a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Mon, 29 Jul 2024 06:54:31 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%4]) with mapi id 15.20.7784.020; Mon, 29 Jul 2024 06:54:31 +0000 From: "Peng Fan (OSS)" To: sudeep.holla@arm.com, cristian.marussi@arm.com, saravanak@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arm-scmi@vger.kernel.org, Peng Fan Subject: [PATCH V2] firmware: arm_scmi: bus: bypass set fwnode for scmi cpufreq Date: Mon, 29 Jul 2024 15:03:25 +0800 Message-Id: <20240729070325.2065286-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SG3P274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::26) 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_|VI2PR04MB10858:EE_ X-MS-Office365-Filtering-Correlation-Id: c99cceb6-e84c-46ca-cac0-08dcaf9b4c73 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|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: SSonQv2j60LcY7ol0bgaPt2tKXKEuJu1lnNdCkdiz/rgDpmzCkDwqHDJ5IszbeEPE8woXH+hc+K3NZG3sPTd1M4MSyLX7hKv9ppsOFzvQJwoHyEXc1vmEUiGFun/PS1cuPtwsGBhLMY0Y3ggaoJdWc0irZHUjO//hQiMpK/U+AbyhnTh4sG3QBJH9qk3s6be3T+007vqlXrJIFueT1CN5nWkNfRosSIuMH8E40HX03GvBYjJVtdfrX+RmJkA4FW0Jml9ZRbe3YkhQTRGea/+VrSyYV3RWcR59ppMFhw6TnwF244MwcYqHgiXRBdOTUbz+tDtkrfe43huw1qcSM7NC0FrHnKbHHU9omluXqw+/UTSsQaZ5QqNjIw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SPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8hwbPJUOyRIuWxAbhRPrn/8GrXKImtZjZSpBEbx9umQI2TO4XUddVh1zk4ugEuVw5X768LvRHves/dviNpUvflYVFqHsSetban8X2Tb4zK7/zzxZACCTQ930n2x4pO2ak8UzjYOWtUyxe7FthE5vP8D57NiqUuslohBFpiw77eP4ayWehut6yIB1jsqoLhi6BVxUMNqvuDXXSFolC61SDKRHnLjBixylIgH6ygjvGox1pQ3od2GuTrvTBIrrYpNbO6zDazUhSVdsK2eK7YYORBD1L5WS7uBJXfHcP8TKHrSA236BpOr6Y9kP9j3xhE/OAQmCvEaj70Mz1qwdD6o9gOeVLC77zJhSH8COebNH8epvb+c4RWgP0JXwnh18OxmhWXJttQHe6PvFOFZOspvaNKkZ3dMggph+oMV3XHUcEAPciI8aahFvlH1Ji0She4+H5TgV0RhvaV0K6sSjn2s4J9dIbmco7VTjJbnGfI/EcoJLcfvEFalCla86O9r0+CGnYhV3ME9cmMYeYbYCld5EBdDgiH9GUyOpRSjSBre/J+NHkmEHSicjspAO2+L0ubyenXzIHf/FAwCKGkgAaVhCv1QUkx2OY1d9prRlxyFMn3yinxM8pl+aegJyyMgnaa14bh7s3Cocp/EgDs8EDcgUOoTe6J5RBp7JZQ4Ah2DHN8lsEAJLOXiTrrlm+uXL4FQ6/4Q3YLNXu+dpPvEuQ36zlMp63z+nt8SWhUnGvfnL7ffBvvFBAIFKykGIS0R0k0/lVRgmU+Fh6Uat2yUGSpG7uzFvxJEMsVRUs4/XoaWW7396abohQQx+pB0jgao9OykkJK5xTHGKzVIXeJRGpjBzAdM1p/1Sq1O4l8NcDNC5W50oseDgfYiaA3vb4e9HVYU68/lKQ7WprSWhemY9sI8hOqySdd3HYZ042yZH9aJR+9oKhs8KHKCWI6sv3Ugvk1WFvKfDLVTM6wBAaEMXYiqN74+odULnuFqFtiOO5eijK+6glthic2JR3RqWiVmISHIGo1wyTWx/P5aOcGgI4Gc8JMzFbm5/VXHXHenfA/cZPnEmFUEfPqU/MADQaOu3yYl2tzlsU10iYx0+Rn4TMQxMrN3lmrPT4jMU/Hz4ksrzuTpkU6r+TOM39DrPSB8siWAKMN2jj574Dk3nKbrCFs+RwjZdhjC17QtnAbVQbnGJCx1i3nYF+hmewR6r6NLqzrRM2Q9pYznrXX1leYl9JQlgBMFQygTAy4FcKkFZi1Fo/kRRslyC8EU/3RRWvt00MbEX4pzmFbX9/DkRnh4WJTQQ+cBxMziCHyG9mYFajqakD+UAgCAHCMoOOlXYyIR+ko6lHMV6XI4v6LHD4UXkyxmkT0Pbp74RV6aRx5qEBTA72bSpUxhbd/IdGKlU/wG2CpE/GJWOTbzlMeZV/GAhItpAArAVPePnH8AsiXJwb7VJCwg9xAUGb/AUnKhrjC0KaQTIBTW/lWUsQlER5R2jj928tJE64hPALbOjzSKYoNJJQz4x+T8dawh1z54MqN8+fibZVE3V6KE/kiVplCgn5I00l5KD1RUsTC136My2FGj2eN+nMS37ZMa0eXfvxE3H9z0x X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c99cceb6-e84c-46ca-cac0-08dcaf9b4c73 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2024 06:54:31.9043 (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: 8JliauFhiWG6DnAplMbHg+n07+vk4GCP/7hTQXDQxz121tMeg9SOpKIbBAi7BGrCPtisk+fB2KwqBPFzi1u9GA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10858 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240728_235440_707903_E4DA3855 X-CRM114-Status: GOOD ( 11.55 ) 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 --- V2: Use A!=B to replace !(A == B) Add fixes tag This might be a workaround, but since this is a fix, it is simple for backporting. V1: https://lore.kernel.org/all/20240717093515.327647-1-peng.fan@oss.nxp.com/ drivers/firmware/arm_scmi/bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 96b2e5f9a8ef..be91a82e0cda 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -395,7 +395,8 @@ __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)); + if ((protocol != SCMI_PROTOCOL_PERF) || strcmp(name, "cpufreq")) + device_set_node(&scmi_dev->dev, of_fwnode_handle(np)); scmi_dev->dev.bus = &scmi_bus_type; scmi_dev->dev.release = scmi_device_release; dev_set_name(&scmi_dev->dev, "scmi_dev.%d", id);