From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E682430AAB8; Wed, 25 Mar 2026 20:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774469603; cv=none; b=GjVhdeR2BeLqRRxTld0UwIHSFG42p4FdOZ2FtjkKYU6JwjUsRSHRd0OAurSTVQ4P9IUnUI5m+nt36qXdR2ppVEIPR70ekMyYI9skRylRsz3qAYnMrl/A85I0xKqCzJgPBbsBqnwziZpjOVlJk8/vmzEirdMClA0t+TW9g+z3968= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774469603; c=relaxed/simple; bh=jSl4cR/M8opltn/7URZzvWelml/MUa8MCbVkBC5H/7Q=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=qgevVwaaTobrMFsconOqqgZk00nddbSy7VzK3zCYLufblSAyGV1Bsrj78G1b9dZzU1y3Fno2Owu2TH4JtUxSBCUtfwN30GNWnTkP2BF7+ePrL/1d5ZBkrs7XnYyseNAEvjaBv1dKlS74INB0qNBH1NYro0WZV9KStro3EAzbfcU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tkz39/YI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tkz39/YI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C2F0C4CEF7; Wed, 25 Mar 2026 20:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774469602; bh=jSl4cR/M8opltn/7URZzvWelml/MUa8MCbVkBC5H/7Q=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Tkz39/YIGOURtW2ow6h0sqScd2hCTpyVv9CGSZY9qtGWrSrjMUV5SL+I7z/kx260/ 0+RE2w69mycl2mfgjzZeSRZQBe+mUZ/l9N951dkmLGzxXGu2Q+zr+qjLBYDIV894R5 2WaGAo+2zazNInal2SK6bs14ktm3stdXhU8IlYkwfgW/K5P8YQkf0skh5OzwK3roy5 vRmlJoGDLRnR2uIJMFV7MxtEwL5cJ+oG7yYhXF5yvbEn1eKlvMOUZn0ScMRRHyyhmC dRG/71EX8DgaOGRpoya2j4xfZeZht+iT2MH99TCE6FYC/om6X7Ujq96H5hBTgb+7n+ osAPLMTcZT91g== Date: Wed, 25 Mar 2026 15:13:21 -0500 From: Bjorn Helgaas To: Herve Codina 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 12/27] PCI: of: Set fwnode device of newly created PCI device nodes Message-ID: <20260325201321.GA1291474@bhelgaas> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260325143555.451852-13-herve.codina@bootlin.com> On Wed, Mar 25, 2026 at 03:35:39PM +0100, Herve Codina wrote: > Device-tree node can be created when CONFIG_PCI_DYNAMIC_OF_NODES. Those > node are created and filled based on PCI core information but the > fwnode device field is not set. s/Those node are/Those nodes are/ > When later an overlay is applied, this confuses fw_devlink. Indeed, > without any device attached to the node, fw_devlink considers that this > node will never become a device. When this node is pointed as a > supplier, devlink looks at its ancestors in order to find a node with a > device that could be used as the supplier. > > In the PCI use case, this leads to links that wrongly use the PCI root > bridge device as the supplier instead of the expected PCI device. > > Setting the fwnode device to the device of the PCI device allows devlink > to use this device as a supplier and so, correct links are created. > > Signed-off-by: Herve Codina Acked-by: Bjorn Helgaas > --- > drivers/pci/of.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index 5fb7f501fd35..b694fcda16b1 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -709,6 +709,13 @@ void of_pci_make_dev_node(struct pci_dev *pdev) > if (ret) > goto out_free_node; > > + /* > + * Set the fwnode device in order to have fw_devlink creating links > + * pointing to this PCI device instead of walking up to the PCI host > + * bridge. > + */ > + fw_devlink_set_device(&np->fwnode, &pdev->dev); > + > ret = of_changeset_apply(cset); > if (ret) > goto out_free_node; > -- > 2.53.0 >