https://bugs.kde.org/show_bug.cgi?id=527113
Bug ID: 527113
Summary: Idle-timeout fails to power off machine during
hibernate, works via command line
Classification: Plasma
Product: plasmashell
Version First 6.6.6
Reported In:
Platform: Kubuntu
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Power management & brightness
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: 1.0
# Idle-timeout hibernate aborts with "Wakeup pending" on HP Envy x360 (12th-gen
Intel), works via `systemctl hibernate`
## Summary
On an HP Envy x360 with a 12th-gen Intel Core i5, hibernate triggered by
powerdevil's idle timer aborts and returns to the login screen. Hibernate
started with `systemctl hibernate` or from the Leave menu works, resumes
correctly, and powers off fully.
Writing a counter to `/sys/power/wakeup_count` by hand reproduces the failure
from a terminal. A systemd-sleep hook that clears that counter before hibernate
fixes it. I believe powerdevil arms this check before requesting hibernate, and
the laptop's input and HID devices register wake events in that window.
## Environment
| Item | Value |
|---|---|
| Hardware | HP Envy x360, 12th-gen Intel Core i5 15-ew0xxx |
| OS | Kubuntu 26.04 LTS |
| KDE Plasma Version | 6.6.6, Wayland |
| KDE Frameworks Version | 6.24.0 |
| QT Version | 6.10.2 |
| Kernel | 7.0.0-38-generic |
| Swap | Partition, 19.5G (nvme0n1p4), referenced by UUID in fstab |
| Root filesystem | btrfs |
| Processors | 12 × 12th Gen Intel® Core™ i5-1235U |
| Memory | 16 GiB of RAM (15.3 GiB usable) |
| Resume | `resume=UUID=...` on the kernel command line and in
`/etc/initramfs-tools/conf.d/resume` |
| Sleep config | `HibernateMode=shutdown` in `/etc/systemd/sleep.conf.d/` |
The default `platform` hibernate mode left the machine powered on after the
image was written, which is why `shutdown` mode is set.
Extra kernel parameters (present before this problem):
```
atkbd.reset=1 i8042.nomux=1 i8042.reset=1 i8042.nopnp=1 i8042.dumbkbd=1
```
## Steps to reproduce
1. Set the KDE Energy Saving idle action to hibernate (1 minute).
2. Leave the machine idle.
## Actual result
The screen goes black and then SDDM appears. The system never hibernates and
the battery drains.
Kernel log with `/sys/power/pm_debug_messages` set to 1:
```
PM: hibernation: hibernation entry
PM: Wakeup pending, aborting suspend
PM: last active wakeup source: <varies>
PM: hibernation: hibernation exit
systemd-sleep: Failed to put system to sleep. System resumed again: Device or
resource busy
```
The named wake source differed between attempts:
- `mmc0` (Realtek RTS5288 card reader)
- `i2c-SYNA32CA:00` (touchpad)
- `serio0` (keyboard controller)
- `hid-0018:04F3:406E.0001-battery`
The abort happens on the first attempt, and an immediate retry from SDDM
succeeded. Hibernating from SDDM and from the idle timer both failed on the
first try.
## Expected result
The machine hibernates, as it does with `systemctl hibernate` or the Leave
menu.
## Findings
- Disabling each named source's wakeup one at a time only moved the abort to
the next source. The kernel reports the most recent active source, so this
didn't converge.
- The only file on the system that references `wakeup_count` is
`/usr/lib/x86_64-linux-gnu/qt6/plugins/powerdevil/action/powerdevil_suspendsessionaction.so`.
- Reproduction from a terminal:
```
sudo sh -c 'cat /sys/power/wakeup_count > /sys/power/wakeup_count'
```
Then touch the touchpad or keyboard, then run `systemctl hibernate`. This
produces the same abort. A second attempt then succeeds, since the kernel
clears the check after it fires.
- Screen dimming, screen-off and the lock screen made no difference.
## Workaround
`/usr/lib/systemd/system-sleep/hibernate-disarm.sh`:
```sh
#!/bin/sh
[ "$1" = pre ] && [ "$2" = hibernate ] || exit 0
echo 0 > /sys/power/wakeup_count 2>/dev/null
logger -t hibernate-disarm "cleared wakeup_count check before hibernate"
exit 0
```
The write of a mismatched value fails harmlessly and clears the armed check.
With the hook in place, idle-timer hibernate, the SDDM button and the terminal
command all hibernate, power off fully, and resume with running processes
intact.
## Caveat
That powerdevil arms `wakeup_count` is my inference from the file match and the
reproduction. I haven't traced the write. It may also be that this laptop's
firmware or drivers generate spurious wake events, and powerdevil's check only
exposes them. If so, a pointer to the right component would help.
## Request
Is powerdevil expected to arm `wakeup_count` before a hibernate request? If so,
can this be made tolerant of spurious events from devices like these, or can
arming be disabled for hibernate?
--
You are receiving this mail because:
You are watching all bug changes.