diff options
author | Jone Chou <jonechou@google.com> | 2021-09-04 02:04:10 +0800 |
---|---|---|
committer | Jone Chou <jonechou@google.com> | 2021-09-07 18:07:39 +0800 |
commit | 6af65b1e3c87986ad31052cb0c47e2cbd80bae13 (patch) | |
tree | fc12f9468dd9322d9ad8856008883410dfefc762 | |
parent | a58c0f72212f1ac0b3c9fe8bd654645241b4412a (diff) | |
download | reset-6af65b1e3c87986ad31052cb0c47e2cbd80bae13.tar.gz |
power: reset: add in_panic and in_warm for swreset
- in_panic: in_reboot can't handle all of panic cases.
Like to trigger a NULL pointer dereference, it will
go 'efi_reboot(reboot_mode, NULL)' instead of
'do_kernel_restart(cmd)'.
- in_warm: a hook for user to request warm reset for
any other cold reboot cases, like adb reboot xxx.
Bug: 196236629
Bug: 196237493
Signed-off-by: Jone Chou <jonechou@google.com>
Change-Id: I453e57dd68f96aeb0594689de008412660762c38
-rw-r--r-- | exynos-gs101-reboot.c | 4 | ||||
-rw-r--r-- | exynos-gs201-reboot.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/exynos-gs101-reboot.c b/exynos-gs101-reboot.c index 91be306..ed69e4d 100644 --- a/exynos-gs101-reboot.c +++ b/exynos-gs101-reboot.c @@ -202,8 +202,8 @@ static int exynos_restart_handler(struct notifier_block *this, unsigned long mod pr_emerg("%s: Exynos SoC reset right now\n", __func__); if (s2mpg10_get_rev_id() == S2MPG10_EVT0 || - !rsbm_supported || - !dbg_snapshot_get_reboot_status()) { + !rsbm_supported || !dbg_snapshot_get_reboot_status() || + dbg_snapshot_get_panic_status() || dbg_snapshot_get_warm_status()) { ret = set_priv_reg(pmu_alive_base + warm_reboot_offset, warm_reboot_trigger); /* TODO: this is a temporary workaround. must remove. see b/169128860 */ diff --git a/exynos-gs201-reboot.c b/exynos-gs201-reboot.c index 5c0f044..e40ee5e 100644 --- a/exynos-gs201-reboot.c +++ b/exynos-gs201-reboot.c @@ -163,7 +163,8 @@ static int exynos_restart_handler(struct notifier_block *this, unsigned long mod /* Do S/W Reset */ pr_emerg("%s: Exynos SoC reset right now\n", __func__); - if (!dbg_snapshot_get_reboot_status()) { + if (!dbg_snapshot_get_reboot_status() || dbg_snapshot_get_panic_status() || + dbg_snapshot_get_warm_status()) { set_priv_reg(pmu_alive_base + warm_reboot_offset, warm_reboot_trigger); } else { pr_emerg("Set PS_HOLD Low.\n"); |