Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41419 )
Change subject: device: Allocate memory in top-down fashion for child resources ......................................................................
device: Allocate memory in top-down fashion for child resources
This change updates the resource allocator to allocate resources for children in a top-down fashion in the address space by using memranges_steal_last() to get the last range that can satisy the resource request.
This is done to maintain consistency with the old resource allocator. There are some AMD chipsets in the tree that do not really work well with the dynamic resource assignment since their resources are not all defined correctly before the allocator runs.
Change-Id: If631b0d1fed445723ef506a2c7671faee0326d37 Signed-off-by: Furquan Shaikh furquan@google.com --- M src/device/device.c 1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/41419/1
diff --git a/src/device/device.c b/src/device/device.c index d3102bb..b3f3a6e 100644 --- a/src/device/device.c +++ b/src/device/device.c @@ -839,8 +839,14 @@ continue; }
- if (memranges_steal(ranges, resource->limit, resource->size, resource->align, - type_match, &resource->base) == false) { + /* + * Steal memory from the last available range in the list so that the allocation + * happens in top-down fashion in the address space. This is done to maintain + * consistency with old resource allocator. + */ + if (memranges_steal_last(ranges, resource->limit, resource->size, + resource->align, type_match, + &resource->base) == false) { printk(BIOS_ERR, "ERROR: Resource didn't fit!!! "); printk(BIOS_SPEW, "%s %02lx * size: 0x%llx limit: %llx %s\n", dev_path(dev), resource->index,
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41419 )
Change subject: device: Allocate memory in top-down fashion for child resources ......................................................................
Patch Set 4:
(4 comments)
https://review.coreboot.org/c/coreboot/+/41419/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/41419/4//COMMIT_MSG@11 PS4, Line 11: satisy satisfy
https://review.coreboot.org/c/coreboot/+/41419/4//COMMIT_MSG@15 PS4, Line 15: allocator Re-flow. Fits on line above?
https://review.coreboot.org/c/coreboot/+/41419/4//COMMIT_MSG@15 PS4, Line 15: some AMD chipsets Explicitly name them?
https://review.coreboot.org/c/coreboot/+/41419/4//COMMIT_MSG@17 PS4, Line 17: not all defined correctly before the allocator runs. Give one example?
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/41419?usp=email )
Change subject: device: Allocate memory in top-down fashion for child resources ......................................................................
Abandoned
This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author.