Watchdog timeout APU2
-
Hi
I just want to ask how to setup pfSense CE 2.6 to periodically reset the watchdog on APU2. The watchdog which is set up in bios-setup.The documentation states it should be in the Miscellaneous Tab, but i can not find the watchdog option there.
-
That's where the option would be but it's only shown on hardware that has a device recognised as a watchdog timer. The APU2 watchdog doesn't appear to be. In the boot logs it would look something like:
superio0: <Nuvoton NCT6776> at port 0x2e-0x2f on isa0 wbwd0: <Nuvoton NCT6776 (0xc3/0x33) Watchdog Timer> at WDT ldn 0x08 on superio0
Steve
-
@stephenw10 So the APU2 watchdog is simply not suppported by pfSense 2.6.0?
-
I don't see it shown in the boot log on the one I have here. It may need an additional driver..
-
Hmm, well you can load the driver and it attaches with:
kldload amdsbwd
You then see logged:
Sep 6 05:12:46 kernel amdsbwd0: <AMD SB8xx/SB9xx/Axx Watchdog Timer> at iomem 0xfec000f0-0xfec000f3,0xfec000f4-0xfec000f7 on isa0
But you still can't enable it so I guess there's an additional step required.
-
@stephenw10 There is something here about enabling the Watchdog on an APU2.
-
Yes, you have to enable it there in order for it to actually reset the hardware but you want to have the OS side setup first otherwise it will just continually reboot!
-
Ah, OK, it looks like this is enabled only for hardware we know it works with and hence only in Plus:
function has_hw_watchdog() { $platform = system_identify_specific_platform(); switch ($platform['name']) { case '3100': case '5100': case 'RCC-VE': case 'SG-2220': case 'uFW': return (1); break; }
The APU is not one of them. Though it potentially could be....
Steve
-
The device I have is actually an APU1, what we (confusingly) sold as the APU2 and APU4 at the time when those models didn't exist!
When you you see shown from:
kenv -q smbios.system.product
The APU1 is no longer detected because that value has changed in newer BIOS versions. Though the APU2 should be.
Steve
-
Hmm, it appears there's no way to enable the hardware watchdog in the APU1 in Coreboot so I'm unable to test it there.
-
@stephenw10 I have an APU2 running pfSense and the
kenv -q smbios.system.product
command returns 'apu2', but isn't the point moot as the "has_hw_watchdog" function doesn't support APU[n]? -
Right but it's not hard to enable it if the watchdog hardware is actually detected when you load the driver.
I can do that here for an APU1 with a simple patch but since there seems to be no way to enable the watchdog in Coreboot I have no way to test it.
Steve
-
@stephenw10 i am willing to test it, have APU2 on bench now.
-
First run at the command line:
kldload amdsbwd
Make sure the system logs show the watchdog device present.
If it is then run:
echo 'amdsbwd_load="YES"' >> /boot/loader.conf.local
That will ensure it is loaded at boot every time.
To check that, reboot and then run:kldstat
You should see amdsbwd listed as loaded.Steve
-
@stephenw10 said in Watchdog timeout APU2:
First run at the command line: kldload amdsbwd
:kldload amdsbwd
kldload: can't load amdsbwd: No such file or directoryDo i need some additional packages?
-
@pki79 said in Watchdog timeout APU2:
kldload amdsbwd
kldload amdsbwd
worked on my APU2 and
kldstat
shows the driver as loaded.Steve, I'm guessing that the
has_hw_watchdog()
function you mention above is something run at boot time by pfSense to determine whether or not to load the (in the APU2 case) amdsbwd driver and that forcing it to be loaded with the
echo 'amdsbwd_load="YES"' >> /boot/loader.conf.local
command together with enabling the watchdog in the BIOS will make things work as expected? -
It also requires the watchdogd process to be started at boot to 'pat' the watchdog via the driver and prevent it triggering. The code does that if it's enabled in the config but of course you can't enable it unless there's a recognised device present. If you want to test it though you can just start it using a shellcmd or just run it at the command line.
Also it turns out that although there's no way to enable the watchdog in the APU1 from Coreboot you can still use it by enabling it from pfSense. I was just testing it wrong!
If you 'kill -9' the watchdogd process it will exit without disabling the watchdog and the firewall will reboot when the timer expires:Sep 8 01:01:20 kernel amdsbwd0: Previous Reset was caused by Watchdog
So on the APU2 if the driver is loaded you can run:
watchdogd -t 64
That enables the watchdog with a 64s timeout. If you then kill that process it exits and disables the watchdog so the firewall should not reset. If you kill -9 that process it should reset in ~60s.If you enable the watchdog in coreboot I recommend at least 180s to allow the system to boot and start the watchdogd process. If you're testing it manually I'd go with something a lot longer than that!
If that looks to be working as expected on the APU2 it should be trivial to enable it in Plus.
Steve
-
This works for me! Thank you. APU2C4 is running v4.17.0.3 Coreboot with the bios watchdog timer set to 300, amdsbwd loaded, and watchdogd -t 128. Kill -9 watchdogd process does indeed cause the system to reboot once the timer expires. Otherwise, the system stays up.