Skip to contentSkip to conversation

configs: mediatek: do not autostart the watchdog on the Genio EVKs

PATCH Applied Carlo Caione 4 participants 5 messages Jul 6 – Jul 22 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs: mediatek: do not autostart the watchdog on the Genio EVKs

U-Boot autostarts the SoC watchdog (CONFIG_WATCHDOG_AUTOSTART default
y) and services it from its main loop, but nothing services it after ExitBootServices()/bootm: an EFI-booted OS that does not take over the watchdog in time is reset mid-boot at a wall-clock-dependent point.

The MediaTek toprgu can count at most ~16 seconds, once firmware stops servicing it at the handoff, the OS has whatever is left of those 16 seconds.

On the Genio 700 EVK the generic Ubuntu 26.04 arm64 image is hard-reset before its first boot reaches the login prompt: the mtk-wdt driver is a module loaded from the rootfs and cannot win that race. Nothing tells a generic OS that the watchdog is armed, so the failure is silent and, from the user's side, indistinguishable from broken firmware.

Disable WATCHDOG_AUTOSTART for the Genio EVK boards (mt8365_evk directly, mt8188.config for the Genio 510/700).

---
 configs/mt8188.config        | 1 +
 configs/mt8365_evk_defconfig | 1 +
 2 files changed, 2 insertions(+)
configs/mt8188.config +1 -0
index 9dfba6bf99f..26823cf35d2 100644
@@ -20,6 +20,7 @@ CONFIG_PINCTRL_MT8188=y
 CONFIG_BAUDRATE=921600
 CONFIG_DM_SERIAL=y
 CONFIG_MTK_SERIAL=y
+# CONFIG_WATCHDOG_AUTOSTART is not set
 CONFIG_WDT=y
 CONFIG_WDT_MTK=y
 # CONFIG_RANDOM_UUID is not set
configs/mt8365_evk_defconfig +1 -0
index 1a385492547..6620f540fd4 100644
@@ -29,5 +29,6 @@ CONFIG_DM_REGULATOR_MT6357=y
 CONFIG_BAUDRATE=921600
 CONFIG_DM_SERIAL=y
 CONFIG_MTK_SERIAL=y
+# CONFIG_WATCHDOG_AUTOSTART is not set
 CONFIG_WDT=y
 CONFIG_WDT_MTK=y
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Carlo Caione

U-Boot autostarts the SoC watchdog (CONFIG_WATCHDOG_AUTOSTART default
y) and services it from its main loop, but nothing services it after ExitBootServices()/bootm: an EFI-booted OS that does not take over the watchdog in time is reset mid-boot at a wall-clock-dependent point.

The MediaTek toprgu can count at most ~16 seconds, once firmware stops servicing it at the handoff, the OS has whatever is left of those 16 seconds.

On the Genio 700 EVK the generic Ubuntu 26.04 arm64 image is hard-reset before its first boot reaches the login prompt: the mtk-wdt driver is a module loaded from the rootfs and cannot win that race. Nothing tells a generic OS that the watchdog is armed, so the failure is silent and, from the user's side, indistinguishable from broken firmware.

Quoted 4 lines

Disable WATCHDOG_AUTOSTART for the Genio EVK boards (mt8365_evk directly, mt8188.config for the Genio 510/700).

Thanks!

Signature · 1 line
Tom
#2 lore raw
In reply to Carlo Caione
Quoted 15 lines · Carlo Caione

U-Boot autostarts the SoC watchdog (CONFIG_WATCHDOG_AUTOSTART default
y) and services it from its main loop, but nothing services it after ExitBootServices()/bootm: an EFI-booted OS that does not take over the watchdog in time is reset mid-boot at a wall-clock-dependent point.

The MediaTek toprgu can count at most ~16 seconds, once firmware stops servicing it at the handoff, the OS has whatever is left of those 16 seconds.

On the Genio 700 EVK the generic Ubuntu 26.04 arm64 image is hard-reset before its first boot reaches the login prompt: the mtk-wdt driver is a module loaded from the rootfs and cannot win that race. Nothing tells a generic OS that the watchdog is armed, so the failure is silent and, from the user's side, indistinguishable from broken firmware.

Quoted 9 lines

Disable WATCHDOG_AUTOSTART for the Genio EVK boards (mt8365_evk directly, mt8188.config for the Genio 510/700).

---
 configs/mt8188.config        | 1 +
 configs/mt8365_evk_defconfig | 1 +
 2 files changed, 2 insertions(+)

What about Genio 520/720 (mt8189.config) and Genio 1200 (mt8195.config)? Seems like the same reasoning would apply to those.

Quoted 23 lines
configs/mt8188.config +1 -0
index 9dfba6bf99f..26823cf35d2 100644
@@ -20,6 +20,7 @@ CONFIG_PINCTRL_MT8188=y
 CONFIG_BAUDRATE=921600
 CONFIG_DM_SERIAL=y
 CONFIG_MTK_SERIAL=y
+# CONFIG_WATCHDOG_AUTOSTART is not set
 CONFIG_WDT=y
 CONFIG_WDT_MTK=y
 # CONFIG_RANDOM_UUID is not set
configs/mt8365_evk_defconfig +1 -0
index 1a385492547..6620f540fd4 100644
@@ -29,5 +29,6 @@ CONFIG_DM_REGULATOR_MT6357=y
 CONFIG_BAUDRATE=921600
 CONFIG_DM_SERIAL=y
 CONFIG_MTK_SERIAL=y
+# CONFIG_WATCHDOG_AUTOSTART is not set
 CONFIG_WDT=y
 CONFIG_WDT_MTK=y
#3 lore raw
Quoted 27 lines · David Lechner
Quoted 15 lines · Carlo Caione

U-Boot autostarts the SoC watchdog (CONFIG_WATCHDOG_AUTOSTART default
y) and services it from its main loop, but nothing services it after ExitBootServices()/bootm: an EFI-booted OS that does not take over the watchdog in time is reset mid-boot at a wall-clock-dependent point.

The MediaTek toprgu can count at most ~16 seconds, once firmware stops servicing it at the handoff, the OS has whatever is left of those 16 seconds.

On the Genio 700 EVK the generic Ubuntu 26.04 arm64 image is hard-reset before its first boot reaches the login prompt: the mtk-wdt driver is a module loaded from the rootfs and cannot win that race. Nothing tells a generic OS that the watchdog is armed, so the failure is silent and, from the user's side, indistinguishable from broken firmware.

Quoted 9 lines

Disable WATCHDOG_AUTOSTART for the Genio EVK boards (mt8365_evk directly, mt8188.config for the Genio 510/700).

---
 configs/mt8188.config        | 1 +
 configs/mt8365_evk_defconfig | 1 +
 2 files changed, 2 insertions(+)
Quoted 2 lines

What about Genio 520/720 (mt8189.config) and Genio 1200 (mt8195.config)? Seems like the same reasoning would apply to those.

Yes, but this is a preliminary patch for a much larger effort focused only on the G700 for now. Since this change essentially disables the watchdog in U-Boot I prefer to limit it, for now, only to the platforms where this is actually needed. The same will be done also for the other platforms in due time.

Cheers,

--
Carlo Caione

#4 lore raw
In reply to Carlo Caione
Quoted 1 line · Carlo Caione

configs: mediatek: do not autostart the watchdog on the Genio EVKs

Applied to mediatek-for-main, thanks!

[1/1] configs: mediatek: do not autostart the watchdog on the Genio EVKs

      commit: f309d23e3a171d56a4a6c2eb21588a370b8c811e

Best regards,

Signature · 1 line
David Lechner <[email protected]>