From mboxrd@z Thu Jan 1 00:00:00 1970 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 CB35AC02196 for ; Thu, 6 Feb 2025 10:10:46 +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:In-Reply-To: Content-Type:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=herqS5ZpOiKkJmYeUbFdkDpklIp4T+4NTCWbPrKQh8k=; b=ga+6CrExve6j5t+GfCBfTwT3wV tLgROPdbsahhFE75pIoKMRUtwugtoTyWUiAhHjKeWlloLLjkdPvAkGFhl7Hr0V+kGUEZ843Y6U8+G B8+gSFzJ4bt6MZS7IdxkpwoOAaqDPKmoZEM8TzBzAUI97w0+Jx67AjmG+Nfdx8PV4zWCWdNPE0H2t ch7cch2stjPG5jJ5dyzWYRTdAns2CSXiHiH9YWQVYB6/3tNBufjFVTr0Bdbcarzhk9ja6OK4d1pWD hGQhn6sQSSxrBLPX6zCBaUi+LaYR3P7YxM/6yw0ywmyw18kv1dHtCr9PhQV4+P+8qWcCPLqIbPbPP M+miI1lQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tfyqA-00000005wa4-0nSq; Thu, 06 Feb 2025 10:10:34 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfyeV-00000005uSH-0Chy for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2025 09:58:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qzGInBwl2JMHUAvr6E7SbENibqXvJZt9h9z4iJdlLBarSM9Eig5T71Tv+1cb0PDNOxcfaSKn+kX1Ainjxs5MciSQtW+nJPF6Y0q4fvSPMHSdzv4S8panU4QCHkMhLOf4oBCXBa1HZCvtzsAM7Tpn5QvJxr+zLyym9SAVB180FLlhAxMcO36HW3S+ADF4ORqFZIeVfBHGfOXC7BW+WfUZwbGXxT8dDTldz+UHnEmZ9M+B+9BHRsD0vX+whQ6eMsy67OE+suRxqSGZ3+Y3FE8klwIEgcTarhFu6KVLprOEtKAY/+8T4KJ5eTDi0c5yZwaT9lgK7cs2gE1P3jsn0aI/bw== 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=herqS5ZpOiKkJmYeUbFdkDpklIp4T+4NTCWbPrKQh8k=; b=Eo/psEZv9eKMweviDfHRKcWYmATJXYZa8vFdfKlqDpuCCmxHQCtPObL6URPRuRbQ1+mA0ptce3AJRER3pNYbuPRRtPrDifxOEZtLj4yRh0lVvWG5ZSLPY8RtdSNflk7+v+WsWCZaJUXSeJ4yuivDt1B0qOXoKBqltD+sYih2Ymc3xdpESp8NICIAtWS5qLrjAiVWJDehuru9KmSyPf3WDNkSmsSVJ5PNyRPtjr5scJjm8rp+lmm2aiz7PF041B3MJzqVPVaRap9uKzikoSN0pXFWdotAwAf3QqtT6xU2XuZhth+skUOE4oKDIyTgrVr6QIWooNnyqYYbvGYUxxCglw== 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=herqS5ZpOiKkJmYeUbFdkDpklIp4T+4NTCWbPrKQh8k=; b=nXhcYHv2FipSaOGy+mYYFrORqXogXe7MqAgoDPQczMJBb6ZH5eL9v18+vKI9gR/avJrPG5mljB41lE54seTntLsNzPkpI2LrVs/vnGtlPs1ZuO5VI35FEyK5dp+JDJ6L9Va4gOKgC5RHNY6XTpRiNoggq/PvJfzkvzDe1T3N4+FpIFmrqCPFtv347zFvI6oF87VtCRn4wupcTnx7SGYFHneI7YtiAEvkrBEP4HphsEWlJL2eXPbY8eBF2x9FbEh9Y8sztgRi4DBD8RpdWFEpTIOKy60HWzm7ilCPdhuzRFZxntXoupluE1uQWACMwuQrlHCAqZ9aYXesHi71FXyZQQ== 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 DB8PR04MB6777.eurprd04.prod.outlook.com (2603:10a6:10:11f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8422.11; Thu, 6 Feb 2025 09:58: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%3]) with mapi id 15.20.8422.010; Thu, 6 Feb 2025 09:58:27 +0000 Date: Thu, 6 Feb 2025 19:05:08 +0800 From: Peng Fan To: Dan Carpenter Cc: Sudeep Holla , Cristian Marussi , Saravana Kannan , Linus Walleij , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , 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 Subject: Re: [PATCH v2 2/4] firmware: arm_scmi: Add machine_allowlist and machine_blocklist Message-ID: <20250206110508.GB22527@localhost.localdomain> References: <20250120-scmi-fwdevlink-v2-0-3af2fa37dbac@nxp.com> <20250120-scmi-fwdevlink-v2-2-3af2fa37dbac@nxp.com> <230612a4-92ee-4acc-85bf-f1c47dc3c35b@stanley.mountain> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <230612a4-92ee-4acc-85bf-f1c47dc3c35b@stanley.mountain> User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: SI2PR02CA0035.apcprd02.prod.outlook.com (2603:1096:4:195::22) 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_|DB8PR04MB6777:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f384dc7-2371-402f-2dac-08dd4694cd24 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|7416014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vvMLdK2ksPEYOI038QvHViHvdnIJL2taMuw4o24n5PWReTZ3XiMK6UXhNQOO?= =?us-ascii?Q?1HoAoaUohfdCrWNpAaezxof4uX/PZHXzk74zprT/ie4NHXirIDtwsoFb97X0?= =?us-ascii?Q?OcQN+Xms1efm1NlJBJl6J4TUHxlEwmqgv9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= =?us-ascii?Q?Pz+2FZl+hjKixXN8sDdSuzg2JUwzjnmPIp6S4zzBKPLJX9oZzPvyx6W68Q8w?= =?us-ascii?Q?son/w8YNAnl8sylux5VwqxhXWSafU/pEOegPStQ6dVmDrmgiCainWMl8F42V?= =?us-ascii?Q?P7vqbWawfudxWyfw3nYG/KDGydi8DZc5bBl3wePU0xNQdNpPjpZZqarRaUU5?= =?us-ascii?Q?1rhX8d0NfseaSk9hMIBqsaCVd5E8vqhO6Di0B71acbBgs1K78Iq8QybCBi0C?= =?us-ascii?Q?Lv3JOpgkcbUva2STA8eatNXdO+Shx1Nf19ucd9fLukFGmJ+XAmv6EjCVJVp1?= =?us-ascii?Q?0M6o1RYJhC87rJoUmNZt12Y4b8kf3/k9vEmW0uH9E+dLrvWqh0tLirjB9Rao?= =?us-ascii?Q?3aevdmYQdTwuHXM1f4WqeZnHbjnqqCkbGnHGGxmx5YTy+cYCSBGB/jM82MzC?= =?us-ascii?Q?4331cME5Dx0gHVUAXv3ozpiU2lt9TOJ7?= 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)(52116014)(376014)(7416014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oPKxJw1lCaE552ZKn070oLsKiT0iWXfBKNQ+DuWj4Raq/IZK5PG6NWQ32igr?= =?us-ascii?Q?vhA21ZZzG6RYrs74FOfhzjfkkj1r3dVd61hnJ4JO7cDHtLk0iWZgHx0JHF9H?= =?us-ascii?Q?0gyiCe6zePwzCfnzWsI3Ui2+waVDcWz6/CREF82DCFJtQ+yH6M6bpOWjTXjW?= =?us-ascii?Q?idpfjEYw4GoGZaGTYVGsxRS9Pz2EsZe8qRELdCsLwZ8DZ74JY0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Q5dDraWEli+OtYkhckHn6GF2vkR6yyb6Df6Fl?= =?us-ascii?Q?f/TOdRixufu/oTtTU907OOcv41MCpXE+4kUXP34iDgKQZSwSQJkQ52TY6UfH?= =?us-ascii?Q?NEO2OQTTBCZEhO0AkDw0G2mr3jEovCyDshDw9rJxs2pshuyyaDFBbLmv6paB?= =?us-ascii?Q?geixu2BhbaqUOlsW91fgulx0WVuchIcHdlRH4Dai65atg1GBVl2vAFWq0APj?= =?us-ascii?Q?39NWdnVHOc/TazC9fzqjVfGwGLYAbXzHHFJhzBn1wsrGgLLYm6S1rYTAcSeJ?= =?us-ascii?Q?PR7kRHHs3wZ5x5czo6uqTsK95OhMcP2k3kvF+WuJ5o6hKk9Lj4P3yrDfrJuU?= =?us-ascii?Q?Ia2DSo5AgoO36tvKjCZ3FTX22zdyrWLQ4wR3mEuRTDMXi/me9dFICa6zPEmP?= =?us-ascii?Q?ALRLiPWkYvRvSXiEVec9s4tul3TJ3+hx69QwqpLKtV/o5TExvizz2aLsxgsx?= =?us-ascii?Q?p/BBP/3DgRja3H1EELi6b3fKO04fJhCl/OmqsgTA?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f384dc7-2371-402f-2dac-08dd4694cd24 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2025 09:58:26.9673 (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: 8MhiYNAre/btuvl+pn94b+mE400h4+Qw0W1u+z0XoEN+Sr81XTLtfTaUPGBcGlDryTtA8FDqaGX7ryOoBXfS0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6777 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_015831_094709_EEB8E4F1 X-CRM114-Status: GOOD ( 31.87 ) 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 Hi Dan, On Thu, Feb 06, 2025 at 11:02:04AM +0300, Dan Carpenter wrote: >On Mon, Jan 20, 2025 at 03:13:30PM +0800, Peng Fan (OSS) wrote: >> From: Peng Fan >> >> There are two cases: >> pinctrl-scmi.c and pinctrl-imx-scmi.c, both use SCMI_PROTOCOL_PINCTRL. >> If both drivers are built in, and the scmi device with name "pinctrl-imx" >> is created earlier, and the fwnode device points to the scmi device, >> non-i.MX platforms will never have the pinctrl supplier ready. >> >> Vendor A use 0x80 for feature X, Vendor B use 0x80 for feature Y. >> With both drivers built in, two scmi devices will be created, and both >> drivers will be probed. On A's patform, feature Y probe may fail, vice >> verus. >> >> Introduce machine_allowlist and machine_blocklist to allow or block >> the creation of scmi devices to address above issues. >> >> machine_blocklist is non-vendor protocols, but vendor has its own >> implementation. Saying need to block pinctrl-scmi.c on i.MX95. >> machine_allowlist is for vendor protocols. Saying vendor A drivers only >> allow vendor A machine, vendor B machines only allow vendor B machine. >> > >I think patches 2-4 should be combined into one patch. This commit They are in different subsystems, so I separate them. >message is a bit confusing. I don't really understand how the >"fwnode device points to the scmi device". I understand vaguely >what that means but in terms of code, I couldn't point to it. Sorry for not being clear. The devlink framework will take i.MX as pinctrl provider, because the fwnode is occupied by i.MX pinctrl scmi device which is created earlier than generic pinctrl scmi device. > >> Vendor A use 0x80 for feature X, Vendor B use 0x80 for feature Y. >> With both drivers built in, two scmi devices will be created, and both >> drivers will be probed. On A's patform, feature Y probe may fail, vice >> verus. > >You're describing the code before. Is it a problem that only one driver >is probed successfully? I thought that would be fine. What's the >problem? VendorA 0x80 VendorB 0x80 If both drivers runs into probe, VenderB 0x80 driver may crash VendorA firmware if the firmware not designed well. Not big issue. I just think we should block the probe. For pure device tree compatible, if compatible not match, the driver will not runs into probe. I think scmi driver is also good to follow. > >It should have a Fixes tag. >Fixes: b755521fd6eb ("pinctrl: imx: support SCMI pinctrl protocol for i.MX95") The issue only exists when devlink is forced. I would like to wait Suddeep and Cristian's comments on merge 2-4 into one and add Fixes tag. > >Here is my suggestion for a commit message: > > We have two drivers, pinctrl-scmi.c which is generic and > pinctrl-imx-scmi.c which is for IMX hardware. They do the same > thing. Both provide support for the SCMI_PROTOCOL_PINCTRL protocol. > > If you have a kernel with both modules built in then they way it > was designed to work is that the probe() functions would only > allow the appropriate driver to probe. Unfortunately, what happens > is that there is an issue earlier in the process so the > fwnode device points to the wrong driver. This means that > even though the correct driver is probed it still wants to use > whichever driver was loaded first so if the driver you want came > second then it won't work. > > To fix this, move the checking for which driver to use into the > scmi_protocol_device_request() function. Thanks for your patient on reviewing the patchset. > > Now both drivers will be probed but only one will be used? No. with block/allow list, only one driver will be probed. Thanks, Peng. > >regards, >dan carpenter >