From patchwork Mon Jan 20 07:13:28 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: 13944788 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010046.outbound.protection.outlook.com [52.101.69.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4818145A18 for ; Mon, 20 Jan 2025 07:14:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737357274; cv=fail; b=ZrmD9/KQKjrlPdGyVBoT13XWfXUY47sNWLWQsga17xKFwH/zvGNAiyk7HFw+ekxitNiNdAevyNA9pn6OP75mKh3DfqK7UX5ibKald5xVc6oZfnPerFLTPpQcggEqzTwzPdNITdlACugip9aobljibGVVsLhYpTZd9y6rQ98+cLQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737357274; c=relaxed/simple; bh=F4M42WMbh39i84M01vdmMHQ6OXgp0yVAUFLDe40K1ZY=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=G8KCZQKjYjlm7WlAxGZIJq4hndSkSR8a2JrJeO4OuWLaOiCMZi9h3/9V2sWgEeRTAEHd11gzbpy9/ERblPYOy7pSwivxfD+S7IRGtLYgeczH/Ra7r/9XA5Yp+05xZONlF3HiJwAddPH0aAgMzv5He5b1BW9L8PHFJ3iOtkCXa8U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=LqXuNFYT; arc=fail smtp.client-ip=52.101.69.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="LqXuNFYT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uXLUvlCvG7KfxElDIdCCZM2OMSY7qs853mVuYu6ITVnGbnuCZ0EML46EkrG/FuZgevI3fkPM5ssAuDA2Qq1zkPSywjvKEpPnOBMYUT6s5fEZKWKxdbX+jUBYm4nXIs8gr59M0FSqbF8i7H7HtAIoqPMDFD5cfrR6IQBY1Q8oSAYJpdyaoASyCdP5BX5qhuc8RMhhGFSrRrLFTaDqj1ZsZRoI1fceT0+yV8bVNT1nb5FQ5awbDy3Xyqz8ToDH0ZbdwGSsdGoi8Bo2RGZ6x2fapfdxZGzQ+EohSsIegMqglnRPZ7OeHCV3KDQc3jp3s3lfrm/4sAqBEtSJuHRPkKNeww== 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=AgS21H3Egr8ic3h4bMPj+WHsijaMNd9IItNr8DHZxX4=; b=wrEED7sz2/KY+sVbArSQElXhpk3qaS63abRtzHXGPVL7vKmbpe88LHi5wSTGAbt6SDqqULUOEGQfqncwRnrxsmhkaGwzefBKkoJ3sitLdpFoleeICfytcwaIv7M3j9bDosWgHGTjCUw4MvL9Ema3BRhaXkc+/Gv5VWAcI3pT8PnHn0inV4ILNBND82AAQicW9yhC34t0e0aJXKQ0EwIcYLutQLTLxWttiYF9wU1mWNPRbKbxjYjD1kDGSyKH5yHierEUu/+gSENKyCFkY5+N1Ruf5VFusCQMrE0kDFenXmYXqXZagChJPsFRdFGJ9lCdxrItaTX2Yxu66rTfzZYIPA== 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=AgS21H3Egr8ic3h4bMPj+WHsijaMNd9IItNr8DHZxX4=; b=LqXuNFYTbYf8xtLDNJzDPATlI8ShLMCFe/YWvz/9RQm9j8f9BMYj7+qfohiRGccbrwlLGhs41eBItql2lWZtUDdwhc/sDcoVHWpbID/GBPFMSDfykNbgN5PekbpHWu6t5uro8MFWAaPSyk6etM+kdcq5R5+LY/Vq6QAhg7nODvVSjXGsQKAmSCyuQsUaWOAj2WN55nTrOStMO9pDsfJIHYc6b4g8cex1CNnItkeR84qOr7bcT7ia0KFmFEZuSYO08OOtrAci1uVCKWYZbmQ+jsx0TvZpJUtvwVHTciQw0949/UVeQnEJRBA06GbOrXR30aBHW3XK1vENuJAm9kPCGQ== 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:27 +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:25 +0000 From: "Peng Fan (OSS)" Subject: [PATCH v2 0/4] scmi: Bypass set fwnode and introduce allow/block list to address devlink issue Date: Mon, 20 Jan 2025 15:13:28 +0800 Message-Id: <20250120-scmi-fwdevlink-v2-0-3af2fa37dbac@nxp.com> X-B4-Tracking: v=1; b=H4sIAJj3jWcC/3XMQQ7CIBCF4as0sxbTgWJSV97DdIF0sBMtNGCwp uHuYvcu/5e8b4NEkSnBudkgUubEwdeQhwbsZPydBI+1QbayQym1SHZm4d4j5Sf7hzDuplGhw54 M1NMSyfG6g9eh9sTpFeJn9zP+1r9URtEK6o0yWnWoTvLi1+VowwxDKeULkQVgiaoAAAA= X-Change-ID: 20241225-scmi-fwdevlink-afb5131f19ea 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=2024; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=F4M42WMbh39i84M01vdmMHQ6OXgp0yVAUFLDe40K1ZY=; b=40mZsqC4X2XhdBkDZQQKM4ys2pQ+GCDj9IYT2BaeizyKEHWPNFKdv3yC5GCTkxgcg95RRu3lQ dXxGX2DBFTTDf6h9Tta+0lrfqoHiW138pqswFcY8FcG3FOOMDSk9NYt 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) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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: 19726693-7467-4d08-20c2-08dd39221210 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?JV9cDVP1aE9STNfKajJAMQwiNko8Pjy?= =?utf-8?q?MFbnVS3AGFdviqhPPFyEW5Pwl0JLA5ILraptjBH4I+XGsiTz2GRPgmdttKG15WddF?= =?utf-8?q?r2NrzHaSD0Om88xuxeyfkyz3dWCHrkN/RSbZ+yf0fuhCWVKRUkQdJmrDZPcmoo1Us?= =?utf-8?q?DY9h5odiSu/LSabOBTr9crMWRmBA94TX2m2OZlVg0skkWEPZHzeHdQz9/LJ+/SofD?= =?utf-8?q?w7ig3wMAjRXFAzTyF9aJ5y7EeIfgEeBI3LXd1Dou8U4X3WHAJVQ6cG2DLDvd0r89E?= =?utf-8?q?DyDtpQAYZkdtFWsOP3pIXM0PC0+4iKEj3pY0WRhwnDDChmTBUWk7U6AhVx6BMFxak?= =?utf-8?q?O3NOn47CAWHGf2pxOps67y84nRBCvCC/DoiWduuznWgLCthv8Ql/vPrcPwhtYFfY0?= =?utf-8?q?veQw2GLj86TBfiAr/xl2zavVptw35v0pRUyLQtAaPFZ+jVFBY3vFS1Qgy6xT0erPk?= =?utf-8?q?Fn/lHKRcoV8be+99bojotYm53s/5ljJL/L9Wmd/CKtFsoKrWTvUn9k5TAf2jCy3ra?= =?utf-8?q?p5NhuDuzAL/ezguXGvCgX4Sasbz5GQd1r7awlVY1/aOBS6TYcgrHDRvuvWvoDybXM?= =?utf-8?q?FYxcav8swA9KftP0kxJ12ERinW+uJFavnArQepXkC/f7d2bySwOkq2cpd5EwEHhws?= =?utf-8?q?H37TMkPhGfo2Qk5VGAE9GtwJD//91JkxaUNIRzY3NZte/XLe8Vrpvmc3RUC/IA2jr?= =?utf-8?q?mR0Q6zG94pMbNTF0PsQr2Pbe6aH/pfMQpYvxNpzy5qca6je+ThJQTFd8gjYejTLXR?= =?utf-8?q?jxwA4ytvRAg3/oXz8iLvqy2h452GPDAqL/qU5JT2DZ4ik+FEP98234SiWkGEE9SOj?= =?utf-8?q?A5XgY3sTyPtRPNL4AQOPcerDpZtYGHa3FuoxpJoGJt9QdTJbOGCvjTtDZLl+pATsp?= =?utf-8?q?UgP0iFcol1ekmc7aU81lfwijCokrtzLXpxAkkiR70oU32k5z8eXGgfzQV6EhJzTmg?= =?utf-8?q?WIDa6mVn36TBpFD69aK8r7ydh9sAN1yCruUnmrq5QwoFizmfinMra9BefI3TRpw+Q?= =?utf-8?q?QzCysP6h47OnUsvyBuixsXWL0kNqIsqsEUk13v0N85NJNnRBDW708Mw4k1XM8vXx0?= =?utf-8?q?9I8EpVlZ/4CpHLqQ8Tu/dlQrRsNAsPJSUhWBIGkjDpjdb0eIftGtA2PewTHIMWH7t?= =?utf-8?q?CJp27yvLlffh13QYwjOTHt67F1+2Yc25NeWMaWl5tu+KZTzsU++P+8tqBlqp5pb3x?= =?utf-8?q?HaLDs1NGmZzqfi4QLqp9oS9VpO+3m7GqPkate1OSw9Hq3CvGsV27AMcIjFLnw/dOd?= =?utf-8?q?PZc+eyhZUfX0+oqfVnUpMB8WzHnYaZohRXjRwM0jS5n2Ru5Bcu6g2oI9kPvImB3l0?= =?utf-8?q?kOC1/9sNDTGtnHCO0X5eYSwGYpYykNN4SXkoog6p8ba8I2PiYZq1aAo=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: =?utf-8?q?dyPMlkYg/56p4LtfnYKIvxXv8KJp?= =?utf-8?q?RF5PJrPIvLFbZKJ153JFT51PCRAg8qzTkAKQrWZfD3mIc83vuJ7uSYDkJ6/5sYzaV?= =?utf-8?q?nlpZqXNzQ7as0tulVBcT0ZSY7xg/Fv1pSgRsi5c/AAnv//4ijNwVfYsm2vJiJ8m+z?= =?utf-8?q?yw7G60Zl4+DBGtngW0DS2Bt6ekGrTvuuvwA4AlSovX61CcP70O15oVo4iMcoVL+90?= =?utf-8?q?9v0juo09xla2omTXr4JSGwk1gHF+sxLyY186yMRqNoYjXeo0J4PZTWVqRmQiwl+50?= =?utf-8?q?+O27m2H1GQ58JGppNfwgtEwW65tQS93+oJgLGBKrMmvcs1N9jqg1U7CWIBkYN+G8V?= =?utf-8?q?y5Y73iZuOSyXhEpsL3X5teAjM7ZlWD6IaiQ8ynFI1dN5ZuVHyjKFY2+WaNvltohfu?= =?utf-8?q?25pagbu0Udov5b3bTXRV8EZLNdZiwqHUUOpPg5o6Hr96UbIfLRcAlyx61JgroEgZc?= =?utf-8?q?nOn1WUzLXviSYmyMnvP1MnQ36U4lPG9gbwvNCwEPV5Ok6tY3i7RizMlxUuBBOjWqL?= =?utf-8?q?6F0MZ5BaCvzv48EIat4PJhHOaKtRQbdqkwuTXEhkYauabklaU44s+VcgJG+XC7UNR?= =?utf-8?q?c4Fp90UXojzMS+pZqQYv/y1xB02QLMuScVC6tQ0FV+zQHCddGrfWNV2K5m3khX0kj?= =?utf-8?q?xCiXFLucSVmwroYzAnNtlIR0C0TOB8zI8n3jwhFHmVNiT3slF9kBObDJtCvCPi2Tu?= =?utf-8?q?XCAupOdlmcMWP6grHM8sPREfBCtfbxop7ZmsHIiN3f0JQCn8LICVf5JID+CALsHLl?= =?utf-8?q?bNDf0tP/t8tilR/9VLw8dxCNJVjytD5CRvsRZhvKyQVeSjEz+MTU/4DKhEZZSNqU4?= =?utf-8?q?HJiIs5rPLaK0aPscOS7R/GVJFP6k/IHBSwLSGJDR0LM+BYcYQ8gosh2D/HpodJ6Lq?= =?utf-8?q?q95d9msjztu5mltM6AqXaK2wE0giXk8kgNZHRiaL3lZs+dqogexX4Tq0t9MjONtQw?= =?utf-8?q?YNu09u0L82dTPYdmVQj5nf6gjKRsOXPsu3oqjuBiqsp1Bc7PmHmDw912ObdYGfgtU?= =?utf-8?q?TBK/FN0bXyRMQCiPZd0ls4XpCSVTZeCHHUHeFzBmnySZaA5Yp0AphDUE1SMDMuqDA?= =?utf-8?q?BqyEHPr3ppFllrd6Kk7masSfGGNC7GkE49rj9WaD/DYEAke5rEoKIbioH3uPiSUsi?= =?utf-8?q?k87a9UOJr9NcjRXdxVNMe2aFe+cR28Dk4CUnOC1GIfYZ5Wp+x/AuC9yMqHu6tEPmp?= =?utf-8?q?WvzuXqNXjqAP0XLel4fBen0nLI6Xxc1mqtQIjbObgKNEBYYjXUmTcMvbQ/ByVCuXX?= =?utf-8?q?8a/KoGtadQcDdR+sSfN0IB7/W+JrIX5sq5VxxnbRF4jkYNIULwDjZDyEw7o+PTnWo?= =?utf-8?q?czL9EZVsOOn/nlvkjjKO/wgqx5v9hrpUAFpbFULMcxXR0ty/rvRFY9cvfAIyivQQ3?= =?utf-8?q?rMGdyIk3Ha9llUh5XKM7RnUcYObQ+TUgGRTdpyasth/Z4upjillvoAtq5NDuc4/v0?= =?utf-8?q?Sz76JmMufz1xYsbpskBx4hYkwnrFnK9Z8NDadkRt8LG3/EgXLzop9Ozfz+HZblJKd?= =?utf-8?q?AjqqfTWg+gPO?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19726693-7467-4d08-20c2-08dd39221210 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:25.3850 (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: fLTguQMmmJ08rH1spKA0SFjAMCtjE2Xy5UcSB6JnphFS2Jl1loJr4agTXIC8yPNcGQfifWVybH0vpOANft5ZIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7442 Current scmi drivers not work well with devlink. This patchset is a retry to address the issue in [1] which was a few months ago. Current scmi devices are not created from device tree, they are created from a scmi_device_id entry of each driver with the protocol matches with the fwnode reg value, this means there could be multiple devices created for one fwnode, but the fwnode only has one device pointer. This patchset is to do more checking before setting the device fwnode. And Introduce machine_allowlist and machine_blocklist. The reason to introduce machine_blocklist is for case that if pinctrl-scmi.c probes before pinctrl-imx-scmi.c probes on i.MX platform. Need to block pinctrl-scmi.c on i.MX platform. This may looks like hack, but seems no better way to make scmi works well with devlink. [1]: https://lore.kernel.org/arm-scmi/CAGETcx8m48cy-EzP6_uoGN7KWsQw=CfZWQ-hNUzz_7LZ0voG8A@mail.gmail.com/ Signed-off-by: Peng Fan --- Changes in v2: - Introduce machine_allowlist and machine_blocklist - Keep of_node for cpufreq device per Cristian - Patch 2 is an optimization patch when fixing the devlink issue - Link to v1: https://lore.kernel.org/r/20241225-scmi-fwdevlink-v1-0-e9a3a5341362@nxp.com --- Peng Fan (4): firmware: arm_scmi: Bypass setting fwnode for scmi cpufreq firmware: arm_scmi: Add machine_allowlist and machine_blocklist pinctrl: freescale: scmi: Switch to use machine_allowlist pinctrl: scmi: Switch to use machine_blocklist drivers/firmware/arm_scmi/bus.c | 31 +++++++++++++++++++++++++++- drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 15 ++++++-------- drivers/pinctrl/pinctrl-scmi.c | 15 ++++++-------- include/linux/scmi_protocol.h | 3 +++ 4 files changed, 45 insertions(+), 19 deletions(-) --- base-commit: 9dff7bbdd359c73f1b44ab592bbb17e1c174fe43 change-id: 20241225-scmi-fwdevlink-afb5131f19ea Best regards,