[RESOLVED] Laptop suspending to s2idle every 30 seconds

My laptop has recently started suspending of its own accord every 30
seconds, interrupting whatever I’m doing. When I wake it from suspend,
it’s often the case that the built-in keyboard is not working (not sure
if this is related to the issue or if my suspend is just broken). Even
hitting Ctrl-Alt-F1 to access a tty does not work from the built-in
keyboard. USB keyboards still have full functionality. The issue occurs
even when no other USB devices are plugged in.

This seems to be happening every 30 seconds:

$ dmesg | grep s2idle | awk -F'[][]' '{ old=new; new=$2; printf "%s\t%s\n", (new - old), $0 }' | tail
30.5038	[ 2325.125366] PM: suspend entry (s2idle)
30.4834	[ 2355.608799] PM: suspend entry (s2idle)
30.4871	[ 2386.095855] PM: suspend entry (s2idle)
30.513	[ 2416.608899] PM: suspend entry (s2idle)
30.521	[ 2447.129892] PM: suspend entry (s2idle)
30.473	[ 2477.602917] PM: suspend entry (s2idle)
30.5386	[ 2508.141500] PM: suspend entry (s2idle)
30.4617	[ 2538.603204] PM: suspend entry (s2idle)
30.5431	[ 2569.146329] PM: suspend entry (s2idle)
30.484	[ 2599.630319] PM: suspend entry (s2idle)

The contents of dmesg when the suspend hits look like this:

[ 2446.788815] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 2446.792899] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 2446.795903] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 2446.799733] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 2446.801396] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 2446.808764] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 2446.810440] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 2446.816469] wlp170s0: deauthenticating from xx:xx:xx:xx:xx:xx by local choice (Reason: 3=DEAUTH_LEAVING)
[ 2447.129892] PM: suspend entry (s2idle)
[ 2447.134175] Filesystems sync: 0.004 seconds
[ 2447.252028] Freezing user space processes ... (elapsed 0.002 seconds) done.
[ 2447.254590] OOM killer disabled.
[ 2447.254592] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 2447.255868] printk: Suspending console(s) (use no_console_suspend to debug)
[ 2448.236146] ACPI: EC: interrupt blocked
[ 2448.320211] ACPI: EC: interrupt unblocked
[ 2449.275440] nvme nvme0: 8/0/0 default/read/poll queues
[ 2449.513744] OOM killer enabled.
[ 2449.513746] Restarting tasks ... 
[ 2449.514189] mei_hdcp 0000:00:16.0-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
[ 2449.516238] done.
[ 2449.518477] thermal thermal_zone6: failed to read out thermal zone (-61)
[ 2449.522468] PM: suspend exit
[ 2453.059548] wlp170s0: authenticate with xx:xx:xx:xx:xx:xx
[ 2453.078573] wlp170s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[ 2453.130037] wlp170s0: authenticated
[ 2453.131342] wlp170s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[ 2453.134887] wlp170s0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x1411 status=0 aid=4)
[ 2453.144839] iwlwifi 0000:aa:00.0: Got NSS = 4 - trimming to 2
[ 2453.156279] wlp170s0: associated
[ 2453.177333] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.177559] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.177777] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.177941] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.178306] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.178473] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.178631] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.179037] iwlwifi 0000:aa:00.0: Unhandled alg: 0x3f0707
[ 2453.252878] wlp170s0: Limiting TX power to 30 (30 - 0) dBm as advertised by xx:xx:xx:xx:xx:xx
[ 2453.252896] IPv6: ADDRCONF(NETDEV_CHANGE): wlp170s0: link becomes ready

This is an Intel 11th gen Framework laptop running Linux 5.15.0 on Mint
and XMonad. I haven’t installed any system or kernel updates recently.

Anyone have any thoughts as to what might be happening, how I can
mitigate it, or what extra information/diagnostics might be helpful?

Is this the same issue as here?

Edit: Also, are you running tlp? If yes, does it also happen when you disable tlp?

1 Like

Can you run:

cat /etc/systemd/logind.conf

then paste the results here?

This was helpful, thanks! I ran acpi_listen to diagnose and closed and
opened my laptop screen twice, and the log was

$ acpi_listen
button/lid LID open
button/lid LID close
button/lid LID open

which suggests that it did in fact think that the screen was closed to
begin with. This also seems to have stopped it from suspend-looping.

I’ll look into poking at Grub, but for now I think this is enough of a
lead/fix. Thank you!

For posterity, my logind.conf doesn’t have any non-comment lines:

/etc/systemd/logind.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

If this crops up again, it’s worth uncommenting:

HandleSuspendKey=suspend

Saving the file, rebooting.

If it happens again, looking at:

journalctl | grep "LID close"

or just grepping LID.

Then if it happens again, we can test the issue further by:

HandleSuspendKey=ignore

Save, reboot. Then see if the loop continues. Not a solution, rather, a means of diagnosing what is happening.

Do you have anything magnetic near the left side of the keyboard?

An excellent question! ^^

1 Like

This has been happening to Me since I bought the 11th Gen DIY machine. I have since upgraded to 12th gen in hopes it would go away (but it continues). When I’m docked with external monitor and the lid shut, these events do not occur. They seem to only happen when the lid is actually open.

Mine isn’t every 30 seconds but it is random. Sometimes while typing other times it seems like all I do is touch the side to move it.

$ acpi_listen
button/lid LID open
button/lid LID close
button/lid LID open

Every time it happens. No magnets near the sides or anything, just sitting on my lap in the middle of a couch. (no watches, jewelry, metal implants, etc). 4 USB-C modules & not charging.

To be clear, this has happened on two separate laptops, and acpi_listen shows similar results?

Which applications are running and does this happen when sitting in other locations? Extremely odd that it would affect both 11th and 12th with nothing else attached or nearby.

It is 1 laptop, a 11th Gen DIY i7 upgraded to a 12th Gen i7 motherboard and the issue has been around since I got the original 11th Gen laptop in Feb, 2022. I upgraded to the 12th Gen the day 12th Gen motherboards were released and also upgraded to the CNC Top Cover

The issue has happened sitting at the kitchen table (antique wood), couch, lap, coffee shop, work, in the car… I can’t think of a place that it doesn’t happen.

It happens on the Ubuntu installer boot cd (20.04 and 22.04), it happens in Windows 10/11 (I have no acpi logs for windows). It happened for the year I ran Manjaro (Feb 2022-Jan 2023), and it happened about 20 times this last weekend running Kubuntu 22.04.

Once the laptop is plugged in, it seems to stop getting these false lid closed acpi_listen messages.

I think this may be part of the issue. This is affecting two motherboards, multiple operating systems (including Windows and Linux) at multiple locations. Something with the hardware is clearly not correct.

Please open a ticket and link to this post. Let support know that something is likely triggering lid suspend mechanism.

I think this may have been it. I was keeping my laptop on top of its
soft-shell case, which has a metal zipper. And, intuitively, “magnet
tripping the lid sensor” feels very consistent with the symptoms that I
experienced.

Reminds me of decades ago thinking that I had broken the mic on my USB
headset, when actually it was just getting more noise due to ground loop
when the power adapter was plugged in.

Thanks, all! This feels resolved to me.

2 Likes