From nobody Fri Jan 9 14:06:20 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dnk8Z1FBZz62Y0W; Fri, 09 Jan 2026 14:06:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dnk8Z0Sl2z3Wk7; Fri, 09 Jan 2026 14:06:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767967582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sdNGL4/LJkUoLFz1LLsRNKMUpEzVgY57MbRrcR4N5zw=; b=XqHpDqtD1kWf9WdjDfC5R6s6pgISobwMDp63NxSu4QDihFsvJZz5Rs7LZ/ghcGWLM4+w5I zOhB6JtInS8BhqXAt8O57tW4JlzyPUIVYuI40xDMjwc/Zoo3GO/1rrpegyw59DuL7QXH5/ yXMEKj2RxoeJNkjqDAZ6XOUWibDnodAzlBT6rWBMdUkl1rQofynKNMCmc64PuLChka6ouu EWJ1ZQh1HpBKbXf4yeWX64PdlNP1O+IOR42OETPFmN5tIZhNiXBmuBAkse9oCZUnsO/pzE 3/5b2p+MALSas72len2PPdcWH6zH0yCsf/V8GRAGeh9OyCUshgTO64YvRz3g3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767967582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sdNGL4/LJkUoLFz1LLsRNKMUpEzVgY57MbRrcR4N5zw=; b=Iom8YRM2eAusTRkFZbt2DQXR6i31P0Mx8oXX2SMa8rm3SSoMSS4yo3ds0y7akATQ+EqeXL +avUDXCL1apHXvatJpPKOEvYDZE17pz92BjyzXrgID3ysyXjCPpmuxFKXxBsfZkfMJEciU HLUS0gN06+pEH6+1UNkEFNBxkWBBqdw3TYmTLlyvSxj/DrudwIEn6hC9KlFrDKIEfjOoIP Jq8RFiwqhKom6A6QxhG2grw/n8dr7tNBXRve7A8tAp8dL7rynBWNx3QwLHP13DTHejdzdO zR8+mKOyfhm2XHmJxDHsn5AmSkVaXhBIbd2gbLpI714PKw0ys7QHp2uPAqF72w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767967582; a=rsa-sha256; cv=none; b=hV9BpnmqltDWJg1+LsTTsAepIODHOMO4RyZWslEVYrYm56p5gAW7QrpEcZan5MqpCb8zOb TZrzIgpI8+zhQukQmhquBb075BSyWJ9mIzpzq7YSrko40meN+NBiIqzkst5moZwsR3tJhK 0hRaN6+8+G0cyhqxUwWnnL+bHoX3Ba2Q/mQaQvitP8quaksH5WuzR/cTS4gSxEasTmq/3h 92WTm/Mefgf9u2YrcOf0PuE1k4hbxF8ybywW3S+rn8zgIU0uwAZWQkoXgCZebi11Oikwdc tw6lZjE0H5JsORUWRD65wTVYQeIy3MRCxV5mVNyLcL4vgTVSP4pXRGYKLf5I+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4202:5670:5495:3690:ffdd:8044] (unknown [IPv6:2601:5c0:4202:5670:5495:3690:ffdd:8044]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4dnk8Y5Lb9z2gb; Fri, 09 Jan 2026 14:06:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <89417c41-4c32-48c5-b049-5d1ca253eeb8@FreeBSD.org> Date: Fri, 9 Jan 2026 09:06:20 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: eeaa865edba6 - main - acpi: Fix setting sleep state sysctls to NONE Content-Language: en-US To: Emmanuel Vadot , Aymeric Wibo Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <6929b55d.2b59a.8a970bd@gitrepo.freebsd.org> <20260108115959.4bc9493930ce880913058e5c@bidouilliste.com> <20260108142338.548865cf1cd31fb18d2b6a2a@bidouilliste.com> From: John Baldwin In-Reply-To: <20260108142338.548865cf1cd31fb18d2b6a2a@bidouilliste.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/8/26 08:23, Emmanuel Vadot wrote: > On Thu, 8 Jan 2026 11:59:59 +0100 > Emmanuel Vadot wrote: > >> >> Hello, >> >> On Fri, 28 Nov 2025 14:44:45 +0000 >> Aymeric Wibo wrote: >> >>> The branch main has been updated by obiwac: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=eeaa865edba685545ac22c378b35552e09bf1b41 >>> >>> commit eeaa865edba685545ac22c378b35552e09bf1b41 >>> Author: Aymeric Wibo >>> AuthorDate: 2025-11-25 19:34:34 +0000 >>> Commit: Aymeric Wibo >>> 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(-) >>> >>> diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c >>> index e3ff4f6937d2..99dd817f9158 100644 >>> --- a/sys/dev/acpica/acpi.c >>> +++ b/sys/dev/acpica/acpi.c >>> @@ -4318,13 +4318,15 @@ acpi_sname_to_sstate(const char *sname) >>> { >>> int sstate; >>> >>> + if (strcasecmp(sname, "NONE") == 0) >>> + return (ACPI_STATE_UNKNOWN); >>> + >>> if (toupper(sname[0]) == 'S') { >>> sstate = sname[1] - '0'; >>> if (sstate >= ACPI_STATE_S0 && sstate <= ACPI_STATE_S5 && >>> sname[2] == '\0') >>> return (sstate); >>> - } else if (strcasecmp(sname, "NONE") == 0) >>> - return (ACPI_STATE_UNKNOWN); >>> + } >>> return (-1); >>> } >>> >>> @@ -4379,8 +4381,10 @@ acpi_suspend_state_sysctl(SYSCTL_HANDLER_ARGS) >>> if (new_sstate < 0) >>> return (EINVAL); >>> new_stype = acpi_sstate_to_stype(new_sstate); >>> - if (acpi_supported_stypes[new_stype] == false) >>> + if (new_sstate != ACPI_STATE_UNKNOWN && >>> + acpi_supported_stypes[new_stype] == false) >>> return (EOPNOTSUPP); >>> + >>> if (new_stype != old_stype) >>> power_suspend_stype = new_stype; >>> return (err); >>> @@ -4423,21 +4427,26 @@ acpi_stype_sysctl(SYSCTL_HANDLER_ARGS) >>> if (err != 0 || req->newptr == NULL) >>> return (err); >>> >>> - new_stype = power_name_to_stype(name); >>> - if (new_stype == POWER_STYPE_UNKNOWN) { >>> - sstate = acpi_sname_to_sstate(name); >>> - if (sstate < 0) >>> - return (EINVAL); >>> - printf("warning: this sysctl expects a sleep type, but an ACPI S-state has " >>> - "been passed to it. This functionality is deprecated; see acpi(4).\n"); >>> - if (sstate < ACPI_S_STATE_COUNT && >>> - !acpi_supported_sstates[sstate]) >>> + if (strcasecmp(name, "NONE") == 0) { >>> + new_stype = POWER_STYPE_UNKNOWN; >>> + } else { >>> + new_stype = power_name_to_stype(name); >>> + if (new_stype == POWER_STYPE_UNKNOWN) { >>> + sstate = acpi_sname_to_sstate(name); >>> + if (sstate < 0) >>> + return (EINVAL); >>> + printf("warning: this sysctl expects a sleep type, but an ACPI " >>> + "S-state has been passed to it. This functionality is " >>> + "deprecated; see acpi(4).\n"); >>> + MPASS(sstate < ACPI_S_STATE_COUNT); >>> + if (acpi_supported_sstates[sstate] == false) >>> + return (EOPNOTSUPP); >>> + new_stype = acpi_sstate_to_stype(sstate); >>> + } >>> + if (acpi_supported_stypes[new_stype] == false) >>> return (EOPNOTSUPP); >>> - new_stype = acpi_sstate_to_stype(sstate); >>> } >>> >>> - if (acpi_supported_stypes[new_stype] == false) >>> - return (EOPNOTSUPP); >>> if (new_stype != old_stype) >>> *(enum power_stype *)oidp->oid_arg1 = new_stype; >>> return (0); >>> >> >> Since this commit I have the warning printed as I have the >> hw.acpi.lid_switch_state set to 'S3' in sysctl.conf, the man page says >> it's correct. Changing it to 'standby' doesn't work as the value isn't >> recognized. >> What is the correct way for this sysctl now ? >> >> Cheers, > > Ok so the correct value is 's2mem' but this doesn't seems to be > documented anywhere in acpi(4) like the warning says. OTOH, it seems like if we are using traditional ACPI system states, we should still be able to call it what it is (S3). That is, for systems using actual S3 and not S0ix, setting these nodes to S3 should really continue to work IMO. -- John Baldwin