diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2019-04-22 10:56:10 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-24 15:52:07 -0700 |
commit | 2ece52589486990cca666dc3ebc4164d5f2c0aed (patch) | |
tree | 0278f08782a2cf34827568065773e6eec7f6b4ac /chip | |
parent | 3fc3edd0d8f4a445965c4a936db02b03d37bc215 (diff) | |
download | chrome-ec-2ece52589486990cca666dc3ebc4164d5f2c0aed.tar.gz |
minute-ia: hard reset if we panic while handling a panic
ish_pm_reset is a rather complex procedure, and encountering a panic
while it is happening could lead to an infinte loop of handling
panics. This will preform a reset of the Minute-IA core if a panic
occurs and the system is already resetting from panic.
BUG=b:130752748,b:130587334
BRANCH=none
TEST=copied some invalid opcodes into switch_to_aontask procedure,
observed the hard reset after forcing a panic
Change-Id: I43459d78da9b67297f84e3a736d3f92da42a814c
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1576835
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/ish/system.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/chip/ish/system.c b/chip/ish/system.c index 22e6d60a06..74b6c8e17e 100644 --- a/chip/ish/system.c +++ b/chip/ish/system.c @@ -50,22 +50,18 @@ uint32_t chip_read_reset_flags(void) return 0; } -void _system_reset(int flags, int wake_from_hibernate) +void system_reset(int flags) { -#ifdef CONFIG_LOW_POWER_IDLE - /** - * ish_pm_reset() do more (poweroff main SRAM etc) than - * ish_mia_reset() which just reset the ISH minute-ia cpu core + /* + * ish_pm_reset() does more (poweroff main SRAM, etc) than + * ish_mia_reset() which just resets the ISH minute-ia cpu core */ - ish_pm_reset(); -#else - ish_mia_reset(); -#endif -} -void system_reset(int flags) -{ - _system_reset(flags, 0); + if (!IS_ENABLED(CONFIG_LOW_POWER_IDLE) || flags & SYSTEM_RESET_HARD) + ish_mia_reset(); + else + ish_pm_reset(); + while(1) ; } |