Message ID | 20250407145546.270683-7-herve.codina@bootlin.com |
---|---|
State | New |
Headers | show
Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (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 5D02B1FCFC5; Mon, 7 Apr 2025 14:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744037782; cv=none; b=pIbc4Ckaf9/PNwUCvNA1c6Lm2Nd3Yfj+sk+0tWZMam31Xc1eykh3HeeBsKhNBrQJ2q5HUPwGZmtXDJFPeoHRNrvXE+11IZNnsphezK8iups/d3Q5FO50Q0UFY7lRoj1uwUuOGGSm5/1lPNisYjGoftsroLkWnGTu/qV4m2U4vn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744037782; c=relaxed/simple; bh=lt0SoHZIR+cwSE9xNh50rvLIcfG/wlH4uA5tI9IDsbU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TYdCiySiPgpm4t110Ja3zw+3JR9axVV080moMfo0D9NP/kT+UI8qz0IGoQHMqWYLKSkLcFU2371qG6pkuwffGhcqQ697dtcnSCqYwqQy8lYGQcM/p+tJOfyAtHT5u637Z7imO6utSPX2oJNLRVIdHqemIMcfly3B5aKh7VBape4= 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=I9uOzSP7; arc=none smtp.client-ip=217.70.183.197 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="I9uOzSP7" Received: by mail.gandi.net (Postfix) with ESMTPA id D99DB44342; Mon, 7 Apr 2025 14:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744037777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SKRkBSja/o7ORAvQYrt/LIQOqrRkQaDjQ9l7ROg3bho=; b=I9uOzSP7ZKO+JrlLDJlmlW54yLQhUymmzCjH+uOCBjArAz03etKCoQ80+NFgnNnkmynx1m YLAXXh1JzDlirh4Lpi9yTFNovfhBu+3xaR9brTCvbvU9kex6fvon4DOmoUs25U86EibKmI +h3pkFqSWVjfrOlr50VHZpQabSOExGGdfHUkyurHqt9WFX6S/XctbQ9ZYq1yRkqj4OBclv D2q84wdfr5K+3u45bzMQ+7MbtDIDA5yn+R9luZwq8g53CPO+iQlVOE81/Oen8Xfe/x9pJW 6b281sHcM5sfI924Cob9lj4ZMr02IJUsBKdNZ3ZL6v80PFa7zQ7zu5xPbJR5mQ== From: Herve Codina <herve.codina@bootlin.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Danilo Krummrich <dakr@kernel.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Andi Shyti <andi.shyti@kernel.org>, Wolfram Sang <wsa+renesas@sang-engineering.com>, Peter Rosin <peda@axentia.se>, Derek Kiernan <derek.kiernan@amd.com>, Dragan Cvetic <dragan.cvetic@amd.com>, Arnd Bergmann <arnd@arndb.de>, Herve Codina <herve.codina@bootlin.com>, Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@google.com>, Bjorn Helgaas <bhelgaas@google.com>, Mark Brown <broonie@kernel.org>, Len Brown <lenb@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Daniel Scally <djrscally@gmail.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, Sakari Ailus <sakari.ailus@linux.intel.com> Cc: Wolfram Sang <wsa@kernel.org>, Geert Uytterhoeven <geert+renesas@glider.be>, linux-kernel@vger.kernel.org, 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-spi@vger.kernel.org, linux-acpi@vger.kernel.org, Allan Nielsen <allan.nielsen@microchip.com>, Horatiu Vultur <horatiu.vultur@microchip.com>, Steen Hegelund <steen.hegelund@microchip.com>, Luca Ceresoli <luca.ceresoli@bootlin.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH 06/16] PCI: of: Set fwnode.dev of newly created PCI device nodes Date: Mon, 7 Apr 2025 16:55:35 +0200 Message-ID: <20250407145546.270683-7-herve.codina@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250407145546.270683-1-herve.codina@bootlin.com> References: <20250407145546.270683-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: <linux-acpi.vger.kernel.org> List-Subscribe: <mailto:linux-acpi+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-acpi+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtddtgeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefjvghrvhgvucevohguihhnrgcuoehhvghrvhgvrdgtohguihhnrgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepheffiefgjeeuleeuueffleeufefglefhjefhheeigedukeetieeltddthfffkeffnecukfhppeeltddrkeelrdduieefrdduvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledtrdekledrudeifedruddvjedphhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhmrghilhhfrhhomhephhgvrhhvvgdrtghoughinhgrsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeeguddprhgtphhtthhopehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhrghdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrkhhrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehshhgrfihnghhuoheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshdrhhgruhgvrhesphgvnhhguhhtrhhonhhigidruggvpdhrt ghpthhtohepkhgvrhhnvghlsehpvghnghhuthhrohhnihigrdguvgdprhgtphhtthhopehfvghsthgvvhgrmhesghhmrghilhdrtghomhdprhgtphhtthhopehmthhurhhquhgvthhtvgessggrhihlihgsrhgvrdgtohhm X-GND-Sasl: herve.codina@bootlin.com |
Series |
lan966x pci device: Add support for SFPs
|
expand
|
diff --git a/drivers/pci/of.c b/drivers/pci/of.c index ab7a8252bf41..ac6c4e1d68e5 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.dev in order to have fw_devlink creating links + * pointing to this PCI device instead of walking up to the PCI host + * bridge. + */ + np->fwnode.dev = &pdev->dev; + ret = of_changeset_apply(cset); if (ret) goto out_free_node;
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.dev field is not set. When later an overlay is applied, this consuses 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 fwnode.dev to the dev of the PCI device allows devlink to use this device as a supplier and so, correct links are created. Signed-off-by: Herve Codina <herve.codina@bootlin.com> --- drivers/pci/of.c | 7 +++++++ 1 file changed, 7 insertions(+)