Bug 441579

Summary: Issue with hardware state checks after unsupending
Product: [Unmaintained] Powerdevil Reporter: rolltime <cknauth119>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.22.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description rolltime 2021-08-26 16:30:52 UTC
SUMMARY
I have a laptop running Arch KDE. After boot, everything is normal. Once I close and reopen the lid, however, and the system returns from suspend, this issue comes up.
 
When I plug in or unplug the laptop, KDE's battery applet takes more than a minute to recognize the change in state. Additionally, the laptop takes many minutes to sleep when the lid is closed. The laptop's charging indicator updates instantly, and running `cat /proc/acpi/button/lid/LID/state` while the lid is closed returns closed, so this is clearly not a hardware issue.
 
To me this seems related to how often KDE is checking hardware states. For some reason after returning from suspend hardware checks happen much less often. 

Sleeping when the lid is closed normally takes a moment, and sleep after the issue happens takes many minutes. Normally the battery applet updates almost instantly, but now it takes more than a minute. This indicates to me that there's some kind of multiplier, since each event is delayed based on how long it normally takes.


STEPS TO REPRODUCE
1. Have this configuration (this problem doesn't happen on my Kubuntu laptop) 
2. Suspend and unsuspend the machine.

OBSERVED RESULT
Laptop takes much more time to sleep when closed or check the battery state.

EXPECTED RESULT
Sleep when closed and battery state are instant/very fast.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.13.2
(available in About System)
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
None