Skip to content

omamobile-modem 0.1.26, omamobile-modem-sit 0.3.40, device-cheetah 0.1.57, omamobile-shell 0.2.131: sleep with the modem up on by default on the 7 Pro (carries #555 and #556) - #791

Merged
derekross merged 14 commits into
mainfrom
modem-sleep-default
Nov 15, 2026
Merged

derekross merged 14 commits into
mainfrom
modem-sleep-default

Conversation

@derekross

Copy link
Copy Markdown
Owner

What

Sleep with the modem up, on by default on the Pixel 7 Pro, as the maintainer approved on 2026-11-14 ("approve modem sleep by default on the 7 Pro"). This carries two contributor pull requests with their authorship kept, and adds the default, a kernel guard and an owner's opt-out on top.

The kernel guard

linux-omarchy-mobile#232 (da171eae4cb7, on github/omamobile) adds no sysfs attribute or module parameter. Development releases (push1-g<sha>) don't sort by version, so the policy can't compare releases. Instead it reads the running kernel's own pcie-gs201-cp module file. It finds the file with modinfo -k $(uname -r) -n pcie_gs201_cp, which works before the start script loads the module, and accepts .ko, .zst, .xz or .gz. It looks for either of two strings:

  • the notifier's log line, sleep refused before the freeze;
  • its function name, gs201_pcie_cp_pm_notify. The modules are installed with INSTALL_MOD_STRIP=1, which strips debug information only, so the symbol table stays.

I checked this offline:

Module Log line Symbol
kernel-2026.11.13 (7.3.0-rc6-omamobile-g36d61a33795b, the prebuilt modules.tar.zst) absent absent
out-m6fix and out-m6test builds present present
out-m6fix build after llvm-strip --strip-debug present present

A phone that takes these packages before kernel-2026.11.15, or boots an older slot B image, keeps the inhibitor and logs why.

AGENTS.md

§4 "Suspend and modem", the first entry. Old opening:

  • Suspend with the modem on has never run on the 7 Pro, and is unqualified on the 9a: its one try (2026-10-27) also had NFC polling, …

New opening:

  • Suspend with the modem up is on by default on the 7 Pro, and unqualified on the 9a. On the Pixel 7 Pro with a kernel carrying linux-omarchy-mobile#232 (kernel-2026.11.15 and later), omamobile-modem 0.1.26 and device-cheetah 0.1.57, the modem's sleep inhibitor is skipped and the phone sleeps with the modem up (verified on 2026-11-14: sleeps, refusals with data busy, a text and a call waking the phone). On an older kernel omamobile-modem-sleep-policy keeps the inhibitor, and the owner opts out with /etc/omamobile/modem-suspend-disable. On every other phone the rest of this entry stands unchanged. The 9a's one try (2026-10-27) also had NFC polling, …

In the same entry, old:

… except an attended test on the charger that ends in a reboot; on the 7 Pro that test is the maintainer's. CPIF's PM paths are wake-armed in code, but M6 is design only. …

New:

… except an attended test on the charger that ends in a reboot; on a 7 Pro whose inhibitor holds (an older kernel, the owner's opt-out) that test is the maintainer's. CPIF's PM paths are wake-armed in code; M6 has passed on the 7 Pro only. …

The entry's links gain "and 7.5" after MODEM-PLAN 6.3.

In the "Never systemctl restart omamobile-modem" entry, old:

… it also holds a sleep inhibitor until the reboot.

New:

… it also holds a sleep inhibitor until the reboot, except where sleep with the modem up is on (the entry above).

Nothing in §1 or §2 says that the modem's inhibitor can't be passed, so neither changes. The 9a's entries are untouched.

Docs

Tests

Suite Result
packages/omamobile-modem/test/all 34 ok
packages/omamobile-modem/test/test_link.py 28 tests
packages/omamobile-modem-sit/test/all pass, including the unit tests against sit-sim
packages/omamobile-device-cheetah/test/all 17 ok
packages/omamobile-shell/test/all 324 ok
tests/all 707 ok, rc 0
tools/pr-check origin/main pass

The new tests cover:

  • The policy, run for every combination: no declaration; the enable file alone (reported as ignored); the runbook marker alone; the old pair; the declaration with a omamobile-omarchy 0.1.23: no launch toast for a desktop entry that runs omarchy-shell #232 kernel; a symbol-only module; an old kernel; no module; an unreadable module; the opt-out (it also wins over the old pair); a zstd-compressed module; modinfo finding nothing; a usage error.
  • The start script with the policy: loads without waiting when the policy says yes; refuses on an old kernel, with the opt-out, and with the policy missing; with the lock, loads as before.
  • The unit: ExecCondition is its only sleep decision.
  • The device package: the declaration is staged as a plain, comment-only file, and the old marker is gone.
  • The drop-in: follow_screen = yes and nothing else in [control].
  • sitd: a device may turn follow_screen on but not set group; the owner's no wins.

Mutation checks: making the policy ignore the kernel guard fails the old-kernel tests, and making it ignore the opt-out fails the opt-out tests. I checked offline that a unit skipped by ExecCondition doesn't fail the units that Requires= it, using user units on systemd 262.

The phone check after Updates

The maintainer runs this attended, on the charger, once kernel-2026.11.15 and these packages are released:

  1. uname -r is the release.
  2. /usr/lib/omamobile-vendor/omamobile-modem-sleep-policy check says "may sleep with the modem up".
  3. systemctl show -p ConditionResult,Result omamobile-modem-inhibit reads ConditionResult=no and Result=exec-condition.
  4. systemd-inhibit --list has no omamobile-modem line.
  5. The modem comes up and registers.
  6. journalctl -b -u omamobile-sitd | grep 'Screen off told' shows the line after the panel goes dark.
  7. M6.4: 20 sleeps through auto-sleep, with the modem registered, a ping over rmnet after each, and no UFS line.
  8. M6.5: a day of use.

After that, the DEVICES Suspend cell moves to "works". The opt-out should also be checked once: touch /etc/omamobile/modem-suspend-disable, reboot, and the inhibitor is held.

Nothing here has run on a phone.

🤖 Generated with Claude Code

ikegam and others added 13 commits November 14, 2026 20:22
… off from the Mobile network page

On the Pixel 7 Pro the modem stack starts at boot through device-cheetah's
vendor wants link, so keeping it off meant `systemctl mask
omamobile-modem-boot.target` over SSH. A phone whose modem drivers have
loaded never sleeps (omamobile-modem-inhibit holds until the reboot) and
runs warm, so the owner needs that switch on the phone.

omamobile-modem-switch (pkexec, org.omamobile.modem.switch, the active
local user without a password) masks the target for "off" and stops
nothing in this boot: a stopped modem can't start again before a reboot,
the sleep inhibitor stays anyway, and every modem power-off costs a UFS
error-handler pass (MODEM-PLAN M2.6). "on" unmasks it and starts the stack
only when this boot's modem never started. Its status reads without root;
props.conf sits in a root-only folder, which counts as provisioned there.

The switch exists only where the target is wanted at boot
(`systemctl show -p WantedBy`, which sees vendor and /etc links) or
masked. On the 9a, with its own modem start, and the 6 Pro, nothing wants
it: status says "available": false, the page hides the switch, and "on"
and "off" refuse, so the shell never starts a modem outside that phone's
own starter.

The Mobile network page shows the switch in its ready and off states,
says when the change takes effect at the next restart, says the phone
can't sleep only while the modem's sleep block is held (a start refused
before any driver releases it), and offers "Restart now".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 7 Pro test of #555

Found on the reference phone on 2026-11-13, testing #555's modem switch:

- With the modem switched off for the boot, the only way to the page that
  turns it back on (the Mobile data tile's chevron) was hidden, and once
  shown it was greyed out with the tile. tile-state.sh now reports
  data_switch=off from omamobile-modem-switch, the tile says Modem off and
  keeps a working chevron (only in that case).
- Right after switching it on, the page said the modem service isn't
  running and starts once the modem is set up; it now says it is starting
  until the phone service reports.
- The heading was centred on the glyph and clipped when taller than it.
- The page had no back arrow; it now has one, as the Wi-Fi and Bluetooth
  pages do, and Escape goes back to quick settings too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h [control] follow_screen

The screen-state request (SET_SCREEN_STATE, then SET_IND_CMD_FILTER) was
in the service but never sent, so the modem reported as for a lit screen
all the time; each report wakes the AP and the link. With follow_screen =
yes (off by default) sitd follows the panel's bl_power, never "off" during
a call, and a systemd-sleep hook asks for "off" before a sleep. Without it
sitd sends nothing new and the hook answers "not told".

On a second 7 Pro (mine; LTE, idle): 47 indications in 60 s with the screen on, none
with it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only on the Pixel 7 Pro

/etc/omamobile/modem-suspend-enable lifts the modem's sleep inhibitor
for MODEM-PLAN M6, but only beside /usr/lib/omamobile-modem/suspend-runbook,
a comment-only marker that only device-cheetah ships. The inhibitor unit
is skipped only when both exist; the start script follows the same two
files and says when the enable file is ignored. Without both, nothing
changes. The link tests no longer read the machine's own enable file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan, the runbook and the results so far, on a second Pixel 7 Pro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r a system sleep

With the modem up and Wi-Fi connected, a system sleep was refused every time on the Pixel 9a: NetworkManager takes Wi-Fi down at logind's announcement, the bearer's metric-700 default route is then the only one, whatever was talking over Wi-Fi sends through the bearer at once, and the modem's link is up when the kernel looks (linux-omarchy-mobile#232's sleep guard).

omamobile-sit-data now listens for logind's PrepareForSleep (a busctl monitor, no new dependency) and takes its default route away when a sleep is announced; the bearer's address stays. After the sleep the route waits for another default route to be back, or ten seconds without one: put back at once it carried a few seconds of traffic at every wake, and the answers ended the next sleeps early. A route that wasn't there (a silent bearer, roaming) is not brought back, and without busctl nothing changes.
…radio_on on this phone

Asked in #701's review: the plan says which boots each count covers, and
the two journal lines from a boot of the merged option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgnCmDwY8r4r1jCa2SVYLN
…rnel guard and an owner's opt-out

Whether the phone may sleep with the modem up was two path conditions on
omamobile-modem-inhibit.service and the same two files in the start
script. It is now one script, omamobile-modem-sleep-policy, that both ask:
the unit through ExecCondition= (inhibit: exit 0 holds the lock, 1 skips
it) and the start script through check. Yes needs all of:

- the device package's declaration, /usr/lib/omamobile-modem/suspend-verified
  (device-cheetah only, after MODEM-PLAN M6 passed on the reference 7 Pro
  on 2026-11-14), or the attended runbook's pair from before (the owner's
  modem-suspend-enable beside a device's suspend-runbook);
- no /etc/omamobile/modem-suspend-disable, the owner's opt-out;
- a running kernel whose modem link refuses a sleep early, from a
  PM_SUSPEND_PREPARE notifier, while the link is up
  (linux-omarchy-mobile#232, da171eae4cb7). Without it a sleep with the
  link up is refused only at noirq, and a run of those left mobile data
  dead until a reboot on 2026-11-13. The kernel adds no sysfs attribute or
  module parameter for it and development releases don't order, so the
  policy reads the running kernel's pcie-gs201-cp module file (modinfo -n;
  the start script hasn't loaded it yet) for the notifier's log line or
  its function name. kernel-2026.11.13's module has neither; the M6 test
  kernels' modules have both.

Anything else, an error included, keeps the inhibitor. A policy that
can't run skips the unit (systemd counts a failed exec as a skip), but
the start script's call then fails too, it waits for a lock that never
comes and loads no driver: the phone never sleeps with the modem up by
accident. No other device ships the declaration, so the 9a and the 6 Pro
keep the inhibitor. The tests run the policy for every combination and
the start script with it (old kernel, opt-out, missing policy, the old
pair), and the unit check in place of systemd-analyze condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… drop-in

A device's modem-sit.conf.d file was read for [audio] only. sitd now
also takes [control] follow_screen from it (and nothing else from
[control]: the socket's group stays the owner's), so the Pixel 7 Pro can
tell its modem the screen state by default now that MODEM-PLAN M6 passed
there, with texts and calls arriving and waking the phone with the
screen dark (2026-11-14). A value in /etc/omamobile/modem-sit.conf still
wins, and without a device default it stays off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t (MODEM-PLAN M6)

The maintainer approved it on 2026-11-14 ("approve modem sleep by default
on the 7 Pro"), after the reference phone passed every step of M6: two
sleeps, ten sleeps refused before the freeze with data busy and the ping
unbroken, a text and a call each waking the phone, audio both ways.

The package now ships /usr/lib/omamobile-modem/suspend-verified, the
phone's declaration that omamobile-modem 0.1.26's sleep policy reads, in
place of the runbook marker, and [control] follow_screen = yes in its
modem-sit defaults. No file of the owner's is needed; the policy still
keeps the inhibitor on a kernel without linux-omarchy-mobile#232's early
refusal and where the owner has made /etc/omamobile/modem-suspend-disable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t from kernel-2026.11.15

MODEM-PLAN section 7's status says M6 passed on the reference phone on
2026-11-14 and links SUSPEND-PLAN's record of it; 7.5 says what turns it
on by default (the device's declaration, follow_screen, the sleep policy),
the kernel guard and why it reads the module, the owner's opt-out, and the
check after Updates. SUSPEND-PLAN's status line says the same. DEVICES'
Suspend cell stays "partial", now saying the modem-up gap closes with
kernel-2026.11.15 and these packages; it moves to "works" only after the
release is checked on the phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rnel-2026.11.15

The maintainer approved it on 2026-11-14. The suspend-and-modem entry now
says that on the Pixel 7 Pro with a kernel carrying
linux-omarchy-mobile#232 and omamobile-modem 0.1.26 with device-cheetah
0.1.57 the phone sleeps with the modem up, that the sleep policy keeps the
inhibitor on an older kernel, and that the owner can opt out. The rest of
the entry, the 9a's rules among it, stands unchanged for every other
phone, and going round a held inhibitor on a 7 Pro stays the maintainer's
attended test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rk page

#555's page and the page fixes carried in this branch were numbered
0.2.128, which main has since passed (0.2.129), and 0.2.130 is taken by
an open pull request. No code change here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@W4HO-ham

Copy link
Copy Markdown
Contributor

One thing for the day the 9a uses this, nothing to change for the 7 Pro: the kernel check can't tell a zumapro kernel with the guard on from one without it.

gs201_pcie_cp_pm_notify and sleep refused before the freeze are in every pcie-gs201-cp built from #232 on, but on zumapro the notifier is only registered, and the noirq refusal only runs, when sleep_guard is set, and that is linux-omarchy-mobile#258 (one line, open). So a 9a on a kernel with #232 and without #258 passes the check while the link driver does nothing at sleep, which is the case where the 9a loses the phone service until a reboot.

Today that can't happen: no 9a package ships suspend-verified or suspend-runbook, and #556's pair needs the runbook marker. I have the 9a's marker ready (device-tegu, the pair only, as an owner opt-in with the runbook in #758), and I'll hold it until there is a way to check for #258. Two ways I can see:

Which would you rather? I can add the first to #258 if you want it.

@derekross
derekross merged commit 5e6612e into main Nov 15, 2026
2 checks passed
@derekross
derekross deleted the modem-sleep-default branch November 15, 2026 01:59
derekross added a commit that referenced this pull request Nov 15, 2026
…#794)

The final M6 check on kernel-2026.11.15 with omamobile-modem 0.1.26 and
device-cheetah 0.1.58 (twenty auto-sleeps with the modem up, an RTC alarm
every minute) entered and woke all twenty sleeps without a failure or a
storage error, but mobile data stopped answering from the first timer
wake on and stayed down with the phone awake (CPIF logging 'Reserve
doorbell interrupt: PCI not powered on' while the link came up again and
again), while the modem still reported its bearer up. The development
channel now turns that on by default, so take the device's declaration
back out: without it omamobile-modem's inhibitor keeps the phone awake
while the modem is up, as before #791. Sleep with the modem off is
unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
derekross added a commit that referenced this pull request Nov 15, 2026
…797)

* AGENTS, DEVICES: sleep with the modem up is held on the 7 Pro again

#791 described sleep with the modem up as on by default on the 7 Pro.
#794 took the device's declaration back out after the twenty auto-sleeps on
kernel-2026.11.15 lost mobile data, so the AGENTS entry goes back to its
earlier wording, with one sentence on what passed and what didn't, and
DEVICES' suspend cell and note say the gap is open again. The rule itself
is the one from before #791: with the modem up nothing passes the
inhibitor except the maintainer's attended test on the charger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* DEVICES: the Modem row says the modem-up sleep is held again too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
den-kloot added a commit to den-kloot/omarchy-mobile that referenced this pull request Nov 15, 2026
…keeps the cellular route away

After a silent spell (the network dropped packet registration for four minutes) omamobile-sit-data removed the cellular default route as intended, but never put it back once the bearer carried traffic again: it only re-adds the route when nothing else leads out, and the USB gadget's fallback route (20-usb-gadget.network, ConfigureWithoutCarrier=yes, metric 2048) is always there, flagged linkdown without a cable. On a Pixel 9a with Wi-Fi off the phone stayed offline until a reboot. Routes on a down link now count as no other exit.

The other device packages carry the same fallback route, so this changes two more things on every phone with the cable out, both decided from the same list:

- The carrier's DNS. "cellular = routed and not others" was never true on mobile data without a cable and without Wi-Fi, because the USB route counted as another way out, so the carrier's DNS was never used there. Now it is, which is what the resolver was written for.
- The return after a sleep (SleepHold, derekross#791). With the USB route counted, the cellular route came back at once after every sleep, logged as "behind Wi-Fi" even with Wi-Fi off. Now it waits for a route that leads out, or the 10 s grace, as intended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants