diff mbox series

[U-Boot] Revert "efi_loader: efi_allocate_pages is too restrictive"

Message ID 20180802174557.28585-1-swarren@wwwdotorg.org
State Accepted
Commit ccfc78b820e5e431c5bd73b072e7536a972e1710
Delegated to: Alexander Graf
Headers show
Series [U-Boot] Revert "efi_loader: efi_allocate_pages is too restrictive" | expand

Commit Message

Stephen Warren Aug. 2, 2018, 5:45 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

This reverts commit aa909462d01866354f4cd4534db5f571c2cf1fbb. This change
caused "dhcp filename" to crash the system on p2371-2180 (Jetson TX1), for
example when running test/py.

Reverting this change isn't optimal, but at least restores TX1 to a working
state. In the future, we should:

a) Fix whatever problem causes the crash with this patch applied. This
needs further discussion, so isn't something we can immediately do.

b) Undo the revert; re-apply the original patch to efi_allocate_pages.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 lib/efi_loader/efi_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Aug. 2, 2018, 8:36 p.m. UTC | #1
On 2 August 2018 at 11:45, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> This reverts commit aa909462d01866354f4cd4534db5f571c2cf1fbb. This change
> caused "dhcp filename" to crash the system on p2371-2180 (Jetson TX1), for
> example when running test/py.
>
> Reverting this change isn't optimal, but at least restores TX1 to a working
> state. In the future, we should:
>
> a) Fix whatever problem causes the crash with this patch applied. This
> needs further discussion, so isn't something we can immediately do.
>
> b) Undo the revert; re-apply the original patch to efi_allocate_pages.
>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Alexander Graf <agraf@suse.de>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  lib/efi_loader/efi_memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 967c3f733e4c..4b6269f35e11 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -305,7 +305,7 @@  efi_status_t efi_allocate_pages(int type, int memory_type,
 	switch (type) {
 	case EFI_ALLOCATE_ANY_PAGES:
 		/* Any page */
-		addr = efi_find_free_memory(len, -1ULL);
+		addr = efi_find_free_memory(len, gd->start_addr_sp);
 		if (!addr) {
 			r = EFI_NOT_FOUND;
 			break;