[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251127-of-fpga-region-fail-if-bridges-not-found-v1-1-ca674f8d07eb@bootlin.com>
Date: Thu, 27 Nov 2025 16:58:48 +0100
From: Romain Gantois <romain.gantois@...tlin.com>
To: Moritz Fischer <mdf@...nel.org>, Xu Yilun <yilun.xu@...el.com>,
Tom Rix <trix@...hat.com>
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
Romain Gantois <romain.gantois@...tlin.com>
Subject: [PATCH] fpga: of-fpga-region: Fail if any bridge is missing
When parsing the region bridge list from the "fpga-bridges" device tree
property, the of-fpga-region driver will silently ignore bridges which fail
to be obtained, for example due to a missing bridge driver or invalid
phandle.
This can lead to hardware issues if a region bridge stays coupled when
partial programming is performed.
Fail if any of the bridges specified in "fpga-bridges" cannot be obtained.
Signed-off-by: Romain Gantois <romain.gantois@...tlin.com>
---
drivers/fpga/of-fpga-region.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index 43db4bb77138..caa091224dc5 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -83,7 +83,7 @@ static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)
* done with the bridges.
*
* Return: 0 for success (even if there are no bridges specified)
- * or -EBUSY if any of the bridges are in use.
+ * or an error code if any of the bridges are not available.
*/
static int of_fpga_region_get_bridges(struct fpga_region *region)
{
@@ -130,10 +130,10 @@ static int of_fpga_region_get_bridges(struct fpga_region *region)
®ion->bridge_list);
of_node_put(br);
- /* If any of the bridges are in use, give up */
- if (ret == -EBUSY) {
+ /* If any of the bridges are not available, give up */
+ if (ret) {
fpga_bridges_put(®ion->bridge_list);
- return -EBUSY;
+ return ret;
}
}
---
base-commit: c9243d6df0d617535e842aa4c3d1d7dfdb91d07b
change-id: 20251127-of-fpga-region-fail-if-bridges-not-found-79e568743038
Best regards,
--
Romain Gantois <romain.gantois@...tlin.com>
Powered by blists - more mailing lists