From nobody Wed Nov 11 18:20:48 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 4jPsK85f1lz70YwV for ; Wed, 11 Nov 2026 18:21:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jPsK76Js1z3K69 for ; Wed, 11 Nov 2026 18:20:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); arc=pass ("google.com:s=arc-20260327:i=1"); spf=pass (mx1.freebsd.org: domain of adrian.chadd@gmail.com designates 209.85.222.179 as permitted sender) smtp.mailfrom=adrian.chadd@gmail.com Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-93f20c3aaa5so301145885a.2 for ; Wed, 11 Nov 2026 10:20:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794421259; cv=none; d=google.com; s=arc-20260327; b=V5bZKmKJPVaMnbn9wNMQAKQtUgGSNsvbDCuIxiECo8agSTgImg3xcBdBVG3zH2l37p dKm4hVE69n2PIhg9p9mHniijAhX8qIuAhnWJJHwk8sIuqBiZqxnLzN3YpR6Fn3KSYZ/+ f2G7ak2amdg3tXde5qngnL+nF0XNpe1rIUL3PrxZlI9FWLymfqS8A+KKR3g91UOA1pFo 5AO9lYmzBGIUMgta6Op7C487XD3+80ZTve20U7F7kFu3V2ZCTLAxwKbOQVvfrM2TEXtJ cISQ3BiiSmyNU1NDucMZmZ5JmYZms39990DJjGroroBsMSiOQq79SO8JawZ0gJlcrW/b aHKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=oi7P0peIkH1SvJq62PH+DOGCEU1ih9qVG11R0Ud5Rxw=; fh=JyreF2psPTHuusr44yzXoNgDcrbFrKNL1t6elbfQ+RA=; b=anjRgJhFCfK3thh+edCrU6PSTUuftXgnojPdF3zRl4iXkPrzxt2sQCo1Sqh75AxdV8 xT5cMlZvascZOtTVo3Y8RntMReFYStZjiTWskfNMI517sqtv23l1lpf0yGwSWxblCVb1 EvRpRCTSXZMHdbNb1oDNMWFYmETsJe4JBJvMnyLNwZPTYoWO6bvd39vp0z+i8V7Lb6yb wyJ1nPstOEyW4cPFKFXZ2U3X6b0StxcWEwFXj3LxTl95YYmegdtavYSwXRevoZ+lY/MH kCT3IMfV35faimuGJU9uQw6sTZPZnlkOv0zwgmcmud3p0bfkjYriVyTRbuxXHBVl8xT/ +jZg==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794421259; x=1795026059; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=oi7P0peIkH1SvJq62PH+DOGCEU1ih9qVG11R0Ud5Rxw=; b=wSv46y8C3rNrNdfB3wMNfhE7mOzsdz4zUOjA4M+tgFyopCkLvO//s7MwMufCdo+vCw Lz9HpB4i1t3Y24TY3IfKMbPTgaZ+jbFO888Wt8o0aqYGFEtc4nC4BPDBgnBEp1EMv1j5 ugSl/Xk8xvBzNZpSPnbHltRl4bMTIBUZUe/fkaxFi73Qb/IwoCJ7j2gcHhk/P9JEbnPk yQhlbKzQdBjhG8jWWfgVWxTVzLMP7WrbT8u1e8cQRLdwfZhGUWvekaywinYGXGVDYxQ/ ix5V+EXX1+Qha5JTtAsq/WP2SLKfGXcvDXLfXdsfai6QjVxV3mlEsEBgqGf6vjOYGaLm cXnQ== X-Forwarded-Encrypted: i=1; AL+hErG+V8e6ct93WLCUkJDHEaMgjVSergCapoNPXmWIYiiz+PhFAxdHgh9ywxfbHm+++weMpX+++wNb2mWNSPDD2igIs/ps@freebsd.org X-Gm-Message-State: APuU4Z+9IOjs3rs5g1Z0LFXSzMVu22kub2BcecUv+20SE5s0mJlYqwZs OAaLDP0ZidkPSNGkG6KCvRTmJA//1+cFrFx5w6SN7eDu7ikiSAuiAMFrVmK3DFMCWu2BiznM0Ks uCUIySC6yCm9o1tv0hplJF9lUAfiHfFA= X-Gm-Gg: AYBFou3xwI1kqI64EmkLcJUMvN9QZyf1NH+jnvoFD5X6sosWbDxtmWPaK90uM0Qew4Q AaJ1Gbf7t7od6dScx8LMRRq9FheZLebplXlB4rTB/ZcyLtr6dVie3HyXozHH6tfsiq+8rlL5CnP gibmsVfqXEQCPmATusnHgw3+8i7IQXjNuyHPm2ElG92834dROFRt9e/rgGD+seu5rijOFViXG6L r/l9+vTCw916q93Q/o18Qu/xqDykCXqD8C0OjcxxbnfjltAtYSnzTnV5EruLJpzINQplYNk+Zgs DQoIJVrvok62fGHnoWLnyF1i8qV5Mu02YiRl1B+iqZADntmXnlvq8SXqkjjyG8eKkl8DfzQkGB3 k+ndvTbhOsuNsta5BZpRRP5qq6ONV1AAbFBuJi0klyEekwtzNU6D2iBDwvQbXBpbT/Fxn8xIV5S w/WjseET8A0hczNmcMINboO6rZyrieeGoMSDZnDyT4zRcS4mMTCX6uWGzeLX38Bst8Us4gIxGhb 4RIbXThKUtTi85TOvmFRcND27YSkZsy/KvRaIICmfvaQ+p7Lc+eDrqNH2RA3rI= X-Received: by 2002:a05:620a:2990:b0:93e:c12c:f13e with SMTP id af79cd13be357-947b00c36afmr549022285a.72.1794421258767; Wed, 11 Nov 2026 10:20:58 -0800 (PST) List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 References: <6af4409e.13ea8.25837c99@gitrepo.freebsd.org> In-Reply-To: <6af4409e.13ea8.25837c99@gitrepo.freebsd.org> From: Adrian Chadd Date: Wed, 11 Nov 2026 10:20:48 -0800 X-Gm-Features: AclHuK8PnlWe1bi2usY8Ubosbukt7wsBZzZ7psBd7--Cch7lH7kEuAjxAQvvXEU Message-ID: Subject: Re: git: 427747fc16c9 - main - acpi_cpu: No longer disable idle during suspend To: Aymeric Wibo Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000b4d3c806600441e5" X-Rspamd-Queue-Id: 4jPsK76Js1z3K69 X-Spamd-Bar: / X-Spamd-Result: default: False [-0.90 / 15.00]; ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1]; FORGED_SENDER(0.30)[adrian@freebsd.org,adrianchadd@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_IN_DNSWL_NONE(0.00)[209.85.222.179:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.179:from]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[adrian@freebsd.org,adrianchadd@gmail.com]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; ALIAS_RESOLVED(0.00)[]; RCPT_COUNT_THREE(0.00)[4] --000000000000b4d3c806600441e5 Content-Type: text/plain; charset="UTF-8" Hey err! I haven't tested this yet on my laptops (which all run ACPI.) Are y'all absolutely /sure/ that this can't possibly ever try to idle during suspend on ACPI platforms? And thus this was truly dead code? Would you mind listing out what hardware / config you're testing on when you do these changes? -adrian On Wed, 11 Nov 2026 at 02:17, Aymeric Wibo wrote: > The branch main has been updated by obiwac: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=427747fc16c9be5e4d4eb31a797d7854c4fd839f > > commit 427747fc16c9be5e4d4eb31a797d7854c4fd839f > Author: Aymeric Wibo > AuthorDate: 2026-02-25 09:39:05 +0000 > Commit: Aymeric Wibo > CommitDate: 2026-11-11 10:15:46 +0000 > > acpi_cpu: No longer disable idle during suspend > > This had been introduced in 3331373ce733 ("Disable CPU idle states > during suspend and reenable them during resume.") to work around > C-state > selection logic which would skip C-states which returned immediately, > considering them "broken". > > This workaround is incompatible with suspend-to-idle however, which > requires CPUs to be in their idle states, and is no longer relevant > either way since b0baaaaecf1a ("Avoid comparing negative signed to > positive unsignad values.") removed the C-state skipping logic the > previous change was working around. > > Reviewed by: olce > Sponsored by: The FreeBSD Foundation > Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/71 > Differential Revision: https://reviews.freebsd.org/D60649 > --- > sys/dev/acpica/acpi_cpu.c | 30 ++---------------------------- > 1 file changed, 2 insertions(+), 28 deletions(-) > > diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c > index d3ac92f920ab..9a523611a7f9 100644 > --- a/sys/dev/acpica/acpi_cpu.c > +++ b/sys/dev/acpica/acpi_cpu.c > @@ -159,8 +159,6 @@ ACPI_SERIAL_DECL(cpu, "ACPI CPU"); > > static int acpi_cpu_probe(device_t dev); > static int acpi_cpu_attach(device_t dev); > -static int acpi_cpu_suspend(device_t dev); > -static int acpi_cpu_resume(device_t dev); > static int acpi_pcpu_get_id(device_t dev, uint32_t acpi_id, > u_int *cpu_id); > static void acpi_cpu_madt_handler(ACPI_SUBTABLE_HEADER *entry, void > *arg); > @@ -199,8 +197,8 @@ static device_method_t acpi_cpu_methods[] = { > DEVMETHOD(device_attach, acpi_cpu_attach), > DEVMETHOD(device_detach, bus_generic_detach), > DEVMETHOD(device_shutdown, acpi_cpu_shutdown), > - DEVMETHOD(device_suspend, acpi_cpu_suspend), > - DEVMETHOD(device_resume, acpi_cpu_resume), > + DEVMETHOD(device_suspend, bus_generic_suspend), > + DEVMETHOD(device_resume, bus_generic_resume), > > /* Bus interface */ > DEVMETHOD(bus_add_child, acpi_cpu_add_child), > @@ -531,30 +529,6 @@ is_idle_disabled(struct acpi_cpu_softc *sc) > } > #endif > > -/* > - * Disable any entry to the idle function during suspend and re-enable it > - * during resume. > - */ > -static int > -acpi_cpu_suspend(device_t dev) > -{ > - int error; > - > - error = bus_generic_suspend(dev); > - if (error) > - return (error); > - disable_idle(device_get_softc(dev)); > - return (0); > -} > - > -static int > -acpi_cpu_resume(device_t dev) > -{ > - > - enable_idle(device_get_softc(dev)); > - return (bus_generic_resume(dev)); > -} > - > /* > * Find the processor associated with a given ACPI ID. > */ > > --000000000000b4d3c806600441e5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey err!

I haven't teste= d this=C2=A0yet=C2=A0on my laptops (which all run ACPI.)

Are y'all absolutely /sure/ that this can't possibly ever tr= y to idle during suspend on ACPI platforms?
And thus this was tru= ly dead code?

Would you mind listing out what hard= ware / config you're testing on when you do these changes?


-adrian


On Wed, 11 Nov 2026 at 02:17, Aymeric Wibo <obiwac@freebsd.org> wrote:
The branch main has been upda= ted by obiwac:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D427747fc16c9be5e4d4eb31a797d7854c4fd839f
commit 427747fc16c9be5e4d4eb31a797d7854c4fd839f
Author:=C2=A0 =C2=A0 =C2=A0Aymeric Wibo <obiwac@FreeBSD.org>
AuthorDate: 2026-02-25 09:39:05 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2026-11-11 10:15:46 +0000

=C2=A0 =C2=A0 acpi_cpu: No longer disable idle during suspend

=C2=A0 =C2=A0 This had been introduced in 3331373ce733 ("Disable CPU i= dle states
=C2=A0 =C2=A0 during suspend and reenable them during resume.") to wor= k around C-state
=C2=A0 =C2=A0 selection logic which would skip C-states which returned imme= diately,
=C2=A0 =C2=A0 considering them "broken".

=C2=A0 =C2=A0 This workaround is incompatible with suspend-to-idle however,= which
=C2=A0 =C2=A0 requires CPUs to be in their idle states, and is no longer re= levant
=C2=A0 =C2=A0 either way since b0baaaaecf1a ("Avoid comparing negative= signed to
=C2=A0 =C2=A0 positive unsignad values.") removed the C-state skipping= logic the
=C2=A0 =C2=A0 previous change was working around.

=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 olce
=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0The FreeBSD Foundation
=C2=A0 =C2=A0 Pull Request:=C2=A0 =C2=A0https://ron-= dev.freebsd.org/FreeBSD/src/pulls/71
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D60649
---
=C2=A0sys/dev/acpica/acpi_cpu.c | 30 ++----------------------------
=C2=A01 file changed, 2 insertions(+), 28 deletions(-)

diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index d3ac92f920ab..9a523611a7f9 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -159,8 +159,6 @@ ACPI_SERIAL_DECL(cpu, "ACPI CPU");

=C2=A0static int=C2=A0 =C2=A0 =C2=A0acpi_cpu_probe(device_t dev);
=C2=A0static int=C2=A0 =C2=A0 =C2=A0acpi_cpu_attach(device_t dev);
-static int=C2=A0 =C2=A0 =C2=A0acpi_cpu_suspend(device_t dev);
-static int=C2=A0 =C2=A0 =C2=A0acpi_cpu_resume(device_t dev);
=C2=A0static int=C2=A0 =C2=A0 =C2=A0acpi_pcpu_get_id(device_t dev, uint32_t= acpi_id,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 u_int= *cpu_id);
=C2=A0static void=C2=A0 =C2=A0 acpi_cpu_madt_handler(ACPI_SUBTABLE_HEADER *= entry, void *arg);
@@ -199,8 +197,8 @@ static device_method_t acpi_cpu_methods[] =3D {
=C2=A0 =C2=A0 =C2=A0DEVMETHOD(device_attach,=C2=A0 =C2=A0acpi_cpu_attach),<= br> =C2=A0 =C2=A0 =C2=A0DEVMETHOD(device_detach,=C2=A0 =C2=A0bus_generic_detach= ),
=C2=A0 =C2=A0 =C2=A0DEVMETHOD(device_shutdown, acpi_cpu_shutdown),
-=C2=A0 =C2=A0 DEVMETHOD(device_suspend,=C2=A0 acpi_cpu_suspend),
-=C2=A0 =C2=A0 DEVMETHOD(device_resume,=C2=A0 =C2=A0acpi_cpu_resume),
+=C2=A0 =C2=A0 DEVMETHOD(device_suspend,=C2=A0 bus_generic_suspend),
+=C2=A0 =C2=A0 DEVMETHOD(device_resume,=C2=A0 =C2=A0bus_generic_resume),
=C2=A0 =C2=A0 =C2=A0/* Bus interface */
=C2=A0 =C2=A0 =C2=A0DEVMETHOD(bus_add_child,=C2=A0 =C2=A0acpi_cpu_add_child= ),
@@ -531,30 +529,6 @@ is_idle_disabled(struct acpi_cpu_softc *sc)
=C2=A0}
=C2=A0#endif

-/*
- * Disable any entry to the idle function during suspend and re-enable it<= br> - * during resume.
- */
-static int
-acpi_cpu_suspend(device_t dev)
-{
-=C2=A0 =C2=A0 int error;
-
-=C2=A0 =C2=A0 error =3D bus_generic_suspend(dev);
-=C2=A0 =C2=A0 if (error)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return (error);
-=C2=A0 =C2=A0 disable_idle(device_get_softc(dev));
-=C2=A0 =C2=A0 return (0);
-}
-
-static int
-acpi_cpu_resume(device_t dev)
-{
-
-=C2=A0 =C2=A0 enable_idle(device_get_softc(dev));
-=C2=A0 =C2=A0 return (bus_generic_resume(dev));
-}
-
=C2=A0/*
=C2=A0 * Find the processor associated with a given ACPI ID.
=C2=A0 */

--000000000000b4d3c806600441e5--