Solved Mainboard restarts by itself after FreeBSD shutdown

mtu

Active Member

Reaction score: 123
Messages: 168

I'm setting up a Shuttle SX79R5 Mini-PC as a FreeBSD server. I observe the following irritating behavior with FreeBSD 12.x and 13.0-RCx: After a shutdown of FreeBSD (ACPI-triggered, or by running shutdown -p now), the motherboard turns off for about 3 to 5 seconds, and then boots up again.

I've updated the BIOS/EFI to the latest available version and tweaked all sorts of settings, but the 'involuntary reboots' persist. Here's the thing, though: It didn't happen with either the original Windows installation or a Linux live system. Also, the power-off button works as expected when FreeBSD is not running (e.g. in the EFI interface, or in the bootloader).

So it would seem that this hardware phenomenon is somehow connected to the FreeBSD kernel. Is anyone familiar with such a behavior?
 

Zirias

Son of Beastie

Reaction score: 2,015
Messages: 3,336

It's probably still some strange behavior of this board – maybe have a look at sysctl -d hw.acpi? Interesting knobs might be:
Code:
hw.acpi.disable_on_reboot: Disable ACPI when rebooting/halting system
hw.acpi.power_button_state: Power button ACPI sleep state.
… and maybe others?
 

Trihexagonal

Son of Beastie

Reaction score: 2,497
Messages: 3,057

My W520 did that with Win10Pro when I was about to overwrite it with FreeBSD. It was like once the Ethernet cable was plugged in it wanted to come alive and phone home or something... Maybe because it took me that long to get it from one place to another.

I fixed that but it happened once again when I got FreeBSD 12.2-RELEASE-p4 installed. I have not seen the behavior repeated or on one of my other machines.
 
  • Thanks
Reactions: mtu

Snurg

Daemon

Reaction score: 598
Messages: 1,349

It's probably still some strange behavior of this board – maybe have a look at sysctl -d hw.acpi? Interesting knobs might be:
Code:
hw.acpi.disable_on_reboot: Disable ACPI when rebooting/halting system
hw.acpi.power_button_state: Power button ACPI sleep state.
… and maybe others?
Actually these sysctls are workarounds, to make things work even with the rudimentary and buggy ACPI support.
There are also some acpi verbose settings, and if you activate these you'll probably get interesting infos about the boards' AML only partially being understood.
 
OP
mtu

mtu

Active Member

Reaction score: 123
Messages: 168

In accordance with the Laws of Physics, the problem seems to have disappeared once the forum post was online …

I'll keep your tips bookmarked, in case it reappears.

The only thing I might have changed in the meantime was enabling a BIOS setting for—get this—EU regulation compliance about energy saving when powered off, which basically disables any wakeup-from-poweroff functionality. Maybe that was it? We may never know.
 

Jose

Daemon

Reaction score: 1,318
Messages: 1,537

In accordance with the Laws of Physics, the problem seems to have disappeared once the forum post was online …
I believe this effect is called the "technician field". Works with plumbers and appliance repair people as well.
 
OP
mtu

mtu

Active Member

Reaction score: 123
Messages: 168

Well, the problem has crept back up, and I'm happy to report that:
Hmmm, or this one (in FreeBSD 13)?
Code:
hw.efi.poweroff: If true, use EFI runtime services to power off in preference to ACPI
was the right guess :)

By default, it was enabled, and my shutdown/reboot problem was eliminated by disabling this property: sysctl hw.efi.poweroff=0. Adding
Code:
hw.efi.poweroff=0
to /etc/sysctl.conf fixes the problem for good. Thanks, everyone!
 

a6h

Daemon

Reaction score: 1,611
Messages: 1,430

I don't know about your box, but I had similar experience with two laptops in the past.
Shutdown was working quite well in Linux and Windows, but not in FreeBSD. 3~5 secs.
I can't remember, which peripheral was causing problem, but it was not Wake-on-LAN.

Do you have any peripheral, attached to your machine? You have to un-plug all of your
peripherals and cables. After that, you have to test your machine multiple times. Only if
it works fine, then add your peripherals and cables one by one, and test it several times.
 
OP
mtu

mtu

Active Member

Reaction score: 123
Messages: 168

I don't know about your box, but I had similar experience with two laptops in the past.
Shutdown was working quite well in Linux and Windows, but not in FreeBSD. 3~5 secs.
I can't remember, which peripheral was causing problem, but it was not Wake-on-LAN.

Do you have any peripheral, attached to your machine? You have to un-plug all of your
peripherals and cables. After that, you have to test your machine multiple times. Only if
it works fine, then add your peripherals and cables one by one, and test it several times.

In my case, the problem appeared even with practically nothing connected: no keyboard/mouse, no screen, no network, no hard drives. The only cable to the box was the power cable, the only device inside was a graphics card.
 

emmex

Member

Reaction score: 7
Messages: 40

Well, the problem has crept back up, and I'm happy to report that:

was the right guess :)

By default, it was enabled, and my shutdown/reboot problem was eliminated by disabling this property: sysctl hw.efi.poweroff=0. Adding
Code:
hw.efi.poweroff=0
to /etc/sysctl.conf fixes the problem for good. Thanks, everyone!
The Asus SABERTOOTH X79 motherboard, in EFI mode, doesn't power off. Solved with the above instructions.
Thanks.
 
  • Like
Reactions: mtu
Top