device/pci: Handle unassigned bus resources gracefully
The I/O windows of PCI bridges can be disabled individually by setting their limit lower than their base. Always do this if a resource wasn't assigned a value. Change-Id: I73f6817c4b12cb1689627044735d1fed6d825afe Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41552 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
730b2616aa
commit
f531244d20
|
@ -510,11 +510,17 @@ static void pci_set_resource(struct device *dev, struct resource *resource)
|
||||||
{
|
{
|
||||||
/* Make certain the resource has actually been assigned a value. */
|
/* Make certain the resource has actually been assigned a value. */
|
||||||
if (!(resource->flags & IORESOURCE_ASSIGNED)) {
|
if (!(resource->flags & IORESOURCE_ASSIGNED)) {
|
||||||
|
if (resource->flags & IORESOURCE_BRIDGE) {
|
||||||
|
/* If a bridge resource has no value assigned,
|
||||||
|
we can treat it like an empty resource. */
|
||||||
|
resource->size = 0;
|
||||||
|
} else {
|
||||||
printk(BIOS_ERR, "ERROR: %s %02lx %s size: 0x%010llx not "
|
printk(BIOS_ERR, "ERROR: %s %02lx %s size: 0x%010llx not "
|
||||||
"assigned\n", dev_path(dev), resource->index,
|
"assigned\n", dev_path(dev), resource->index,
|
||||||
resource_type(resource), resource->size);
|
resource_type(resource), resource->size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If this resource is fixed don't worry about it. */
|
/* If this resource is fixed don't worry about it. */
|
||||||
if (resource->flags & IORESOURCE_FIXED)
|
if (resource->flags & IORESOURCE_FIXED)
|
||||||
|
|
Loading…
Reference in New Issue