Message ID | 20250613134817.681832-14-herve.codina@bootlin.com |
---|---|
State | New |
Headers | show
Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 8D7C42EA482; Fri, 13 Jun 2025 13:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749822561; cv=none; b=tAtGv1dOh9o0dvkI1bDLHlzgjT8zoM3ObhqyJE8rfsovw/RtthH97IY7TR1/hDC7MQ1TMz50+VoHnCYIkjVgKypQY/bPoWv5fU+AucxjgZ88d5yj6KL/TPeNveb0T346gluo4AIAj0KIB2Deid/L/9+rkMgmuZ5I9SQUdOM9KRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749822561; c=relaxed/simple; bh=67Lffn7BPkH8/Y/O73E48DFKHkO40sD83omqj5KULUU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GmMFAKwbDmIEqpHBDuL0C8uJ21j9wTYwFLdAq+E8b9RQpUmdeur+VuLsWYBZHrfvg2iRBT1GK+MOVYCIl95wz0TARgVhaUGRDVT1Hz/TAVCeFtG7y9RHAvtdWjDOUejgPzGadIMvNM/mFmg/6c2EYaLk8XMGNj1IBEbnIzBUkAw= 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=gvqi1e8k; arc=none smtp.client-ip=217.70.183.199 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="gvqi1e8k" Received: by mail.gandi.net (Postfix) with ESMTPA id C1B294429B; Fri, 13 Jun 2025 13:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1749822557; 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=jB4MpxJHvmEtcRewWEg5BeuLDwaz4FzFfwosgTdHoZ4=; b=gvqi1e8kL0FSoL89KCKVV4hKxhfGOvjd2xUqgCz5mi+vwLKgnQ8V1TmEcbCfabPgBs/k8o zBXSupdW70z6o2l27qpQQ3iKXjl1wcU/XMFmM3DeuJkm9ziyJcRNb5fcFCu4zL8r1LzrSN lQO2zgR983SeaI4WrGp9hveBa9yqkhzvPOG7hGlhy0QznsuToI3mxshsn4beMMahirdZP5 RzMNbZJz/tGj+AKJg7vlv6tpYzbric0kmBBc6UKpbnzsiqxcOn2idCGYaPjdQ7v7Bb2LyQ EMA74swXo3sw8D49vJaM9gbtkmemkFvJf2oQiXwMKUN/39NfyaRcciLZ1mSsnA== From: Herve Codina <herve.codina@bootlin.com> To: Andrew Lunn <andrew@lunn.ch>, 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>, Davidlohr Bueso <dave@stgolabs.net>, Dave Jiang <dave.jiang@intel.com>, Alison Schofield <alison.schofield@intel.com>, Vishal Verma <vishal.l.verma@intel.com>, Ira Weiny <ira.weiny@intel.com>, Dan Williams <dan.j.williams@intel.com>, 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, linux-cxl@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 v3 13/28] PCI: of: Set fwnode device of newly created PCI device nodes Date: Fri, 13 Jun 2025 15:47:53 +0200 Message-ID: <20250613134817.681832-14-herve.codina@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250613134817.681832-1-herve.codina@bootlin.com> References: <20250613134817.681832-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: <linux-i2c.vger.kernel.org> List-Subscribe: <mailto:linux-i2c+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-i2c+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddukeduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepjfgvrhhvvgcuvehoughinhgruceohhgvrhhvvgdrtghoughinhgrsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeehffeigfejueelueeuffelueefgfelhfejhfehieegudekteeiledttdfhffekffenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpeelnecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplhhotggrlhhhohhsthdrlhhotggrlhguohhmrghinhdpmhgrihhlfhhrohhmpehhvghrvhgvrdgtohguihhnrgessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepgeelpdhrtghpthhtoheprghnughrvgifsehluhhnnhdrtghhpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhhrgifnhhguhhosehkvghrnhgvlhdrohhrghdprhgtphhtthhopehsrdhhr ghuvghrsehpvghnghhuthhrohhnihigrdguvgdprhgtphhtthhopehkvghrnhgvlhesphgvnhhguhhtrhhonhhigidruggvpdhrtghpthhtohepfhgvshhtvghvrghmsehgmhgrihhlrdgtohhm 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 95baa29d4c2d..bbbab115d47f 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;
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 <herve.codina@bootlin.com> --- drivers/pci/of.c | 7 +++++++ 1 file changed, 7 insertions(+)