Re: git: 427747fc16c9 - main - acpi_cpu: No longer disable idle during suspend

From: Adrian Chadd <adrian_at_freebsd.org>
Date: Thu, 12 Nov 2026 15:10:46 UTC
note - suspend/resume is now flakey on a couple of my laptops. I don't know
what combination of kern or drm-kmod changes have caused it.

please list out the set of hardware you're testing these changes on.


-adrian


On Wed, 11 Nov 2026 at 10:20, Adrian Chadd <adrian@freebsd.org> wrote:

> 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 <obiwac@freebsd.org> wrote:
>
>> The branch main has been updated by obiwac:
>>
>> URL:
>> https://cgit.FreeBSD.org/src/commit/?id=427747fc16c9be5e4d4eb31a797d7854c4fd839f
>>
>> commit 427747fc16c9be5e4d4eb31a797d7854c4fd839f
>> Author:     Aymeric Wibo <obiwac@FreeBSD.org>
>> AuthorDate: 2026-02-25 09:39:05 +0000
>> Commit:     Aymeric Wibo <obiwac@FreeBSD.org>
>> 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.
>>   */
>>
>>