From 918adbbd6373a7ee5967182fd4f8d58c47eeed15 Mon Sep 17 00:00:00 2001 From: Eric Yilun Lin Date: Wed, 10 Aug 2022 14:18:13 +0800 Subject: mt8186,mt8188: check IN_AP_RST signal when wachdog IRQ raised Watchdog interrupt is only significant only when AP is on, which means the IN_AP_RST should not be asserted. BUG=b:242012415 TEST=stop daisydog; echo > /dev/watchdog; EC report AP_WACHDOG reset BRANCH=none LOW_COVERAGE_REASON=initial bringup Change-Id: I2af6fc6f61b909a31e542d86a5a43011cdb6afac Signed-off-by: Eric Yilun Lin Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3820873 Commit-Queue: Eric Yilun Lin Tested-by: Eric Yilun Lin Reviewed-by: Ting Shen --- power/mt8186.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/power/mt8186.c b/power/mt8186.c index f4f91faa51..ac2866348a 100644 --- a/power/mt8186.c +++ b/power/mt8186.c @@ -99,11 +99,8 @@ void chipset_reset_request_interrupt(enum gpio_signal signal) static void watchdog_interrupt_deferred(void) { - /* - * If this is a real WDT, AP_IN_SLEEP_L should keep high after - * the WDT interrupt is fired. Otherwise, it's a normal shutdown. - */ - if (gpio_get_level(GPIO_AP_IN_SLEEP_L)) + /* If it's a real WDT, it must be in S0. */ + if (!(power_get_signals() & (IN_AP_RST | IN_SUSPEND_ASSERTED))) chipset_reset(CHIPSET_RESET_AP_WATCHDOG); } DECLARE_DEFERRED(watchdog_interrupt_deferred); -- cgit v1.2.1