diff options
author | Wai-Hong Tam <waihong@google.com> | 2021-06-24 15:34:10 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-25 18:43:05 +0000 |
commit | 8d3c321c27cc06eef438190651eac83be08012e9 (patch) | |
tree | ddd70bd1a4abf2449af0a6eb6b424132f635d846 /power/common.c | |
parent | ec339489d1f0d67f43934949a9b7fb271a043546 (diff) | |
download | chrome-ec-8d3c321c27cc06eef438190651eac83be08012e9.tar.gz |
power: Reorder the power_chipset_init and the interrupt enable
The previous order is:
* power_chipset_init()
* enabling/disabling the power signal interrupts
There is a need that power_chipset_init() modifies the power signal
interrupt enabling/disabling, like crrev.com/c/2977573. The
power_chipset_init() checks if AP is ON or OFF; when AP is OFF, a
power signal interrupt is disabled (default) to avoid the floating
interrupt storm; but when AP is ON, the power signal interrupt is
enabled. But the next action resets the interrupt to default.
This CL reorders it to:
* enabling/disabling the power signal interrupts
* power_chipset_init()
So the interrupt enable/disable status won't be overridden.
BRANCH=None
BUG=b:185551931
TEST=Tested on Coachz, reboot EC, sysjump to RW, perform `apreset` which
executes a warm AP reboot.
Change-Id: I1740fed1d37a312ac822b2a91e9ebd5502756a1f
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2986224
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'power/common.c')
-rw-r--r-- | power/common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/power/common.c b/power/common.c index 7fc6a8cfb3..6ecfff543d 100644 --- a/power/common.c +++ b/power/common.c @@ -722,9 +722,6 @@ static void power_common_init(void) /* Update input state */ power_update_signals(); - /* Call chipset-specific init to set initial state */ - power_set_state(power_chipset_init()); - /* Enable interrupts for input signals */ for (i = 0; i < POWER_SIGNAL_COUNT; i++, s++) if (s->flags & POWER_SIGNAL_DISABLE_AT_BOOT) @@ -732,6 +729,9 @@ static void power_common_init(void) else power_signal_enable_interrupt(s->gpio); + /* Call chipset-specific init to set initial state */ + power_set_state(power_chipset_init()); + /* * Update input state again since there is a small window * before GPIO is enabled. |