on the Colibri imx7d we are using the external watchdog rn5t618. The watchdog itself works properly: echo 1 > /dev/watchdog pings it; not pinging afterwards causes reboot; echo V > /dev/watchdog pauses the watchdog
When I run “shutdown -h now” and I did not start the watchdog at all (never sending anything to /dev/watchdog) the system shuts down cleanly.
However, when I had started the watchdog and then paused it, after sending “shutdown -h now” I see suddenly activity on the I2C lines to the watchdog and I see UBoot starting up again, booting the kernel and then the system stops.
Is there a way to prevent this unwanted boot-up shortly before the system stops?
I was able to reproduce the behaviour on my side and I noticed that this behaviour vanishes if you use BSP 5.2. Would upgrading to a newer version be a viable option for you?
If not there would be the option of trying to use the new watchdog driver in your image. This should remove the behaviour as well.
Hello Kevin,
thank you very much for investigating this.
At the moment I would prefer not to change to the new BSP - I assume that means upgrading to Yocto Dunfell and Linux kernel 5.4. I’m afraid this would cause quite a migration effort. I’d rather try fixing the problem by replacing the driver file first.
You suggest that just taking the updated rn5t618_wdt.c will solve the problem? Or do I need to update some kernel sources too, like the higher-level watchdog_dev.c ?
yes indeed. That would mean Yocto dunfell and Linux Kernel 5.4. I can understand the hesitation and trying to fix it is surely a viable option.
It’s hard to tell what changes have to be made, to get it to work. I would suggest looking at the “diff” between the two versions of the drivers. The source you can get from our repo here.
Nevertheless, I would strongly recommend thinking about upgrading to the new version in a long term way. Version 4 is not anymore supported by Toradex and therefore we recommend upgrading to 5.4. If you need help in doing this, feel free to let us know.
Did this help you? Let me know about your progress.
I tried just replacing just the watchdog driver rn5t618_wdt.c, but the behaviour did not change. The code looks mostly similar, except for a few changes that seem more cosmetic. I will try changing higher-layer files next, if it is possible to port them with acceptable effort to the older kernel version.
Eventually, out plan is to migrate to a newer version, especially to get Yocto’s benefits up updated sources of the whole Linux system. So, if I get stuck patching the watchdog driver hierarchy, I assume we will have to take this step sooner than later.
Yes, your investigation and your replies have been very helpful, telling me that there is a version without this unwanted behaviour. Now its just a matter of finding and eliminating the differences.
Again, thank you very much for your support!
Otmar