https://bugs.kde.org/show_bug.cgi?id=528651

            Bug ID: 528651
           Summary: Lid close action retries endlessly every 10 to 20 s
                    when sleep or hibernate fails, draining the battery
    Classification: Plasma
           Product: plasmashell
      Version First 6.8.2
       Reported In:
          Platform: CachyOS
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Power management & brightness
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: 1.0

SUMMARY When "When laptop lid closed" is set to Hibernate (or Sleep) and the
attempt fails, PowerDevil starts it again roughly every 10 to 20 seconds for as
long as the lid stays closed. There is no limit and no notification, so a
closed laptop keeps working until the battery is empty.

logind sends PrepareForSleep(false) after a failed attempt too.
HandleButtonEvents::onResumeFromSuspend() then starts m_wakeupCheckTimer (10
s), and checkWakeup() calls processAction(m_lidAction) again because the lid is
still closed. The comment there assumes an unintended wakeup, but in this case
the system never slept.

STEPS TO REPRODUCE

Set "When laptop lid closed" to Hibernate.
Have something that makes hibernation fail. In my case that is bug 510992.
Close the lid and leave it closed.
OBSERVED RESULT A new attempt about every 18 seconds, each failing with "Device
or resource busy". Start times of the requests during one 5.5 minute test:

19:08:13 19:08:36 19:09:03 19:09:21 19:09:39 19:09:57 19:10:15 19:10:33
19:10:52
19:11:09 19:11:27 19:11:43 19:12:00 19:12:20 19:12:38 19:12:56 19:13:17
19:13:36
One night this ran 165 times between 22:18 and 01:12 with the laptop closed,
until it turned off at 01:13, presumably with an empty battery.

EXPECTED RESULT Don't retry blindly after a failed attempt. Either give up
after one or two retries and show a notification, or only re-trigger the lid
action when the system actually slept before.

SOFTWARE/OS VERSIONS Linux/KDE Plasma: CachyOS, kernel 7.3.3-1-cachyos KDE
Plasma Version: 6.8.2 Qt Version: 6.12.0 Graphics Platform: Wayland Hardware:
HP ENVY x360 13-ay0xxx (AMD Renoir), s2idle only

ADDITIONAL INFORMATION Related: bug 510992 (the reason hibernation fails here).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to