Skip to content

Commit 94697d0

Browse files
authored
Merge pull request #367 from FrameworkComputer/fix_force_shutdown_abnormal
Revert "Clear the wake source flag to avoid the wrong pwoer state"
2 parents e27425f + 21264cb commit 94697d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

board/hx20/power_sequence.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args)
3737

3838
static int forcing_shutdown; /* Forced shutdown in progress? */
39+
static int custom_forcing_shutdown;
3940

4041
/*
4142
* define wake source for keep PCH power
@@ -75,6 +76,7 @@ void chipset_force_shutdown(enum chipset_shutdown_reason reason)
7576
if (!chipset_in_state(CHIPSET_STATE_ANY_OFF)) {
7677
report_ap_reset(reason);
7778
forcing_shutdown = 1;
79+
custom_forcing_shutdown = 1;
7880
chipset_force_g3();
7981
/* we need to clear the wake source to avoid the wrong power state */
8082
*host_get_customer_memmap(0x02) = 0x00;
@@ -114,8 +116,10 @@ int keep_pch_power(void)
114116

115117
system_get_bbram(SYSTEM_BBRAM_IDX_VPRO_STATUS, &vpro_change);
116118

117-
if (forcing_shutdown)
119+
if (custom_forcing_shutdown && power_get_state() == POWER_S5G3) {
120+
custom_forcing_shutdown = 0;
118121
return false;
122+
}
119123
else if (version & BIT(0) && extpower_is_present() && vpro_change)
120124
return true;
121125
#ifdef CONFIG_EMI_REGION1
@@ -397,11 +401,9 @@ enum power_state power_handle_state(enum power_state state)
397401
case POWER_S5:
398402
CPRINTS("PH S5");
399403

400-
if (forcing_shutdown) {
404+
if (custom_forcing_shutdown)
401405
/* force shutdown process shouldn't keep PCH power */
402-
forcing_shutdown = 0;
403406
return POWER_S5G3;
404-
}
405407

406408
if (power_s5_up || stress_test_enable) {
407409
/* Wait S5 signal when power up from S5 */

0 commit comments

Comments
 (0)