summaryrefslogtreecommitdiff
path: root/common/panic_output.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-02-19 09:07:24 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-20 00:07:01 +0000
commit91268fb85e1a09ffc3d64ea139bc7d09305c0396 (patch)
treeef734d5519275837a9e1f34b973d1b9d02411a13 /common/panic_output.c
parent3ae7240410e1bbdca9c0da49d23a8d8349eb2ef4 (diff)
downloadchrome-ec-91268fb85e1a09ffc3d64ea139bc7d09305c0396.tar.gz
panic: fix logging of watchdog in panic data
Fix bug with the new CONFIG_SOFTWARE_PANIC where a watchdog panic will write panic data after jump_data pointer is calculated. Since jump data uses the same RAM location as panic data (the end of RAM), we rely on panic data being written BEFORE jump data pointer is calculated so that we don't use the same RAM space. BUG=chrome-os-partner:36871 BRANCH=samus TEST=without this CL, can reproduce problem where jump data is corrupted using samus with following steps: 1) hibernate 1 (this will clear panicinfo) 2) waitms 3000 (this will cause a watchdog reset) 3) let system boot to S0 4) sysjump rw On sysjump to RW, the jump data will be corrupt because while we were in RO panic data was added where there wasn't any before. This means the jump_data pointer in RW will differ from the jump_data pointer that was used in RO and we will fail to find the magic jump data. Most visible consequence of this is that the USB ports will be disabled after these steps because we use jump data to store last state of USB port enables. With this CL, following the steps above, the USB ports are restored to the pre-sysjump state, which is enabled. Change-Id: Ia129419db7400eddb54bcf57b4d4aed63d5c52ef Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/251110 Reviewed-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/panic_output.c')
-rw-r--r--common/panic_output.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/common/panic_output.c b/common/panic_output.c
index af98c5953d..a2c5e56b32 100644
--- a/common/panic_output.c
+++ b/common/panic_output.c
@@ -115,16 +115,6 @@ struct panic_data *panic_get_data(void)
return pdata_ptr->magic == PANIC_DATA_MAGIC ? pdata_ptr : NULL;
}
-#ifdef CONFIG_SOFTWARE_PANIC
-static void panic_init(void)
-{
- /* Log panic cause if watchdog caused reset */
- if (system_get_reset_flags() & RESET_FLAG_WATCHDOG)
- panic_log_watchdog();
-}
-DECLARE_HOOK(HOOK_INIT, panic_init, HOOK_PRIO_DEFAULT);
-#endif
-
#ifdef CONFIG_CMD_STACKOVERFLOW
static void stack_overflow_recurse(int n)
{