Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41523 )
Change subject: device/pci_device: Do not complain about unassigned resources for PCI bridge ......................................................................
Patch Set 1:
Patch Set 1:
Patch Set 1: Code-Review-1
The error seems valid.
I don't understand how. If we are expecting the resource allocator to not set the IORESOURCE_ASSIGNED flag then it is expected that control would enter pci_set_resource() for a resource that has size 0 and does not have the IORESOURCE_ASSIGNED flag. In that case, the error is not really valid.
The size 0 case is explicitly handled to fill the bridge registers with sane values. We need a solution that doesn't bail out.
I believe you are referring to line 503 in the file? That makes sense to me, but it is really odd that we are saying the the resource does not have the IORESOURCE_ASSIGNED flag, but still has the IORESOURCE_STORED flag(line 499).
So, what are the semantics of these flags:
IORESOURCE_ASSIGNED --> Resource is assigned a value by the allocator IORESOURCE_STORED --> Either the assignment from allocator is stored in the device or if it is a bridge device without assignment, then assignment to disable the resource is stored in the device.
Revisiting the code here and in the resource allocator, I am planning to abandon this patch and continue with the semantics of IORESOURCE_ASSIGNED meaning that the resource allocator has assigned a value to the base. If the resource is allocated space, base is set to whatever the base of the allocated address space is and if the resource is not allocated space, then base is set to the limit so that it is disabled.