From nobody Thu Jan 8 13:23:38 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 4dn5Fp1yD5z6B40J; Thu, 08 Jan 2026 13:23:42 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dn5Fm6NpYz3GrS; Thu, 08 Jan 2026 13:23:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com Received: from skull.home.blih.net (mwc0868.ftth.cust.milkywan.net [45.13.107.196]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 8a033b5f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 8 Jan 2026 13:23:38 +0000 (UTC) Date: Thu, 8 Jan 2026 14:23:38 +0100 From: Emmanuel Vadot To: Aymeric Wibo Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: eeaa865edba6 - main - acpi: Fix setting sleep state sysctls to NONE Message-Id: <20260108142338.548865cf1cd31fb18d2b6a2a@bidouilliste.com> In-Reply-To: <20260108115959.4bc9493930ce880913058e5c@bidouilliste.com> References: <6929b55d.2b59a.8a970bd@gitrepo.freebsd.org> <20260108115959.4bc9493930ce880913058e5c@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd16.0) 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.09 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.99)[-0.993]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; ONCE_RECEIVED(0.20)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; FREEFALL_USER(0.00)[manu]; R_DKIM_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 4dn5Fm6NpYz3GrS 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. -- Emmanuel Vadot