From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 7A0FD40B6EF for ; Fri, 27 Feb 2026 13:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772200733; cv=none; b=XFW50UMq03HtWvdpAV35lsrXtJQknNeU1b9bg41bZthoHnyBRKzJ1qdLkACzc7Zv6oQF2yaj2lCaurGOjmfwZ8IXoWLy3syDLcGCSwtQho6DQSsmrPXCx8Xt8TqUAemmPLnE66X2XCIB7O1qMifo/Xa+MnZhFzXTEwN9GTfU9F0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772200733; c=relaxed/simple; bh=L23lGgbCNqkBwJpNpYsPxMg7r57kvKFqnA/eUe0ik7I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qtzRnd3TSm3MgEwCoDRAlkS0Tg6NmrQuaaQZyozjO4l2wAt7JdU8xsytBiPB1cCjqtbbu9Y2B5+9lLV2TmCgnf6W3L3yo3jw33WNMs2H5wZOfO6DE15+j4QKfWN3rYdD2kitKquNGM5ST2UgwMQVQshnkIvYsuxh+q9MJK0VJtA= 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=OCOAfyTa; arc=none smtp.client-ip=185.246.85.4 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="OCOAfyTa" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 3C1964E41912; Fri, 27 Feb 2026 13:58:51 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0D16F5FE74; Fri, 27 Feb 2026 13:58:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 278381036944D; Fri, 27 Feb 2026 14:58:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1772200728; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=iMwFVtskD7lrHa/yvIrbdu/L2Of80knkDmIMEmyrkXU=; b=OCOAfyTatc8Qw0X52lJgzufSO0J8ocT5dFa7Zhh6u228zQFpU81kDty0jIzHTquMGTmYmW 1dWqocRW3PQ67VuM0ipx4um+/BvsfCLKaqciExCNe9eHS7TxIu1fuh4Cz5o5XOSYWCSTfa jRJExziGLq/FsEjh2laB8qyaWrrCFPpPJDXTAnydnyfuv0e7xC5+tONzNafHgGHJ17V4GJ HXjHm0YJvCBLCw0zDvu3VjdLMUMNdKh18VI5hZybBtM3F7XP1Jcm3hILyagbwFlNYMdY1U JCPh9pdPq/7j49wq6+nLqsAHj816Bf7RsnkiMgc/xzcswgMN/KhIEOLc8uvO1w== From: Herve Codina To: 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 , Herve Codina , 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 Cc: 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: [PATCH v5 13/28] PCI: of: Set fwnode device of newly created PCI device nodes Date: Fri, 27 Feb 2026 14:54:10 +0100 Message-ID: <20260227135428.783983-14-herve.codina@bootlin.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260227135428.783983-1-herve.codina@bootlin.com> References: <20260227135428.783983-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 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. 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 --- 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