From d9da2628292123e571e58947200fbf56afda677e Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Mon, 24 Feb 2025 11:40:35 +0530 Subject: [PATCH] soc/intel/common/reset: Mark do_low_battery_poweroff with __noreturn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the low battery poweroff scenario, the platform should halt after issuing the poweroff command. This ensures that no further code execution occurs, preventing potential issues. Additionally, the do_low_battery_poweroff() function is marked with __noreturn to indicate that it does not return. This is appropriate because the platform will either power off or halt. TEST=Able to compile google/fatcat. Change-Id: Ieb77645283360b5731ca48b94551712b99109a1c Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/86578 Reviewed-by: Jérémy Compostella Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) Reviewed-by: Jayvik Desai --- src/soc/intel/common/reset.c | 1 + src/soc/intel/common/reset.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/common/reset.c b/src/soc/intel/common/reset.c index 3fefa57d30..307be5769a 100644 --- a/src/soc/intel/common/reset.c +++ b/src/soc/intel/common/reset.c @@ -32,4 +32,5 @@ void do_low_battery_poweroff(void) } poweroff(); + halt(); } diff --git a/src/soc/intel/common/reset.h b/src/soc/intel/common/reset.h index 8331853023..71fe05d638 100644 --- a/src/soc/intel/common/reset.h +++ b/src/soc/intel/common/reset.h @@ -30,6 +30,6 @@ efi_return_status_t fsp_get_pch_reset_status(void); * * Call this function to power off the platform if the battery level is critically low. */ -void do_low_battery_poweroff(void); +__noreturn void do_low_battery_poweroff(void); #endif /* _INTEL_COMMON_RESET_H_ */