Skip to content

Commit 27607f1

Browse files
author
Josh Tsai
committed
Revert "Clear the wake source flag to avoid the wrong pwoer state"
This reverts commit 4d24126. EC code doesn't return the POWER_G3 state, so when we forcing_shutdown and the flag is cleared early, it need to wait 10s down to S5G3 state. If users press the power button, system won't power on and LED turn on, it will cause the users confuse. So we need to seprate the custom_forcing from common forcing_shutdown, to keep pch power and avoid impact by common forcing_shutdwon. Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com>
1 parent 4d24126 commit 27607f1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

board/hx20/power_sequence.c

Lines changed: 6 additions & 7 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,10 +76,8 @@ 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();
79-
/* we need to clear the wake source to avoid the wrong power state */
80-
*host_get_customer_memmap(0x02) = 0x00;
81-
system_set_bbram(SYSTEM_BBRAM_IDX_VPRO_STATUS, 0);
8281
}
8382
}
8483

@@ -114,8 +113,10 @@ int keep_pch_power(void)
114113

115114
system_get_bbram(SYSTEM_BBRAM_IDX_VPRO_STATUS, &vpro_change);
116115

117-
if (forcing_shutdown)
116+
if (custom_forcing_shutdown && power_get_state() == POWER_S5G3) {
117+
custom_forcing_shutdown = 0;
118118
return false;
119+
}
119120
else if (version & BIT(0) && extpower_is_present() && vpro_change)
120121
return true;
121122
#ifdef CONFIG_EMI_REGION1
@@ -397,11 +398,9 @@ enum power_state power_handle_state(enum power_state state)
397398
case POWER_S5:
398399
CPRINTS("PH S5");
399400

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

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

0 commit comments

Comments
 (0)