drivers/elog: put back 4KiB limit

The removal of ELOG_FLASH_BASE and ELOG_FLASH_SIZE resulted
in the FMAP region for the eventlog to be honored. However,
certain systems seem to have a large eventlog region that
wasn't being used in practice. Because of the malloc() in the
eventlog init sequence a large allocation was now being requested
that can exhaust the heap. Put back the 4KiB capacity until
the resource usage is fixed.

BUG=chrome-os-partner:55593

Change-Id: Ib54b396b48e5be80f737fc3feb0d58348c0d2844
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/15835
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Aaron Durbin
2016-07-25 08:44:57 -05:00
parent dc4820baed
commit 49d233006b

View File

@ -499,7 +499,8 @@ static void elog_find_flash(void)
flash_base = total_size = 0; flash_base = total_size = 0;
} else { } else {
flash_base = region_offset(&r); flash_base = region_offset(&r);
total_size = region_sz(&r); /* Keep 4KiB max size until large malloc()s have been fixed. */
total_size = MIN(4*KiB, region_sz(&r));
} }
log_size = total_size - sizeof(struct elog_header); log_size = total_size - sizeof(struct elog_header);