Commit ed81f5fc authored by Alan Tull's avatar Alan Tull Committed by Greg Kroah-Hartman

fpga: region: fix slow warning with more than one overlay

When DT overlays are applied, each FPGA region keeps track of the fpga
image info as region->info.  This pointer is assigned only if an
overlay causes the FPGA to be programmed.  As it stands, this pointer
can be overwritten, causing a slow warning later when overlays are

This patch fixes this by changing the allowed behaviour.  If a region
has received an overlay that programmed the FPGA, reject other
overlays that try to program the FPGA.  To reprogram the FPGA, first
remove the overlay.  This makes sense as removing the overlay also
removes the devices cleanly.  Note that overlays that make DT changes
without reprogramming the FPGA are exempt from this restriction.
Signed-off-by: default avatarAlan Tull <>
Acked-by: default avatarMoritz Fischer <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 1743df83
......@@ -355,6 +355,11 @@ static int fpga_region_notify_pre_apply(struct fpga_region *region,
const char *firmware_name;
int ret;
if (region->info) {
dev_err(dev, "Region already has overlay applied.\n");
return -EINVAL;
* Reject overlay if child FPGA Regions added in the overlay have
* firmware-name property (would mean that an FPGA region that has
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment