Hi,
daveshah mentioned on IRC that the PALMAS has a watchdog that can reset the system in case the OMAP5 does a lock up.
Apparently, it was enabled on an older kernel or bootloader TI released for the uEVM, but it's not enabled in our current setup.
The problem is: In case the OMAP5 locks up, it can run at full power and run REALLY hot - which could damage the battery.
Does anyone know how to enable that watchdog?
Hi,
Am 31.10.2020 um 03:09 schrieb Michael Mrozek EvilDragon@openpandora.org:
Hi,
daveshah mentioned on IRC that the PALMAS has a watchdog that can reset the system in case the OMAP5 does a lock up.
Yes, I think it should be enabled.
Apparently, it was enabled on an older kernel or bootloader TI released for the uEVM, but it's not enabled in our current setup.
The problem is: In case the OMAP5 locks up, it can run at full power and run REALLY hot - which could damage the battery.
Does anyone know how to enable that watchdog?
It appears as if the ti,palmas-wdt driver did not arrive in mainline:
https://lore.kernel.org/patchwork/patch/367819/ https://lkml.org/lkml/2013/2/27/143
I have no idea why. Maybe ask Tony?
BR, Nikolaus
Am 31.10.2020 um 07:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi,
Am 31.10.2020 um 03:09 schrieb Michael Mrozek EvilDragon@openpandora.org:
Hi,
daveshah mentioned on IRC that the PALMAS has a watchdog that can reset the system in case the OMAP5 does a lock up.
Yes, I think it should be enabled.
Apparently, it was enabled on an older kernel or bootloader TI released for the uEVM, but it's not enabled in our current setup.
The problem is: In case the OMAP5 locks up, it can run at full power and run REALLY hot - which could damage the battery.
Does anyone know how to enable that watchdog?
It appears as if the ti,palmas-wdt driver did not arrive in mainline:
https://lore.kernel.org/patchwork/patch/367819/ https://lkml.org/lkml/2013/2/27/143
I have no idea why. Maybe ask Tony?
One more bit of info: there may be an issue with primary watchdog and suspend (in suspend there is no-one keeping the watchdog tiggered and it can't be disabled before entering suspend):
https://e2e.ti.com/support/legacy_forums/omap/f/849/t/219035
I am not sure if this is also the case with the twl6037/Palmas.
Am 31.10.2020 um 07:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi,
Am 31.10.2020 um 03:09 schrieb Michael Mrozek EvilDragon@openpandora.org:
Hi,
daveshah mentioned on IRC that the PALMAS has a watchdog that can reset the system in case the OMAP5 does a lock up.
Yes, I think it should be enabled.
Apparently, it was enabled on an older kernel or bootloader TI released for the uEVM, but it's not enabled in our current setup.
The problem is: In case the OMAP5 locks up, it can run at full power and run REALLY hot - which could damage the battery.
Does anyone know how to enable that watchdog?
It appears as if the ti,palmas-wdt driver did not arrive in mainline:
patch 4/12 and 5/12 apply cleanly on v3.7 so we can think about forward-porting them.
https://lkml.org/lkml/2013/2/27/143
I have no idea why. Maybe ask Tony?
BR, Nikolaus
Kernel mailing list Kernel@pyra-handheld.com http://pyra-handheld.com/cgi-bin/mailman/listinfo/kernel
Am 31.10.2020 um 08:15 schrieb H. Nikolaus Schaller hns@goldelico.com:
Am 31.10.2020 um 07:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi,
Am 31.10.2020 um 03:09 schrieb Michael Mrozek EvilDragon@openpandora.org:
Hi,
daveshah mentioned on IRC that the PALMAS has a watchdog that can reset the system in case the OMAP5 does a lock up.
Yes, I think it should be enabled.
Apparently, it was enabled on an older kernel or bootloader TI released for the uEVM, but it's not enabled in our current setup.
The problem is: In case the OMAP5 locks up, it can run at full power and run REALLY hot - which could damage the battery.
Does anyone know how to enable that watchdog?
It appears as if the ti,palmas-wdt driver did not arrive in mainline:
patch 4/12 and 5/12 apply cleanly on v3.7 so we can think about forward-porting them.
If my memory would be better, I had remembered that we already have that:
https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/...
But it seems to be broken and not enabled.
https://lkml.org/lkml/2013/2/27/143
I have no idea why. Maybe ask Tony?
BR, Nikolaus
Kernel mailing list Kernel@pyra-handheld.com http://pyra-handheld.com/cgi-bin/mailman/listinfo/kernel
Kernel mailing list Kernel@pyra-handheld.com http://pyra-handheld.com/cgi-bin/mailman/listinfo/kernel
Am 31.10.2020 um 08:17 schrieb H. Nikolaus Schaller hns@goldelico.com:
Am 31.10.2020 um 08:15 schrieb H. Nikolaus Schaller hns@goldelico.com:
Am 31.10.2020 um 07:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi,
Am 31.10.2020 um 03:09 schrieb Michael Mrozek EvilDragon@openpandora.org:
Hi,
daveshah mentioned on IRC that the PALMAS has a watchdog that can reset the system in case the OMAP5 does a lock up.
Yes, I think it should be enabled.
Apparently, it was enabled on an older kernel or bootloader TI released for the uEVM, but it's not enabled in our current setup.
The problem is: In case the OMAP5 locks up, it can run at full power and run REALLY hot - which could damage the battery.
Does anyone know how to enable that watchdog?
It appears as if the ti,palmas-wdt driver did not arrive in mainline:
patch 4/12 and 5/12 apply cleanly on v3.7 so we can think about forward-porting them.
If my memory would be better, I had remembered that we already have that:
https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/...
But it seems to be broken and not enabled.
Now after becoming awake, I start to remember some more details and I have hacked the Letux kernel code a little...
1. the WDT was originally enabled by default in U-Boot
If I remember correctly our first experiments >5 years ago, this has the negative effect that after entering the u-boot console you just have 1 minute to type commands. So I think we have a patch in u-boot to disable it.
2. the driver requires a "compatible" entry which is missing I have added one to omap5-board-common.dtsi. See attached patch.
3. The discussion on https://lore.kernel.org/patchwork/patch/367819/ was the last step on this driver and it appears that nobody followed up.
I had taken some of the review comments and think I have fixed it:
https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/...
So this series seems to be the newest code that exists for this topic.
4. enable CONFIG_PALMAS_WATCHDOG=y in the defconfig
Then the watchdog driver becomes available to the kernel - but seems to have not enabled:
root@letux:~# ls -l /sys/class/watchdog/ total 0 lrwxrwxrwx 1 root root 0 Oct 31 11:21 watchdog0 -> ../../devices/platform/44000000.ocp/4ae00000.interconnect/4ae00000.interconnect:segment@10000/4ae14000.target-module/4ae14000.wdt/watchdog/watchdog0 lrwxrwxrwx 1 root root 0 Oct 31 11:21 watchdog1 -> ../../devices/platform/44000000.ocp/48000000.interconnect/48000000.interconnect:segment@0/48070000.target-module/48070000.i2c/i2c-0/0-0048/48070000.i2c:palmas@48:watchdog/watchdog/watchdog1 root@letux:~# ls -l /sys/class/watchdog/watchdog1/ total 0 -r--r--r-- 1 root root 4096 Oct 31 11:23 dev lrwxrwxrwx 1 root root 0 Oct 31 11:23 device -> ../../../48070000.i2c:palmas@48:watchdog drwxr-xr-x 2 root root 0 Oct 31 11:23 power lrwxrwxrwx 1 root root 0 Oct 31 11:21 subsystem -> ../../../../../../../../../../../../class/watchdog -rw-r--r-- 1 root root 4096 Oct 31 11:21 uevent root@letux:~#
5. I do not know how to control the watchdog1 timeout (struct watchdog_device) from user-space and how enable the watchdog1. This has to be evaluated how it should work.
6. Note that there is also an OMAP watchdog0:
[ 4.023269] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
which raises the question why it is not sufficient in an OMAP5 lockup situation. Maybe the lockup also stops the watchdog clock or the action that should be taken after timeout.
7. there would also be a bq24297 watchdog in the Pyra, but this is doing something else. It can not shut down power to the Palmas or OMAP5 after timeout but does a self-reset of the charger chip.
Hope this helps as a quick start.
Please let me know if someone can make use of it or finds additional patches so that we can integrate them into older kernel trees (4.19, 5.4, 5.9) as well.
BR, Nikolaus
- I do not know how to control the watchdog1 timeout (struct watchdog_device) from user-space
and how enable the watchdog1. This has to be evaluated how it should work.
additionally enabling CONFIG_WATCHDOG_SYSFS=y
show some more sysfs info:
root@letux:~# ls -l /sys/class/watchdog/watchdog1/ total 0 -r--r--r-- 1 root root 4096 Oct 31 12:20 bootstatus -r--r--r-- 1 root root 4096 Oct 31 12:20 dev lrwxrwxrwx 1 root root 0 Oct 31 12:20 device -> ../../../48070000.i2c:palmas@48:watchdog -r--r--r-- 1 root root 4096 Oct 31 12:20 identity -rw-r--r-- 1 root root 4096 Oct 31 12:20 nowayout drwxr-xr-x 2 root root 0 Oct 31 12:20 power -r--r--r-- 1 root root 4096 Oct 31 12:20 state -r--r--r-- 1 root root 4096 Oct 31 12:20 status lrwxrwxrwx 1 root root 0 Oct 31 12:20 subsystem -> ../../../../../../../../../../../../class/watchdog -r--r--r-- 1 root root 4096 Oct 31 12:20 timeout -rw-r--r-- 1 root root 4096 Oct 31 12:16 uevent root@letux:~# cat /sys/class/watchdog/watchdog1/state inactive root@letux:~# cat /sys/class/watchdog/watchdog1/status 0x0 root@letux:~# cat /sys/class/watchdog/watchdog1/timeout 30 root@letux:~# cat /sys/class/watchdog/watchdog1/nowayout 0 root@letux:~# cat /sys/class/watchdog/watchdog1/identity Palmas Watchdog root@letux:~# cat /sys/class/watchdog/watchdog1/bootstatus 0 root@letux:~# cat /sys/class/watchdog/watchdog1/uevent MAJOR=252 MINOR=1 DEVNAME=watchdog1 root@letux:~#
On Sa, 2020-10-31 at 12:42 +0100, H. Nikolaus Schaller wrote:
Hi,
Now after becoming awake, I start to remember some more details and I have hacked the Letux kernel code a little...
- the WDT was originally enabled by default in U-Boot
If I remember correctly our first experiments >5 years ago, this has the negative effect that after entering the u-boot console you just have 1 minute to type commands. So I think we have a patch in u-boot to disable it.
Okay that's not an issue IMHO, as no one needs to enter commands on U- Boot normally.
- the driver requires a "compatible" entry which is missing
I have added one to omap5-board-common.dtsi. See attached patch.
Thanks.
- I do not know how to control the watchdog1 timeout (struct
watchdog_device) from user-space and how enable the watchdog1. This has to be evaluated how it should work.
Okay, there should (hopefully) something about this in the datasheet.
- Note that there is also an OMAP watchdog0:
[ 4.023269] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec which raises the question why it is not sufficient in an OMAP5 lockup situation. Maybe the lockup also stops the watchdog clock or the action that should be taken after timeout.
I can imagine that the watchdog freezes as well if the OMAP5 locks up :)
Am 31.10.2020 um 20:03 schrieb Michael Mrozek EvilDragon@openpandora.org:
On Sa, 2020-10-31 at 12:42 +0100, H. Nikolaus Schaller wrote:
Hi,
Now after becoming awake, I start to remember some more details and I have hacked the Letux kernel code a little...
- the WDT was originally enabled by default in U-Boot If I remember correctly our first experiments >5 years ago, this
has the negative effect that after entering the u-boot console you just have 1 minute to type commands. So I think we have a patch in u-boot to disable it.
Okay that's not an issue IMHO, as no one needs to enter commands on U- Boot normally.
- the driver requires a "compatible" entry which is missing I have added one to omap5-board-common.dtsi. See attached patch.
Thanks.
- I do not know how to control the watchdog1 timeout (struct
watchdog_device) from user-space and how enable the watchdog1. This has to be evaluated how it should work.
Okay, there should (hopefully) something about this in the datasheet.
Well, not the data sheet, but the driver documentation...
- Note that there is also an OMAP watchdog0:
[ 4.023269] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec which raises the question why it is not sufficient in an OMAP5 lockup situation. Maybe the lockup also stops the watchdog clock or the action that should be taken after timeout.
I can imagine that the watchdog freezes as well if the OMAP5 locks up :)
-- Greetings,
Michael Mrozek
OpenPandora GmbH CEO: Michael Mrozek
Schäffbräustr. 11 85049 Ingolstadt Germany Tel.: +49 841 990 5548 http://www.openpandora.de/ HRB 4879, Amtsgericht Ingolstadt
eMail: mrozek@openpandora.org