omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

ThinkPad X1 Carbon Gen 14: lid s2idle never wakes; hibernate reboots; lid-open leaves panel dark

Open heredia21 opened this issue 3 months ago • 4 comments

System details

Lenovo ThinkPad X1 Carbon Gen 14 (21V7CTO1WW), Intel Core Ultra 7 365 (Panther Lake), Intel Graphics, firmware N4OET49W (1.12), Omarchy 4.0.2-1, Hyprland 0.56.2, kernel 7.1.9-arch1-2. Sleep mode is s2idle only (/sys/power/mem_sleep is [s2idle]). Swap is a 30.8G btrfs swapfile (resume=/dev/mapper/root resume_offset=1915076) plus zram0 at priority 100.

What's wrong?

On this machine, stock lid-close sleep is not recoverable. Related reports (#10170, #9628, #9378, #9753) describe pieces of this, but not this model or the hibernate/zram reboot.

1. s2idle on lid close does not come back when the lid opens

  • Kernel: ACPI: button: The lid device is not compliant to SW_LID.
  • /proc/acpi/wakeup lists LID as S4 only. SLPB is S3. There is no S0/s2idle lid wake.
  • Closing the lid with no external display: logind logs Lid closed / Suspending... and PM: suspend entry (s2idle).
  • Opening the lid often produces no Lid opened / suspend exit. The machine stays dark until a long power hold (hard reboot).
  • When a resume does happen (one 6h sleep this morning), journald hit a watchdog on thaw (systemd-journald.service: Watchdog timeout) and the panel path is the same hole as #10170: lock screen blanks with omarchy-brightness-display off, and lid-open only runs omarchy-hyprland-monitor-clamshell, which never DPMS-enables eDP-1 when no external monitor is connected.

2. Hibernate is not a fallback — it reboots into a cold login

systemctl hibernate is allowed (CanHibernate=yes). After hibernate + lid open, the next boot is a full SDDM + user login, not a resume. Clear Stale Hibernate Storage Info skipped (HibernateLocation EFI var missing). zram0 is prio 100 vs the resume swapfile at prio 0, so hibernate can land on zram, which is gone after power-off.

3. Stock lid-open cannot light the panel even when the kernel did resume

Defaults:

o.bind("switch:on:Lid Switch", nil, "omarchy-system-lid-close", { locked = true })
o.bind("switch:off:Lid Switch", nil, "omarchy-hyprland-monitor-clamshell", { locked = true })

omarchy-system-wake (dpms/backlight on, then clamshell) is never used on lid-open. Same as #10170 / #9628. Power key is ignored (10-ignore-power-button.conf), so a dark-but-alive resume looks like a hang.

Steps

  1. X1 Carbon Gen 14, no HDMI/USB-C display.
  2. Close the lid (stock Omarchy: lock + logind HandleLidSwitch=suspend).
  3. Open the lid.
  4. Observe: no wake, or wake with a black panel, or (if hibernate was used) a cold boot.

Expected

Lid close locks and sleeps. Lid open resumes, lights eDP-1, shows the lock screen in the same session.

Journal excerpts

kernel: ACPI: button: The lid device is not compliant to SW_LID.
kernel: PM: suspend entry (s2idle)
# often no matching suspend exit until a forced power cycle

# on a successful thaw:
systemd[1]: systemd-journald.service: Watchdog timeout (limit 3min)!
systemd[1]: systemd-journald.service: Failed with result 'watchdog'.
kernel: PM: suspend exit

/proc/acpi/wakeup (relevant rows):

SLPB	  S3	*enabled   platform:PNP0C0E:00
LID	  S4	*enabled   platform:PNP0C0D:00

Suggested direction

  • Use omarchy-system-wake on switch:off:Lid Switch (superset of clamshell reconcile; fixes the dark-panel case in #10170).
  • Do not treat hibernate as available while zram outranks the resume swapfile; document or force hibernate onto the swapfile.
  • For s2idle-only + SW_LID-broken lids: do not rely on logind suspend-on-lid with no working wake source. Lock + DPMS off (and a real wake on lid-open) is safer than a bag full of s2idle that never returns.

Happy to attach omarchy-debug output or retest a patch.

heredia21 avatar Sep 04 '26 22:09 heredia21

Follow-up from the same X1 Carbon Gen 14 after leaving the lid closed overnight (local workaround: logind HandleLidSwitch=ignore, lock + DPMS only).

The machine stayed awake from lid-close 18:10 until 03:52 (expected drain: ~4 W, pack went from the 60s down to critical). Then UPower’s CriticalPowerAction=Auto requested suspend-then-hibernate:

systemd-logind: suspend-then-hibernate requested from client PID … ('upowerd')
PM: suspend entry (s2idle)

No suspend exit after that. Lid open stayed black; hard power was required. Next boot was dirty (ESP dirty bit, no HibernateLocation EFI var).

So even with lid-switch ignored, critical-battery Auto still enters the same unrecoverable s2idle. On this hardware Auto is not a safe last resort.

heredia21 avatar Sep 05 '26 09:09 heredia21

Have you tried checking out this PR https://github.com/omacom/omarchy/pull/9754

Does it resolve this issue?

bbishdotdev avatar Sep 06 '26 20:09 bbishdotdev

#9754 does not resolve this issue.

That PR is about omarchy-hw-laptop-closed trusting stale ACPI (#9753). Useful for clamshell and the PAM fingerprint lid-gate. On this X1 Carbon Gen 14, ACPI and logind LidClosed currently agree, and it does not change lid sleep/wake or the dark-panel path.

Update after more time on this machine

Stock lid-close sleep does wake here when we leave logind at HandleLidSwitch=suspend and do not add a lid poller. Example from this boot:

  • lid close 06:27 → s2idle → lid open 08:25 → suspend exit
  • lid close 12:05 → s2idle → lid open next day 05:17 → suspend exit

The earlier “never wakes / hard reset” reports were from local experiments (forced suspend-on-every-ACPI-poll, hibernate, then HandleLidSwitch=ignore so the box stayed awake until UPower CriticalPowerAction=Auto entered s2idle at ~2%). Those are not stock Omarchy lid-close.

What is still an Omarchy bug on this hardware

  1. Lid-open leaves eDP-1 dark when the kernel did resume (#10170 / #9628). Stock switch:off:Lid Switch is still omarchy-hyprland-monitor-clamshell, which does not DPMS-enable the internal panel with no external display. Locally we rebound that to omarchy-system-wake. That is the change we still want upstream.
  2. Hibernate is not a resume while zram0 (prio 100) outranks the swapfile (prio 0). systemctl hibernate comes back as a cold SDDM login. Lid-close does not hibernate; this only matters if something (or a user) calls hibernate.
  3. CriticalPowerAction=Auto → suspend-then-hibernate can still enter s2idle that does not return (seen when the lid-ignore workaround ran the pack down). Separate from #9754.

So: please do not close this as fixed by #9754. The remaining product fix is using omarchy-system-wake on lid-open (and not advertising hibernate while zram wins).

heredia21 avatar Sep 06 '26 20:09 heredia21

Reviewed against quattro at 10f1cbf7c, reading the source; nothing was run, since this needs your hardware. The second opinion was Codex at medium effort, which read the same code independently and contributed the timer finding below. Taking your follow-up as the current report:

1. Dark panel on lid-open: confirmed in source, and it is the same bug as #9628. Lid close locks (bin/omarchy-system-lid-close), and five seconds later the lock screen's idleBlankTimer runs omarchy-brightness-display off, which DPMS-disables the panel (shell/plugins/lock/Service.qml around line 732). On lid open, default/hypr/bindings/utilities.lua:36 runs only omarchy-hyprland-monitor-clamshell, whose enable_internal() dispatches DPMS enable only when it has just removed a clamshell flag, and an undocked lid close never writes one. Nothing else re-enables the panel until a keypress or mouse movement reaches the lock screen. Open PR #9637 makes the change you made locally: both lid-open binds run omarchy-system-wake. Codex noted one gap in it, which I checked: waking from a script bypasses the lock screen's runWake() (Service.qml:239), so the five-second blank timer is not re-armed and the lit lock screen can stay on until a key is pressed. That is a point for #9637 rather than a reason the panel stays dark.

2. Hibernate coming back as a cold boot: the zram explanation does not hold. systemd 262 skips zram devices when choosing where to write the hibernation image (Swap partition '%s' is a zram device, ignoring. in hibernate-util.c), and omarchy-hibernation-available already leaves zram out of its size check. So zram's priority of 100 does not send the image to zram, and the cause of the cold boot is not established. To diagnose it, these would help: whether hibernation was set up with omarchy hibernation setup, the output of cat /proc/cmdline and swapon --show, and journalctl -b -1 | grep -iE 'hibernat|PM:|resume' from the boot in which you hibernated.

3. CriticalPowerAction=Auto entering s2idle at 2%. Omarchy does not set UPower's critical action, so that is UPower's default. Since stock lid-close suspend wakes on this machine, the one non-returning suspend happened at critical battery, after your lid-ignore workaround. That is not established as an Omarchy defect.

I have not linked #9637 to close this issue, because merging it would close the hibernate report while that is still unexplained. Next: #9637 waits on the maintainer, and the hibernate part waits on the details above.

omarchybot avatar Oct 11 '26 05:10 omarchybot