Bug 480612 - Battery status is all messed up after wake from sleep
Summary: Battery status is all messed up after wake from sleep
Status: RESOLVED UPSTREAM
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.92.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-01-31 17:50 UTC by Gurenko Alex
Modified: 2024-02-05 13:30 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
example of the wake up behavior (1.24 MB, image/png)
2024-01-31 17:50 UTC, Gurenko Alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gurenko Alex 2024-01-31 17:50:09 UTC
SUMMARY
I have a Lenovo P1 gen.2 laptop where I'm testing Plasma 6 on bare metal. After waking from sleep things are going south: basically I'm able to reproduce one of two scenarios: 

- Battery shows 0% (Discharging) and immediately shows popup for going into suspend due to low battery
- Battery shows 10% (Discharging) and after a minute or so popup shows up with low battery warning

Luckily Plasma 6 shows a popup where you can cancel suspend. Needless to say that this is happening with power connected and battery being fully charged.


STEPS TO REPRODUCE
1. Put laptop to sleep
2. Wake up laptop

OBSERVED RESULT

See above. Battery reported as 0% or 10% and all power warning associated with low battery.

EXPECTED RESULT

Correct battery reading and according behavior


SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 40
KDE Plasma Version: 5.92.0
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Kernel Version: 6.8.0-0.rc2.19.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-9850H CPU @ 2.60GHz
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
Manufacturer: LENOVO
Product Name: 20QUS10L16
System Version: ThinkPad P1 Gen 2

ADDITIONAL INFORMATION

It might be coming from the kernel 6.8.0 that is still in development, but that's how this week's Fedora 40 testing going on.
I remember I used to have such behavior on plasma 5.xx long time ago and it went away and I have not seen any issues on this laptop for a long time.
Comment 1 Gurenko Alex 2024-01-31 17:50:36 UTC
Created attachment 165404 [details]
example of the wake up behavior
Comment 2 Gurenko Alex 2024-01-31 17:52:12 UTC
Just tried to wake up from battery power it jumped to interesting 33%, while prior to sleep it was around 68%.
Comment 3 Nate Graham 2024-02-01 20:40:45 UTC Comment hidden (spam)
Comment 4 Nate Graham 2024-02-01 20:41:35 UTC Comment hidden (spam)
Comment 5 Nicolas Fella 2024-02-01 21:15:20 UTC
Your screeshot shows that upower reports the same percentage as Plasma. Plasma gets its value from upower, so if that's wrong that's not a Plasma bug
Comment 6 Gurenko Alex 2024-02-05 13:30:14 UTC
Just to close the loop on this one, indeed after upgrade to kernel 6.8.0-0.rc3.26.fc40.x86_64 the issue is resolved (at least to a reported degree). Lockscreen shows now 100% charge upon wake, but after login the batter reports correct status right away.