Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Admin message
The migration is almost done, at least the rest should happen in the background. There are still a few technical difference between the old cluster and the new ones, and they are summarized in this issue. Please pay attention to the TL:DR at the end of the comment.
s2idle works "as designed", but the inability to disable any wakeup sources means that it's unusable for me. In particular, if the screen presses down on the trackpoint (which happens fairly frequently with the lid closed), the machine will wake up from s2idle and will eventually overheat or run out of battery. This also applies to every other standard wakeup source -- plugging or unplugging power, pressing a key on the keyboard, opening the lid, doing certain not-yet-clear USB mouse actions, etc.
That said, using the acpi.ec_no_wakeup kernel parameter makes no difference. Disabling all of the lines in /proc/acpi/wakeups makes no difference. I had also previously tried the recommendation from #1951 (comment 1315151) and it made no difference.
My ideal behavior would be for the laptop to only wake up when pressing the power button, and maybe when opening the lid. None of the other wakeup sources are ever useful for me.
In particular, if the screen presses down on the trackpoint (which happens fairly frequently with the lid closed), the machine will wake up from s2idle and will eventually overheat or run out of battery.
This is a bit odd to me - it should wake up but eventually go back to sleep because the lid is closed and it stays idle a while, shouldn't it? Or do you have that turned off in your DE?
2023-02-10 08:04:25,865 DEBUG: WCN6855 version string: ath11k_pci 0000:02:00.0: fw_version 0x11090c35 fw_build_timestamp 2022-04-18 20:23 fw_build_id WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.92023-02-10 08:04:25,865 ERROR: ❌ WCN6855 WLAN may cause spurious wakeups (fw version 0x11090c35)
I think this might actually be playing into your problem. Can you please upgrade this firmware as advised by the script and see if you can reproduce it still?
Aaaaah, okay. Yeah, I tend to run my laptops with the lid closed at times, so I disabled suspend with the lid closed. /etc/systemd/logind.conf
My general approach is that I will intentionally instruct the laptop when to suspend, and I will intentionally bring it out of suspend.
Got it.
I think my broader confusion here is why disabling wakeup sources seems to be a no-op on my machine.
Well two things.
That bug with WCN6855 causes weird things to happen at wakeup. For example, normally unplugging the power adapter should cause the system to leave HW sleep, notify the kernel that it's not plugged in and kernel goes back to HW sleep. Because of that WCN6855 bug it wakes up fully. I strongly suspect this is the root cause of your problems.
You should be disabling wakeups from sysfs for individual devices. That will make the kernel not mark IRQs for wakeup. For example trackpoint you should disable in /sys/bus/serio/devices/serio1/power/wakeup.
Can you please repeat with secure boot turned off? There are some logging details that can be enabled from dynamic debugging that I want to see regarding what gpio wakes the system in your case.
2023-02-11 17:58:00,267 INFO: ○ Kernel suspended for total of 18.4540 seconds2023-02-11 17:58:00,267 INFO: ○ Suspend count: 12023-02-11 17:58:00,268 INFO: ○ Hardware sleep cycle count: 12023-02-11 17:58:00,268 INFO: ○ GPIOs active: ['0']2023-02-11 17:58:00,268 INFO: ○ Wakeups triggered from IRQs: [7, 9]2023-02-11 17:58:00,268 INFO: ○ Used Microsoft uPEP GUID in LPS0 _DSM2023-02-11 17:58:00,268 INFO: ○ Woke up from IRQ 7 (IR-IO-APIC 7-fasteoi pinctrl_amd)2023-02-11 17:58:00,268 INFO: ○ Spent 18.898193 seconds in a hardware sleep state
and in case /proc/interrupts shows any new data with lockdown disabled:
/proc/interrupts.txt
This was the second attempt this boot cycle. The first attempt woke up immediately, but I'm guessing I held down a key to long as the system was going into suspend (switched from sudo ../amd_s2idle.py --duration 60 to sleep 2; sudo ../amd_s2idle.py --duration 60 for the subsequent run, shown above) immediate wakeup s2idle_report.txt
So GPIO0, which is what Lenovo uses for notifying all ACPI related events like a power button, lid, or EC. You can see in the debug logs that _EVT case for 0x00 handles this. I suspect that it's going down the power button path. Can you run acpi_listen in another terminal while you reproduce? If you end up seeing a power button event I would say this looks like probably a BIOS bug that they're not handling this event properly.
If it's not a power button event we'll need to turn on some more verbose ACPI event layers to determine why this is happening and if this is a kernel bug or BIOS bug. Are you familiar with doing that?
In this case you woke up from GPIO 18, which is associated with GPP3 on your machine. The script doesn't currently capture what that's associated with (something I might improve in the script for the future). Do you know what that matches on your machine?
Okay, ran a couple more experiments. Sadly, it sounds like your hypothesis is confirmed that the Lenovo BIOS is sending keyboard and trackpoint wakeups as power-button events. I also had a few more instances of the unexpected wakeup (interestingly, I never see these unexpected wakeups when suspending the system via the "Suspend" button in the UI).
I tried some events without suspending, and here's what they looked like in acpi_listen: acpi_listen_events.txt
Now, the s2idle reports and (for some) matching acpi_listen logs for multiple suspend attempts:
I also had a few more instances of the unexpected wakeup
This one and other immediate wake ones are waking from GPIO 18, which means the WLAN controller. Maybe their state machine isn't doing well with the constant attempts at suspend cycles.
If it's a common problem you should be able to ignore it with this on your kernel command line: acpi_mask_gpe=0x0e gpiolib_acpi.ignore_interrupt=AMDI0030:00@18 But keep in mind this breaks WoWLAN if you rely upon that at all.
Sadly, it sounds like your hypothesis is confirmed that the Lenovo BIOS is sending keyboard and trackpoint wakeups as power-button events
So for one, I'm guessing this will need to turn into some kind of bug report to Lenovo. How does that work?
Second, to get me by in the meanwhile, I think I'd like to modify my kernel so that it only wakes up on lid-open events. Where would I look to start making that change? (I'm pretty familiar with compiling my own kernels and I know C, so mostly trying to understand what files I should be looking in)
So for one, I'm guessing this will need to turn into some kind of bug report to Lenovo. How does that work?
I think you'll want to notify them through their forums. Don't expect a fast process though. Changing the BIOS is a lot of work and the risk of regression is high.
Second, to get me by in the meanwhile, I think I'd like to modify my kernel so that it only wakes up on lid-open events. Where would I look to start making that change? (I'm pretty familiar with compiling my own kernels and I know C, so mostly trying to understand what files I should be looking in)
It might be easier to go the patched DSDT/SSDT. You can remove Notify() from _AEI events based on the criteria that you deem necessary.
@xsdg - apologies if I've missed it - but which platform is this on? If it's on one of our Linux certified ones I'd like to reproduce it and can flag it to the FW team.
I seem to be having the same issue with my AMD 6850U-based T16 ThinkPad. (21CH000JUS)
I can reliably get it to wake from sleep by closing the lid and gently pressing about where the TrackPoint is, or by plugging in USB devices. Sometimes it just seems to wake up on it's own, though I didn't manage to catch it with amd_s2idle.py after a couple days.
Here are some amd_s2idle.py logs:
lid-pressed.txt - Closed and pressed the lid above the trackpoint.
plug-in.txt - Left the lid open and plugged in the power adapter.
1h-success.txt - Set the wakealarm to 1 hour and didn't touch it until it woke itself up.