12th Gen Linux deep sleep immediate wake

12th generation, kernel 5.18.17, Void Linux (i.e., no systemd).

Entering s2idle sleep appears to work fine.

$ cat /sys/power/mem_sleep
[s2idle] deep
$ echo mem | sudo tee /sys/power/state

The screen turns off and the power button backlight starts pulsing. Pressing the power button appears to resume the system fine. Dmesg shows that the system was asleep for ~15 seconds (969 - 984).

[  968.410435] PM: suspend entry (s2idle)
[  968.462331] Filesystems sync: 0.051 seconds
[  968.593256] Freezing user space processes ... (elapsed 0.001 seconds) done.
[  968.598503] OOM killer disabled.
[  968.601486] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[  968.615843] wlp166s0: deauthenticating from 68:d7:9a:33:3d:33 by local choice (Reason: 3=DEAUTH_LEAVING)
[  969.175482] ACPI: EC: interrupt blocked
[  984.268423] ACPI: EC: interrupt unblocked
[  984.452927] nvme nvme0: 16/0/0 default/read/poll queues
[  984.620982] i915 0000:00:02.0: [drm] GuC firmware i915/adlp_guc_69.0.3.bin version 69.0
[  984.620993] i915 0000:00:02.0: [drm] HuC firmware i915/tgl_huc_7.9.3.bin version 7.9
[  984.637470] i915 0000:00:02.0: [drm] HuC authenticated
[  984.638056] i915 0000:00:02.0: [drm] GuC submission enabled
[  984.638058] i915 0000:00:02.0: [drm] GuC SLPC enabled
[  984.638454] i915 0000:00:02.0: [drm] GuC RC: enabled
[  984.907436] OOM killer enabled.
[  984.911606] Restarting tasks ...
[  984.911772] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops __SCT__tp_func_render_mmio [i915])
[  984.912921] done.
[  984.917351] mei_pxp 0000:00:16.0-fbf6fcf1-96cf-4e2e-a6a6-1bab8cbe36b1: bound 0000:00:02.0 (ops __SCT__tp_func_render_mmio [i915])
[  984.938100] PM: suspend exit

Entering deep sleep appears to work fine.

$ cat /sys/power/mem_sleep
s2idle [deep]
$ echo mem | sudo tee /sys/power/state

The screen turns off and the power button backlight starts pulsing. However, pressing the power button now triggers a system shutdown as opposed to resume. This seems to indicate that either the system did not enter deep sleep or immediately resumed. I am able to capture dmesg by closing/opening the lid as opposed to trying to use the power button to resume.

[ 5248.870424] PM: suspend entry (deep)
[ 5248.893924] Filesystems sync: 0.023 seconds
[ 5249.030133] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 5249.035607] OOM killer disabled.
[ 5249.038897] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 5249.046029] wlp166s0: deauthenticating from f6:92:bf:9d:66:0e by local choice (Reason: 3=DEAUTH_LEAVING)
[ 5249.535150] ACPI: EC: interrupt blocked
[ 5249.571178] ACPI: PM: Preparing to enter system sleep state S3
[ 5249.578292] ACPI: EC: event blocked
[ 5249.578303] ACPI: EC: EC stopped
[ 5249.578307] ACPI: PM: Saving platform NVS memory
[ 5249.578981] Disabling non-boot CPUs ...
[ 5249.580695] smpboot: CPU 1 is now offline
[ 5249.587159] smpboot: CPU 2 is now offline
[ 5249.592271] smpboot: CPU 3 is now offline
[ 5249.594356] smpboot: CPU 4 is now offline
[ 5249.598610] smpboot: CPU 5 is now offline
[ 5249.600702] smpboot: CPU 6 is now offline
[ 5249.604868] smpboot: CPU 7 is now offline
[ 5249.606797] smpboot: CPU 8 is now offline
[ 5249.608712] smpboot: CPU 9 is now offline
[ 5249.610610] smpboot: CPU 10 is now offline
[ 5249.612525] smpboot: CPU 11 is now offline
[ 5249.614431] smpboot: CPU 12 is now offline
[ 5249.616072] smpboot: CPU 13 is now offline
[ 5249.617554] smpboot: CPU 14 is now offline
[ 5249.619055] smpboot: CPU 15 is now offline
[ 5249.629354] ACPI: PM: Low-level resume complete
[ 5249.629510] ACPI: EC: EC started
[ 5249.629511] ACPI: PM: Restoring platform NVS memory
[ 5249.631061] Enabling non-boot CPUs ...
[ 5249.631130] x86: Booting SMP configuration:
[ 5249.631132] smpboot: Booting Node 0 Processor 1 APIC 0x1
[ 5249.632855] CPU1 is up
[ 5249.632876] smpboot: Booting Node 0 Processor 2 APIC 0x8
[ 5249.638942] CPU2 is up
[ 5249.638962] smpboot: Booting Node 0 Processor 3 APIC 0x9
[ 5249.640737] CPU3 is up
[ 5249.640754] smpboot: Booting Node 0 Processor 4 APIC 0x10
[ 5249.647532] CPU4 is up
[ 5249.647579] smpboot: Booting Node 0 Processor 5 APIC 0x11
[ 5249.649327] CPU5 is up
[ 5249.649352] smpboot: Booting Node 0 Processor 6 APIC 0x18
[ 5249.657437] CPU6 is up
[ 5249.657497] smpboot: Booting Node 0 Processor 7 APIC 0x19
[ 5249.659312] CPU7 is up
[ 5249.659360] smpboot: Booting Node 0 Processor 8 APIC 0x20
[ 5249.665888] core: cpu_atom PMU driver: PEBS-via-PT
[ 5249.665894] ... version:                5
[ 5249.665895] ... bit width:              48
[ 5249.665896] ... generic registers:      6
[ 5249.665897] ... value mask:             0000ffffffffffff
[ 5249.665898] ... max period:             00007fffffffffff
[ 5249.665898] ... fixed-purpose events:   3
[ 5249.665899] ... event mask:             000000070000003f
[ 5249.666298] CPU8 is up
[ 5249.666329] smpboot: Booting Node 0 Processor 9 APIC 0x22
[ 5249.669669] CPU9 is up
[ 5249.669739] smpboot: Booting Node 0 Processor 10 APIC 0x24
[ 5249.673171] CPU10 is up
[ 5249.673243] smpboot: Booting Node 0 Processor 11 APIC 0x26
[ 5249.676588] CPU11 is up
[ 5249.676650] smpboot: Booting Node 0 Processor 12 APIC 0x28
[ 5249.684099] CPU12 is up
[ 5249.684145] smpboot: Booting Node 0 Processor 13 APIC 0x2a
[ 5249.687616] CPU13 is up
[ 5249.687683] smpboot: Booting Node 0 Processor 14 APIC 0x2c
[ 5249.691261] CPU14 is up
[ 5249.691287] smpboot: Booting Node 0 Processor 15 APIC 0x2e
[ 5249.694753] CPU15 is up
[ 5249.697948] ACPI: PM: Waking up from system sleep state S3
[ 5249.701946] ACPI: EC: interrupt unblocked
[ 5249.845202] ACPI: EC: event unblocked
[ 5249.853999] nvme nvme0: 16/0/0 default/read/poll queues
[ 5249.955412] i915 0000:00:02.0: [drm] GuC firmware i915/adlp_guc_69.0.3.bin version 69.0
[ 5249.955419] i915 0000:00:02.0: [drm] HuC firmware i915/tgl_huc_7.9.3.bin version 7.9
[ 5249.971950] i915 0000:00:02.0: [drm] HuC authenticated
[ 5249.972685] i915 0000:00:02.0: [drm] GuC submission enabled
[ 5249.972686] i915 0000:00:02.0: [drm] GuC SLPC enabled
[ 5249.973079] i915 0000:00:02.0: [drm] GuC RC: enabled
[ 5250.243288] OOM killer enabled.
[ 5250.245772] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops __SCT__tp_func_render_mmio [i915])
[ 5250.248414] Restarting tasks ... done.
[ 5250.254173] mei_pxp 0000:00:16.0-fbf6fcf1-96cf-4e2e-a6a6-1bab8cbe36b1: bound 0000:00:02.0 (ops __SCT__tp_func_render_mmio [i915])
[ 5250.260572] PM: suspend exit

Based on the dmesg output, it appears that the system immediately resumes after entering deep sleep.

dmidecode claims the Power Switch was responsible for the wake up.

$ sudo dmidecode | grep -i wake
	Wake-up Type: Power Switch

I diff-ed the content of /sys/kernel/debug/wakeup_sources before closing the lid and after opening the lid. The only changes were for PNP0C0D:00 (Lid Switch).

$ diff -u before.txt after.txt
--- before.txt	2022-08-18 15:02:31.209999568 -0700
+++ after.txt	2022-08-18 15:02:47.521999983 -0700
@@ -19,7 +19,7 @@
 PNP0C14:01  	0		0		0		0		0		0		0		0		0
 PNP0C14:00  	0		0		0		0		0		0		0		0		0
 PNP0C0A:00  	0		0		0		0		0		0		0		0		0
-PNP0C0D:00  	14		14		0		0		0		0		0		5643170		0
+PNP0C0D:00  	16		16		0		0		0		0		0		5759744		0
 INTC1055:00 	0		0		0		0		0		0		0		0		0
 INT33A1:00  	0		0		0		0		0		0		0		0		0
$ cat /sys/bus/acpi/devices/PNP0C0D\:00/input/input2/name
Lid Switch

I’ve tried disabling everything that is enabled according to /proc/acpi/wakeup but there is no change regarding the system immediately waking from deep sleep.

My next thoughts were to enable PM_DEBUG in the kernel to try to get more information regarding why the system is immediately waking from deep sleep.

Is anyone else experiencing immediate wake from deep sleep on 12th generation running Linux?

1 Like

I have the exact same issue on my 1260p, and disabling wakeup-devices in /proc/acpi/wakeup didn’t change anything for me either. I thought about a script which enforces the system to sleep a certain amount of time. @Bryan_Angelo Did you do any progress on this since?

I have not.

As previously mentioned, the system appears to either not actually enter S3 or to immediately wake from S3.

[ 5249.619055] smpboot: CPU 15 is now offline
[ 5249.629354] ACPI: PM: Low-level resume complete
[ 5249.629510] ACPI: EC: EC started

Based on Kernel/Reference/S3 - Ubuntu Wiki, I wondered if PM1A/B register blocks were not correct. Following the instructions:

$ grep PM1 facp.dsl
[038h 0056   4]     PM1A Event Block Address : 00001800
[03Ch 0060   4]     PM1B Event Block Address : 00000000
[040h 0064   4]   PM1A Control Block Address : 00001804
[044h 0068   4]   PM1B Control Block Address : 00000000
[058h 0088   1]       PM1 Event Block Length : 04
[059h 0089   1]     PM1 Control Block Length : 02
[094h 0148  12]             PM1A Event Block : [Generic Address Structure]
[0A0h 0160  12]             PM1B Event Block : [Generic Address Structure]
[0ACh 0172  12]           PM1A Control Block : [Generic Address Structure]
[0B8h 0184  12]           PM1B Control Block : [Generic Address Structure]

The offsets for PM1A blocks look correct based on the table from section 4.2 of the Platform Controller Hub datasheet https://cdrdv2.intel.com/v1/dl/getContent/680836. The base address is supposed to be BAR2 for PCI device 1f:2

The ACPI power management I/O registers are accessed based upon offsets from PM Base Address, BAR2, defined in PCI Device 31: Function 2.

I don’t find function 2 for device 31 in linux.

$ lspci -s 1f
00:1f.0 ISA bridge: Intel Corporation Alder Lake PCH eSPI Controller (rev 01)
00:1f.3 Audio device: Intel Corporation Alder Lake PCH-P High Definition Audio Controller (rev 01)
00:1f.4 SMBus: Intel Corporation Alder Lake PCH-P SMBus Host Controller (rev 01)
00:1f.5 Serial bus controller: Intel Corporation Alder Lake-P PCH SPI Controller (rev 01)

I looked at _PTS but am just not that familiar with AML or the framework EC.

My next thought was to try disabling various components in the BIOS and see if that had any effect.

I’m having the same issue on a 1260p, Nixos, Linux 6.1.2.

After some investigation, I’m confused about what I’m seeing. The behavior my system exhibits is the same as what @Bryan_Angelo describes. However, the system seems like it is in s2ram (screen, fans, etc are off) and not awake as dmesg suggests. I noticed that the time stamps in dmesg and journalctl are different after running:

 $ rtcwake -m mem -s 20

Journalctl shows:

Jan 13 17:55:36 x270 kernel: PM: suspend entry (deep)
Jan 13 17:55:36 x270 kernel: Filesystems sync: 0.000 seconds
Jan 13 17:55:58 x270 kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
Jan 13 17:55:58 x270 kernel: OOM killer disabled.
Jan 13 17:55:58 x270 kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
...
Jan 13 17:55:58 x270 kernel: ACPI: PM: Low-level resume complete
Jan 13 17:55:58 x270 kernel: ACPI: EC: EC started

Notice the 22 second jump in the log, as expected from sleeping for 20 seconds.

However, dmesg timestamps the entries differently, with only 1 second between entries. Making it appear as if the system is immediately leaving s2ram.

[  903.252062] PM: suspend entry (deep)
[  903.252135] Filesystems sync: 0.000 seconds
[  903.434918] Freezing user space processes ... (elapsed 0.001 seconds) done.
[  903.438735] OOM killer disabled.
[  903.440836] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.

...
[  904.639502] ACPI: PM: Low-level resume complete
[  904.639581] ACPI: EC: EC started

Does anyone know what explains this time difference and if there’s another way to test how long a machine is in s2ram?

Logs will generally be your best bet. Not a VOID users, so it’s where I would start. Also I’d strip away anything connected, test with no applications running, anything I could do to create a vanilla environment and then add things back slowly if the immediate wake up stops.