Bug 255250 - Restarting the laptop instead of shutting it down
Summary: Restarting the laptop instead of shutting it down
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2021-04-20 09:01 UTC by Roman
Modified: 2021-05-12 09:11 UTC (History)
1 user (show)

See Also:

Boot log (22.03 KB, text/plain)
2021-04-20 09:01 UTC, Roman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman 2021-04-20 09:01:57 UTC
Created attachment 224284 [details]
Boot log

When I turn off my laptop with the AC/DC adapter plugged in, it reboots instead of shutting down. But if I unplug the adapter, my laptop shuts down.

Some info:
% uname -a
FreeBSD vnflaptopmi.makmobile 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

Laptop: Xiaomi Mi Notebook Pro 15.6 with Intel Core i7-8550U CPU.
Comment 1 georg.lastname 2021-04-25 08:50:17 UTC
A couple of similar problems in the forums ("reboot instead of shutting down") recently were resolved by setting this sysctl:

hw.efi.poweroff: If true, use EFI runtime services to power off in preference to ACPI

Maybe try that?
Comment 2 Roman 2021-04-27 07:59:23 UTC
(In reply to georg.lastname from comment #1)
Many thanks! This solution did the trick.
However, I think this is strange. In 12.2 everything worked without problems. In 13.0 the problem appeared. But only if the laptop is connected to electricity. If you unplug the power cable and the powerd daemon manages to switch to economy mode, the laptop turns off normally.
Comment 3 georg.lastname 2021-04-30 20:22:28 UTC
This sysctl was introduced in FreeBSD 13.

On some laptops it solves the problem of reboots. On other laptops it causes reboots. Depending on how many ppl are affected, one might consider switching the default value of this boolean sysctl. :-)
Comment 4 Roman 2021-05-12 09:11:10 UTC
(In reply to georg.lastname from comment #3)
Got it. Thanks for the link and clarification. Then I think the bug can be closed.