fix(flab): wake on lid-open — drop S3 deep sleep for s2idle #673

Open
lytedev wants to merge 1 commit from flab-lid-wake into main
Owner

Problem

Opening the lid did not wake flab (Framework Laptop 12, 13th-gen Intel) from suspend — only the power button did.

Root cause

flab pinned suspend to S3 deep via boot.kernelParams = [ "mem_sleep_default=deep" ]. On the Framework 12 the EC/firmware emits no wake event on lid-open in deep sleep — the lid switch isn't a wake source in S3, so the OS never sees the event. Firmware-level; not fixable via /proc/acpi/wakeup or logind. Confirmed by another NixOS FW12 user with the identical symptom after switching s2idle → deep: https://community.frame.work/t/cannot-wake-from-deep-sleep-when-opening-the-lid/82637

Fix

Drop the deep override → flab uses s2idle, where lid-open is a wake source. The standby-battery reason for deep is already covered: flab runs the laptop module (two-in-onelyte.laptop) which does suspend-then-hibernate at 11m against the babyflip 8G resumeDevice swap. So lid-close → s2idle (instant lid-open wake) → hibernate after 11m for full battery savings. Only cost is the s2idle-vs-deep delta during the ≤11-min pre-hibernate window.

Verification — pending physical test

flab was suspended/unreachable during investigation (the very symptom), so this is not yet verified live. After deploy, on the machine:

  1. cat /sys/power/mem_sleep[s2idle] deep
  2. Close lid, reopen within 11 min → wakes without power button
  3. Leave >11 min → hibernates, resumes on power button

Tracked in issues/open/flab-lid-wake.md (move to closed once step 2 confirmed).

## Problem Opening the lid did not wake flab (Framework Laptop 12, 13th-gen Intel) from suspend — only the power button did. ## Root cause flab pinned suspend to S3 `deep` via `boot.kernelParams = [ "mem_sleep_default=deep" ]`. On the Framework 12 the EC/firmware emits **no wake event on lid-open in deep sleep** — the lid switch isn't a wake source in S3, so the OS never sees the event. Firmware-level; not fixable via `/proc/acpi/wakeup` or logind. Confirmed by another NixOS FW12 user with the identical symptom after switching s2idle → deep: https://community.frame.work/t/cannot-wake-from-deep-sleep-when-opening-the-lid/82637 ## Fix Drop the `deep` override → flab uses **s2idle**, where lid-open *is* a wake source. The standby-battery reason for `deep` is already covered: flab runs the laptop module (`two-in-one` → `lyte.laptop`) which does `suspend-then-hibernate` at 11m against the babyflip 8G `resumeDevice` swap. So lid-close → s2idle (instant lid-open wake) → hibernate after 11m for full battery savings. Only cost is the s2idle-vs-deep delta during the ≤11-min pre-hibernate window. ## Verification — pending physical test flab was suspended/unreachable during investigation (the very symptom), so this is **not yet verified live**. After deploy, on the machine: 1. `cat /sys/power/mem_sleep` → `[s2idle] deep` 2. Close lid, reopen within 11 min → wakes without power button 3. Leave >11 min → hibernates, resumes on power button Tracked in `issues/open/flab-lid-wake.md` (move to closed once step 2 confirmed).
fix(flab): wake on lid-open — drop S3 deep sleep for s2idle
All checks were successful
/ check-format (push) Successful in 7s
/ build (push) Successful in 9m50s
3400cf533e
The Framework 12 firmware emits no wake event on lid-open while in S3
"deep" sleep, so opening the lid never woke flab (power button only).
Drop the mem_sleep_default=deep override so suspend uses s2idle, where
lid-open is a wake source.

The standby-battery reason for deep is already covered: flab runs the
laptop module (two-in-one -> lyte.laptop), which does
suspend-then-hibernate at 11m against the babyflip 8G resumeDevice swap.
So lid-close -> s2idle (instant lid-open wake), then hibernate after 11m
for full battery savings.

Not yet verified live — flab was suspended/unreachable during
investigation. Needs a physical lid test after deploy; see
issues/open/flab-lid-wake.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGYVaV1bgVnMwN4rC5ggE8
All checks were successful
/ check-format (push) Successful in 7s
Required
Details
/ build (push) Successful in 9m50s
Required
Details
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin flab-lid-wake:flab-lid-wake
git switch flab-lid-wake
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lytedev/nix!673
No description provided.