Skip to content

Commit 14d61d9

Browse files
Josh-Tsaiquinchou77
authored andcommitted
fwk: disable the hibernation timer if pressing the power button
If the system is in G3 state and the extpower is not present, EC will enter the hibernation mode. There is a worst case that the system de-asserts the SLP_S4 signal too late (about 4 seconds), which may cause the user can't power on the system. Even if we increase the hibernation timer (4c9a9f5), user may meet this issue. Therefore, we should disable the hibernation timer when pressing the power button to avoid EC triggering the hibernation and powering on the system to fails. BRANCH=fwk-sunflower-26784 BUG=EC enters hibernation mode, causing the system to fail to power on the system TEST=Open the chassis and shutdown the system. Wait for the chipset state jumps to G3 and then wait for 4 seconds to press the power button. Check that the system can be powered on. Signed-off-by: Josh Tsai <Josh_Tsai@compal.com>
1 parent fa46a90 commit 14d61d9

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

zephyr/program/framework/include/board_function.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ __override_proto void project_chassis_function(enum gpio_signal signal);
2626

2727
uint32_t get_system_percentage(void);
2828

29+
/**
30+
* Disable entering the EC hibernation mode
31+
*/
32+
void chassis_disable_enter_hibernate(void);
33+
2934
#endif /* __CROS_EC_BOARD_FUNCTION_H */

zephyr/program/framework/src/board_function.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ board_system_is_idle(uint64_t last_shutdown_time, uint64_t *target,
189189
return CRITICAL_SHUTDOWN_HIBERNATE;
190190
}
191191

192+
void chassis_disable_enter_hibernate(void)
193+
{
194+
hook_call_deferred(&chassis_open_hibernate_data, -1);
195+
}
192196
__overridable void project_chassis_function(enum gpio_signal signal)
193197
{
194198
}

zephyr/program/framework/src/power_button_x86.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ static void state_machine(uint64_t tnow)
334334
* just call the exit hard off start to run the state mechine.
335335
*/
336336
reset_diagnostics();
337+
chassis_disable_enter_hibernate();
337338
chipset_exit_hard_off();
338339

339340
/*

0 commit comments

Comments
 (0)