Bug 290651 - Cannot set hw.acpi.lid_switch_state to NONE
Summary: Cannot set hw.acpi.lid_switch_state to NONE
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Aymeric Wibo
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-10-29 11:04 UTC by Keith White
Modified: 2025-11-28 14:48 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keith White 2025-10-29 11:04:32 UTC
Some time in the last few months I can no longer set the lid switch to NONE on CURRENT.

# sysctl hw.acpi.lid_switch_state=NONE
hw.acpi.lid_switch_state: s2mem
sysctl: hw.acpi.lid_switch_state=NONE: value is not available

# uname -ap
FreeBSD dell7390 16.0-CURRENT FreeBSD 16.0-CURRENT #6 main-n281431-5a739b74650b: Sun Oct 26 12:39:54 EDT 2025     root@dell7390:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 amd64
Comment 1 Tom Jones freebsd_committer freebsd_triage 2025-11-24 08:36:33 UTC
I looked at this during the bug squash call on Friday and it looks to be a regression with how state names are handled. I'm not sure how Aymeric wants to handle this and I've assigned it to him
Comment 2 Aymeric Wibo freebsd_committer freebsd_triage 2025-11-25 21:23:06 UTC
Sorry for taking so long to fix this!

https://reviews.freebsd.org/D53909
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-11-28 14:45:07 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=eeaa865edba685545ac22c378b35552e09bf1b41

commit eeaa865edba685545ac22c378b35552e09bf1b41
Author:     Aymeric Wibo <obiwac@FreeBSD.org>
AuthorDate: 2025-11-25 19:34:34 +0000
Commit:     Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2025-11-28 14:42:54 +0000

    acpi: Fix setting sleep state sysctls to NONE

    This restores the functionality as it was pre-97d152698f48.

    A stopgap was committed by glebius@ in 34dfccc64f47 ("acpi: in
    acpi_stype_sysctl() use same logic as in acpi_sleep_state_sysctl()").

    PR:             290651
    Reviewed by:    thj, emaste
    Approved by:    thj
    Fixes:  97d152698f48 ("acpi: Use sleep types defined in sys/power.h")
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D53909

 sys/dev/acpica/acpi.c | 39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)