From 25a5a808d3f132ad18ee35c791b35a3db7ee7bd9 Mon Sep 17 00:00:00 2001 From: Kane Chen Date: Tue, 2 Sep 2014 12:59:19 -0700 Subject: [PATCH] x86: fixed mainboard_suspend_resume will be called when it's not defined There is no proto function for mainboard_suspend_resume In this case mainboard_suspend_resume is not NULL, and cause if statment true. Bios will jump to an empty weak function, if mainboard_suspend_resume is not defined in mainboard.c Then system becomes panic during s3 resume BUG=chrome-os-partner:31286 TEST=compile ok and make sure system can resume from s3 BRANCH=None Change-Id: I76bdea1d96166e683c6284024e1befbfc0d64645 Signed-off-by: Kane Chen Reviewed-on: https://chromium-review.googlesource.com/215865 Reviewed-by: Aaron Durbin Commit-Queue: Shawn Nematbakhsh Tested-by: Shawn Nematbakhsh --- src/arch/x86/boot/acpi.c | 7 +++++-- src/arch/x86/include/arch/acpi.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c index 3b77caa314..eac1a50ed4 100644 --- a/src/arch/x86/boot/acpi.c +++ b/src/arch/x86/boot/acpi.c @@ -620,6 +620,10 @@ void acpi_write_hest(acpi_hest_t *hest) header->checksum = acpi_checksum((void *)hest, header->length); } +void __attribute__((weak)) mainboard_suspend_resume(void) +{ +} + #if CONFIG_HAVE_ACPI_RESUME void acpi_resume(void *wake_vec) { @@ -635,8 +639,7 @@ void acpi_resume(void *wake_vec) #endif /* Call mainboard resume handler first, if defined. */ - if (mainboard_suspend_resume) - mainboard_suspend_resume(); + mainboard_suspend_resume(); post_code(POST_OS_RESUME); acpi_jump_to_wakeup(wake_vec); diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index 306f7da046..4ae63a0c9c 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -559,7 +559,7 @@ void acpi_save_gnvs(u32 gnvs_address); extern u8 acpi_slp_type; void acpi_resume(void *wake_vec); -void __attribute__((weak)) mainboard_suspend_resume(void); +void mainboard_suspend_resume(void); void *acpi_find_wakeup_vector(void); void *acpi_get_wakeup_rsdp(void); void acpi_jump_to_wakeup(void *wakeup_addr);