From nobody Wed Nov 11 18:20:48 2026 X-Original-To: dev-commits-src-main@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 4jPsK85fNCz70Yqn for ; Wed, 11 Nov 2026 18:21:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 4jPsK76JvNz3KH9 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.169 as permitted sender) smtp.mailfrom=adrian.chadd@gmail.com Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-93e7ad9f78dso423389385a.1 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=RcIy6gVnxZqMUYqysljrbldD7HS2ulOq0wNYk5x/lZQYzAD6+pSDYRFb96CTwvhMIW 69sfhSOpFu5bZgnyFKcBuACI79QvLBsHAgvhbpPMq8GDIpSfWc4eE0MveZlfwMc+k5aY RSkcLsoFs3zrVOPO75UECF/rarlC5Y0QUMHOX22qWIP+NWKRGQxy56hIJ4lEz+pzsBzs jt+B33sd9H266/lLqBaaw2R0vM1Qm9M/tDyiijZ81Pca5tCYWnv0bEMk77Av4JHfldU1 UKrdAMW0i+3Xkqo9Rz6kJoIHUTnWzB+eflY3Pam0TR/R6+IvUHVk2fkbFZ/ne77Gi/GU /UEA== 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=fzJU+9Xils9ZagGufOlUfu9i30QTeglk0UG5dejQIGA=; b=b0xC57G4VsfYFXIief2OK/oIkCWp0p/tw2LqiHDqohreHpGCkbkADFvUDzFNbun5Yr lJ7oLNNNJPOV11wuLB0D5vymdMprr9zP2UFZLfoW2CTie0aXpkaqXkx/W6JIsWFYClcn RYqq5QIXooBWKOcezUlf2JpH1LwTWnoYH1zQwGRCBNPSG2nKqtBzhoYTeeBqkqy3a68A 8C5tZKgMHS/DFSpTjvhLBSCld9YykXHEfedXTEw3oFqhXHtsPZtglCZm0XFsE8TBnfqA dMokEBo2x588oBziKv1Jp9LRtxp6o7u/YGV6UJDoRASYw0d2To/iog2BB6ZlR4PBqs3z 1UkQ==; 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=2qC/e1D9DXoMmv8fNcL5adhNULM8voRl5iqoJvAsH/XcQAhAPVA3x0h/WpA68ww9G+ C3i0NsyTOnlEs89ivea8+JzrYH+TcRpOk+VfUNZjXCFR4VSQPAtTXn785EUbuLy9Moms 4G4z6mKBcGfB2An3Ao/K2zVIgOYVjzX8XNKeQdAtxrI8hcZBoWF0gfH0LoJfUTfzE81v sE7aeqS9/MLmlYAHu9FiDp9LDw4I+flx944JGAAGqfA9fD85TYI1IKiVg0xOk4OhCACo nF4QG3gCe8Wjv2P3Ugwwp1JUy5z0EC3bl6JcfgVjaIWyLv3d2TrxeUOrdN0tX9546lgc sSKQ== X-Forwarded-Encrypted: i=1; AL+hErGgqx6yYKZ1NsQ8zKKT2LeqM/OA1F6WhXyX9vT4oHShAi2k/lR5Uqp6cM/acePdPA9/zLjgSSR3V4Zho5h6NjbH6kjgtw==@freebsd.org X-Gm-Message-State: APuU4Z96pcXJYZO0IcLW2k/vJODgjn2oLkubvPFDuXC1u2T5z1f6UC8s 40wrCmfgdFiw7udVPawPH23wS9snXU54QblVZLCsfFrlkZrpLxaAXdUueaAwPQZ8K7Kqn6Imf1e 1YkQeu7TlRwKcB5qX++zwrGM1iUuj5SU= X-Gm-Gg: AYBFou2VZk6YVq0w39t7sLXFcCc5Sh4nZ29jcDBeBdg34aRVDyqCUrqFb4LnmfRWT8D cUq8s/52tIaqnjjlcVt5tI6Hyi0effFUkMpE0i72+K5WmPId7rGTvHcQMz69YPHxOFDsrGfMZTM vt5Z+vVmM97iNytIggvhp1NJX0GZCh66nlQ5RYiNoDkmBV/7P4e1EjqiFcmdVjir7eqRTsfGzjn t3Fzi+z0h2ZwMiQ4CRN/bogTJlg2xh1/gSNzrGrL8jdARsPTux5kyD4LaXHgdpdKgvuUHiETdJT PaVD+t+aKrZg0bTYKw/oihWXyEJn1l6HsEMoYfZyfn0vwZF1RCsJxOAoVIqA2MAMA1yxDVfk/kr 8D6JouiRyGyErZfD3TOYxRNPabo0ruMMLjM0RO4EMHwtymDuyEEqFlj6RpLRQJNaf0GzCnrth5D gSnwLBBX5T2GfZomCf2QXLpKv3fTM/zKeXx95KHe5BizAP8mmqTDwjbQE1Z+eY86C4mwpyiCxVE J/gZfhQHwq/ckNIa599nEn7HtU29y6TLAdptF4E40cZQpiPt+9POWRdN+iK/Xo= 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-main X-BeenThere: dev-commits-src-main@freebsd.org List-Id: Commit messages for the main branch 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: 4jPsK76JvNz3KH9 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.169: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.169:from]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@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-main@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--