SUMMARY This issue might be specific to Framework laptops. With lid close event set to hybrid sleep or sleep, the system will resume from sleep when AC power is connected during sleep, even while the lid is closed. The system will not go back to sleep. This is also an issue when it comes to charging with Framework laptops as the laptop will disconnect from AC power when hitting 100% and reconnect when the battery falls to around 98%. When this cycling happens, the system remains awake. STEPS TO REPRODUCE 1. With a Framework Laptop 13 (AMD 7040 Series in my case), close the lid of the device and confirm it went to sleep 2. Connect the system to AC power 3. Listen for the charging chime or peek at the screen OBSERVED RESULT The system fails to go back to sleep and remains awake, even after 30 minutes while the AC-DC cycling occurs on full charge. EXPECTED RESULT The system should go back to sleep by itself after handling the DC to AC event. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.27.9 KDE Frameworks Version: 5.111.0 Qt Version: 5.15.11 Kernel Version: 6.5.9-arch2-1 (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 7840U w/ Radeon 780M Graphics Memory: 30.5 GiB of RAM Graphics Processor: AMD Radeon Graphics Manufacturer: Framework Product Name: Laptop 13 (AMD Ryzen 7040Series) System Version: A7 ADDITIONAL INFORMATION The firmware behaviour of this laptop that can play a role in this issue has been confirmed intentional and expected behaviour by Framework : https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/31
If the firmware behavior is intentional on the part of the hardware, then I guess we'll need to handle these unusual conditions in our code. That's not ideal at all as it will then be broken for people not using Plasma. From that link, it looks like the system needs to wake up and then immediately go back to sleep again? Yuck. :)
(In reply to Nate Graham from comment #1) > If the firmware behavior is intentional on the part of the hardware, then I > guess we'll need to handle these unusual conditions in our code. That's not > ideal at all as it will then be broken for people not using Plasma. From > that link, it looks like the system needs to wake up and then immediately go > back to sleep again? Yuck. :) Yes, I agree. There's further discussion and there could be something in the firmware that causes Linux systems to just wake up and stay awake. Though waking up the system when it gets on AC is intended behaviour. The AC-DC cycling is not to worry about, I haven't seen it happen again recently, must have been a singled out oddity.
Does the wakeup also happen when you set it to sleep while plugged and then unplug it?
I just learned that my (non-Framework) Laptop also does this when plugging *in* the AC, but not when unplugging
(In reply to Natalie Clarius from comment #3) > Does the wakeup also happen when you set it to sleep while plugged and then > unplug it? Yes. It happens more often that it wakes up when unplugging from AC. And then it fails to go back to sleep, more often than not. I am having some odd sleep behaviours too. Sometimes, it will fail to sleep or hibernate when there has not been a change in AC-DC status.
(In reply to Jeremi Campagna from comment #5) > more often than not So sometimes it does go back to sleep? Immediately or after some period?
(In reply to Natalie Clarius from comment #6) > (In reply to Jeremi Campagna from comment #5) > > > more often than not > > So sometimes it does go back to sleep? Immediately or after some period? If it does, it seems to be immediate. It's not exactly reliable.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/279