cancel
Showing results for 
Search instead for 
Did you mean: 

Linux watchdog driver is broken.

Bumsik Kim
Senior

Hi,

I have already post a similar issue in the previous post.

I'm using initramfs shell using initramfs-framework in Yocto environment.

I found that watchdog reboots after some time (the default is 32 seconds) if the initramfs doesn't fully boot the system by entering systemd.

The weird thing is though, this happens even WATCHDOG_HANDLE_BOOT_ENABLED is set correctly.

According to the source code of watchdog_dev.c in Linux Kernel if WATCHDOG_HANDLE_BOOT_ENABLED=y is set the kernel watchdog thread should handle watchdog correctly until a userspace program (systemd?) takes over /dev/watchdog. However, watchdog still reboots the board.

https://elixir.bootlin.com/linux/v4.14/source/drivers/watchdog/watchdog_dev.c#L1124

I set similar yocto environments (with WATCHDOG_HANDLE_BOOT_ENABLED=y) in Raspberry Pi 3 and Beaglebone Black, and their kernel seems to handle watchdog correctly as they don't reboot in initramfs environment for a long time. Only STM32MP1 seems to have problems with watchdog.

10 REPLIES 10
Olivier GALLIEN
ST Employee

Hi @Bumsik Kim​ 

Your post has been escalated internally for analyze.

Keep you posted.

BR,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Christophe Guibout
ST Employee

Hi @Bumsik Kim​ 

Issue reproduced internally by decreasing the watchdog timeout value to occur during kernel boot.

Waiting a correction, I would propose to increase the timeout value to be high than the boot duration :

https://wiki.st.com/stm32mpu/wiki/IWDG_device_tree_configuration#DT_configuration_-28board_level-29

In that case, don't forget to align the userland timeout value in /etc/systemd/system.conf:

RuntimeWatchdogSec=<your new timeout value>

BR,

Christophe

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thanks for the quick update!

Olivier GALLIEN
ST Employee

Hi @Bumsik Kim​ 

Actually, we did not reproduce the issue.

Our test on DK2 with both SDCard or ramfs boot decreasing the IDWG watchdog to 1s never trig any reboot during kernel boot.

Could you please share more detail on your context and full log of the failing boot sequence ?

Thanks,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Bumsik Kim
Senior

@Community member​ 

@Christophe Guibout​ 

Hi, sorry for a long silent.

I reproduced the problem on OpenSTLinux.

The easiest way to reproduce the problem is just disable systemd userland watchdog. Just delete the two lines in /etc/systemd/system.conf:

RuntimeWatchdogSec=30
ShutdownWatchdogSec=5min

Or just delete systemd-conf.bbappend and 0001-Enable-hardware-watchdog-inside-systemd.patch in layers/meta-st/meta-st-stm32mp/recipes-core/systemd in OpenSTLinux. You don't need this systemd-conf.bbappend if the kernel driver is implemented correctly.

As I mentioned earlier the kernel must take care of the watchdog when systemd watchdog is disabled, however, you will experience infinite reboot.

PPand.4
Associate II

Hi,

I am also facing the same issue. I am also booting kernel with ramdisk by passing rdinit=/bin/sh on command line but after 32sec by target(STM32MP157A-EV1) is calling reset and reason watchdog as mentioned in log below. I tried to disable the watchdog timer also but it is not working. Please suggest any pointer to fix this issue.

INFO:  Reset reason (0x214):

INFO:   IWDG2 Reset (rst_iwdg2)

Olivier GALLIEN
ST Employee

Thanks @Bumsik Kim​ for update and @PPand.4​  to raise the point.

The topic has been reassigned internally.

Keep you posted.

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
PPand.4
Associate II

Hi,

I found some quick fix. After booting from ramdisk please execute below mentioned commands:-

# mknod /dev/watchdog c 10 130

# watchdog -t 30 /dev/watchdog

Hope it will help.

Bumsik Kim
Senior

Hi,

Is there any update on this? I saw the changelog of the latest 1.2.0 but I see no mention about the watchdog.