From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 DB67A38836F; Wed, 6 May 2026 20:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778099434; cv=none; b=YqtMAQ0+SnXigfUrTPpmp6AFXAYD3/JHo3+Eh3xLgGLIt1lz+yMCqyMRTgWu97d5DBK4+GBrTBOwTUmvXkmpg0V+GJyUyCsp3whbTtTnovpcN69j9mkuxHybppBA/4jZ6hacYttzGpH6WsHl1dLYO4dz8oSbAkq34CMqdmPq180= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778099434; c=relaxed/simple; bh=ElJosHTYLcI9BgvAkBOdPtaYbxUdlkp93c6ZPh+hIQ4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lO1OFGrxg8KZmmr6cvOCOOmNddD+n9Y/04/ocGHMCdhTeG6YMHXWN42f9ofz8NIFkDsA3WikvgJ8zHqCOYDIkVDSeJIDR+giFIcF3wLHoy4I1VCtwpk3247ZU3CLCdre4IhAaK8cTTsuieQ2Wz1Kw85ssveeHCBLB0DrRcQM65o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=P6Hvk6+A; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="P6Hvk6+A" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 3539D1A3556; Wed, 6 May 2026 20:30:29 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E9AF660558; Wed, 6 May 2026 20:30:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 879BB107F1E2B; Wed, 6 May 2026 22:30:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778099425; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=Vrqq7dyzDgCl+FqaMvTiuXKBdsOhTj/wqsPWsAfCeVU=; b=P6Hvk6+A9KAGIiXMc5ppzQ8YnInesNyobJwlVOScdEn3BK6ZEG23RDVXqJ6UhXoJCZ/ClQ IUaW5ffmO1GB5JT6pTn4JtgmuSK+cRR3G1OcUYmDqGuh+VBCxuJ5HSm/LVFRPC4a7eFPCK lYEJgLQ08RS58hm0mDonItlSHMq4n57ZfMggV7q1BtmhvLggvm/45yz/tuzkuo9gCOFf+u 3K5HNHEI5PY46RtLY6F5VEi1OqnYZRWCqhL897NXI0JaUY6wU9HQsCRvqSXESwzhM7jo2T za6fvFc/XcHv7AFGlUDrBhtbj3FxDismo+IFvtdNJhuaoK/yerA+Brrcvr3ndA== Date: Wed, 6 May 2026 22:30:15 +0200 From: Herve Codina To: Bjorn Helgaas Cc: Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Kalle Niemi , Matti Vaittinen , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Michael Turquette , Stephen Boyd , Andi Shyti , Wolfram Sang , Peter Rosin , Arnd Bergmann , Saravana Kannan , Bjorn Helgaas , Charles Keepax , Richard Fitzgerald , David Rhodes , Linus Walleij , Ulf Hansson , Mark Brown , Len Brown , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Shawn Guo , Wolfram Sang , linux-kernel@vger.kernel.org, driver-core@lists.linux.dev, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-sound@vger.kernel.org, patches@opensource.cirrus.com, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-spi@vger.kernel.org, linux-acpi@vger.kernel.org, linux-cxl@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni Subject: Re: [PATCH v6 13/27] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Message-ID: <20260506222846.68963c71@bootlin.com> In-Reply-To: <20260325202037.GA1291636@bhelgaas> References: <20260325143555.451852-14-herve.codina@bootlin.com> <20260325202037.GA1291636@bhelgaas> Organization: Bootlin X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 Hi Bjorn, On Wed, 25 Mar 2026 15:20:37 -0500 Bjorn Helgaas wrote: > On Wed, Mar 25, 2026 at 03:35:40PM +0100, Herve Codina wrote: > > During the instantiation of devices described by a device-tree overlay > > applied on a PCI device, devlink displays the following kind of debug > > messages instead of creating the expected links: > > 'Not linking xxxx - might never become dev' > > > > Without those expected links, the device removal order cannot be > > correct. > > > > Those debug traces are printed by fw_devlink_create_devlink(). In our > > use case, they are all printed because the supplier of the link has at > > least one of its ancestor with its fwnode flag FWNODE_FLAG_INITIALIZED > > set. > > > > The culprit ancestor is the PCI root bridge. > > > > The fwnode related to the PCI root bridge is created dynamically by the > > of_pci_make_host_bridge_node() function. During this creation > > fwnode_dev_initialized() is called which set the FWNODE_FLAG_INITIALIZED > > flag. > > > > Calling fwnode_dev_initialized() tells devlink that the device related > > to this node is handled out of the driver core. This is not correct in > > our case. Indeed the device related to this firmware node is handled > > using driver core mechanisms and is fully compliant devlink > > expectations. > > > > Simply remove the fwnode_dev_initialized() call. With that done, the > > devlink debug messages are no more displayed and links that were missing > > are correctly created. > > > > Signed-off-by: Herve Codina > > I would ordinarily make sure the person who added > fwnode_dev_initialized() here was ok with its removal, but it looks > like you added this with 1f340724419e ("PCI: of: Create device tree > PCI host bridge node"), so I assume you're ok with removing it :) Yes, I am really ok to remove it :) > > I suppose there could be a "Fixes: 1f340724419e" tag, but maybe > there's no need to backport this anywhere? Yes, I will add the Fixes tag. Also the previous patch ("PCI: of: Set fwnode device of newly created PCI device nodes") fixes 407d1a51921e ("PCI: Create device tree node for bridge") I plan to add "Fixes: 407d1a51921e" to the previous patch to make things consistent. To ease backports and avoid conflicts, I plan to add 'Cc: stable' in 4 patches: - patch 13 "PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node" This current patch with Fixes added - patch 12 "PCI: of: Set fwnode device of newly created PCI device nodes" The previous patch with Fixes added - patch 11 "PCI: of: Use fw_devlink_set_device()" Avoid conflict when patch 13 is applied - patch 6 "driver core: fw_devlink: Introduce fw_devlink_set_device()" Needed for patch 11 and 12 Do you think it makes sense ? Best regards, Hervé > > Acked-by: Bjorn Helgaas > > > --- > > drivers/pci/of.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > > index b694fcda16b1..0993257fe025 100644 > > --- a/drivers/pci/of.c > > +++ b/drivers/pci/of.c > > @@ -811,7 +811,6 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge) > > */ > > of_node_set_flag(np, OF_POPULATED); > > fw_devlink_set_device(&np->fwnode, &bridge->dev); > > - fwnode_dev_initialized(&np->fwnode, true); > > > > ret = of_changeset_apply(cset); > > if (ret) > > -- > > 2.53.0 > > -- Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com