Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
023717d
omamobile-modem 0.1.17: run on the Pixel 6 Pro's S5123
robotosaith Nov 3, 2026
35847c9
omamobile-modem 0.1.17: tell the user when the modem crashes
robotosaith Oct 21, 2026
88bfcb4
omamobile-modem-sit 0.3.31: end in one line when the CP goes away
robotosaith Oct 27, 2026
df941a8
MODEM-PLAN (raven): section 11, the link dies at system suspend
robotosaith Nov 2, 2026
65d80bb
omamobile-modem 0.1.17: check the gs101 board named by its compatible
robotosaith Nov 3, 2026
10b5952
MODEM-PLAN (raven): section 11 names the releases the fixes land in
robotosaith Nov 3, 2026
4e57b14
omamobile-modem-sit 0.3.31, omamobile-modem 0.1.17: numbers after #37…
robotosaith Nov 3, 2026
6b53f21
omamobile-modem 0.1.17: the overlay test finds the typed NV mount
robotosaith Nov 3, 2026
e023964
omamobile-modem 0.1.17: review fixes: blkid message, notify in the jo…
robotosaith Nov 4, 2026
127ae31
device-raven 0.1.31: sitd waits for CP ONLINE, as on cheetah
robotosaith Nov 4, 2026
b9e280d
omamobile-modem 0.1.21, modem-sit 0.3.35, device-raven 0.1.35: number…
robotosaith Nov 11, 2026
f1e100f
omamobile-modem: send the crash notice in PID 1's mount namespace
robotosaith Nov 11, 2026
4dbfd18
omamobile-modem: send the crash notice as a transient unit of PID 1's
robotosaith Nov 11, 2026
1b497b8
Merge remote-tracking branch 'origin/main' into omamobile-sim-pr0-v2
robotosaith Nov 12, 2026
2687806
omamobile-modem 0.1.22, device-raven 0.1.36: numbers after #403
robotosaith Nov 12, 2026
a0a0bf3
omamobile-modem: no crash notice during the unit's own stop
robotosaith Nov 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions device/raven/MODEM-PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,3 +784,113 @@ binary: a single-module `make` had rebuilt nothing):
- **Next:** what kills the link (the crash record should now keep it);
then recovery without a reboot (a CP power cycle that reaches ONLINE).


## 11. The link dies at system suspend (2026-10-27, `g97f09c8cfada`)

- **What happened:** the owner took the phone out unplugged and found no
modem. Boot 13:24: the CP came up clean (NV copies matching the
backup), sitd polled the SIM for 54 minutes (it never reported ready
that boot). At 14:18:45 `omamobile-sleepd` suspended (s2idle, "dark and
locked for 11 s", the first time that boot with no USB host). In the
suspend the PM core logged `pcieport 0001:00:00.0: Unable to change
power state from D0 to D3hot, device inaccessible`, then `D3cold to D0`
and `Data Link Layer Link Active not set in 100 msec`; UFS logged its
`dme-set: attr-id 0x4021 ... failed` in the same resume (the M2.5
pattern). After resume the link trained (`Gen3 x2`), but CPIF's
`s51xx_pcie_restore_state` couldn't set D0 and the doorbell read
`0xffff` (no bus mastering). At 14:18:58 the dead-link check (§10's
fix) forced the crash: `link down for 8968 ms and recovery did not
clear it`, reason 22, ONLINE to CRASH_EXIT. rfsd's NV validation came
out clean; the watcher recorded the crash (its notification sends no
log line, so the journal can't confirm it).
sitd died with a traceback (`EOFError: SIT channel closed`, from its
bring-up SIM poll). The owner rebooted at 15:11.
- **Not a one-off:** the next boot (15:11) lost the CP the same way at
its first suspend, 54 s after boot (crash at 15:12:28, 5072 ms after
the failed resume), and the 21 suspends after it ran without a modem;
nobody noticed. Two suspends with the CP ONLINE, two crashes. §10's
93-minute link death may have been the same thing before the dead-link
check existed.
- **Fixes:**
- omamobile-modem, in the release #389 lands in: a crash raises a
notification ("Cellular stopped") with the crash record's path;
- omamobile-modem-sit, in the release #389 lands in: when the CP is
gone, sitd exits with one line ("the modem went away ...") instead of
a traceback.
- During bring-up the watcher also held a logind sleep inhibitor while
the CP was ONLINE. It isn't in the package: it would cost every
phone's battery for a raven kernel problem, and the kernel fixes
below make it unnecessary.
(2026-11-04: since omamobile-modem 0.1.13 it is in the package after
all, as `omamobile-modem-inhibit`, which cheetah's MODEM-PLAN 6.3 asks
for on every phone.)
- **Next:** CPIF's system suspend. The root port has to stay reachable
across s2idle, or CPIF has to take the link down itself first (what
its `s5100_pm_notifier` does on stock is still to read). Separately:
why the SIM never became ready at 13:24.

The three `pcie-gs201-cp` fixes below are on the branch
[`omamobile-gs101-cpif-suspend`](https://github.com/robotosaith/linux-omarchy-mobile/commits/omamobile-gs101-cpif-suspend)
(on `omamobile-gs101-cpif`, not yet signed off), as they ran on
`omamobile-gs101-int-power`.

**Suspend with the modem up, first fix (2026-10-28, `gdd5e1655ef91`).** The
cause, from the kernel log and Google's raven `pcie-exynos-rc.c`: with the
link idle, `cp_link_down()` leaves the CP PCIe controller unclocked and its
PHY isolated, so the PCI core's save, D3hot and restore of the root port in
a system sleep read all ones and leave it marked D3cold; nothing below it
can then be brought to D0. Google's driver takes the PHY out of isolation
in `prepare` and isolates it again in `complete`. `pcie-gs201-cp` now does
the same (PHY inited, root port config allowed, PERST# asserted, endpoint
closed); not published yet.

- **S2 (one `rtcwake -m freeze -s 20`, modem ONLINE): passed.** No
"inaccessible" on the root port; the link came straight back; CP ONLINE
35 s later, SIM 2 on LTE with data, no UFS error handler, no crash. The
endpoint logged "Unable to change power state from D3hot to D0, device
inaccessible" at resume (its link was down) without harm.
- **S3 (five cycles, 30 s awake between):** cycles 1 and 2 were woken by the
modem (`cp2ap_wakeup`) after 2 and 5 s, CP ONLINE after each. Cycle 3
slept **558 s** (the RTC alarm didn't fire; IRQ 111, the PMIC, woke it)
and the CP was still ONLINE at resume, but the first poweron after it got
`s51xx_pcie_restore_state: Can't set D0`, doorbells read `cmd reg 0xffff`,
and the dead-link check crashed the CP 21 s after resume. Cycles 4-5 ran
with the CP down. No UFS errors in any cycle.
- **Next:** the endpoint. The PCI core also suspends and resumes it with the
link down, fails, and keeps a wrong power state; after a long sleep CPIF's
D0 restore trips over it. Read the PCI core's and CPIF's D0 paths, keep the
endpoint's bookkeeping sane across the sleep (or restore it before CPIF's
restore), then S2/S3 again with a long sleep.

**Second fix and the soak (2026-10-28, `g378edcff3ed7`).** `pcie-gs201-cp`
now also waits, on every poweron after the first, for the endpoint's Vendor
ID (every 10 ms, up to 1 s) before its state is restored (not published
yet), on the theory that after a long sleep the endpoint wasn't ready
0.1 ms after the link came up (PCIe r6.0 sec 6.6.1).

- Two 300 s sleeps, three of 20 s: all CP ONLINE 60 s later; the modem woke
the first after 77 s, the PMIC the second after 165 s.
- Two 900 s sleeps asked: the modem woke the phone after 8 and 6 s.
- **Soak, 30 min of back-to-back sleeps (5 s awake between): passed.** 18
sleeps in 2387 s, about 2234 s asleep, three of about 10 min (591, 591,
600 s); woken by the modem 14 times, the RTC 3, the power key once. CP
ONLINE after every wake, no crash, no UFS error handler, both SIMs
registered. The new wait never logged (the endpoint answered at once
every time), so the 558 s failure didn't recur but the wait is not proven
to be what prevents it; it stays as a guard.
- **Trial in daily use from 2026-10-28 13:25:** suspend with the modem up
and no sleep inhibitor. Watch for "Cellular stopped" and
`/var/log/omamobile/modem-crashes.log`.

**The trial's first crash, a race (2026-10-28 14:09, `gdcdd42db122d`).**
During the drain baseline (17 suspends in 20 min, POWER-PLAN) the root
port failed as before the hooks ("Unable to change power state from D0 to
D3hot, device inaccessible"), right after a "PHY isolated": the link went
down between prepare and the PCI core's suspend of the root port, and
cp_link_down() isolated the PHY again. CPIF's restore then got "Can't set
D0" and the dead-link check crashed the CP. The endpoint wait logged
nothing (the endpoint answered at once), so the earlier "slow endpoint"
theory is ruled out. The fix (not published yet): from prepare to complete,
cp_link_down() takes the link down but keeps the PHY inited and the root
port reachable; complete isolates it. On the phone as `g244c690c1fd1`, the
trial continuing.
2 changes: 1 addition & 1 deletion packages/omamobile-device-raven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the counterpart of `omamobile-device-cheetah`. Bring-up and results:
| The user may switch the panel off (`bl_power`) and inhibit the touchscreen, for Omarchy's display off | `udev/rules.d/20-omamobile-display.rules` |
| Wi-Fi power save on | `NetworkManager/conf.d/omamobile-raven-wifi-powersave.conf` |
| Sleep (s2idle) once locked with the panel off, behind `omarchy-toggle omamobile-sleep on` (the watcher, `omamobile-sleepd`, is omamobile-shell's); Wi-Fi stays connected across sleep (unloaded instead after a D3 failure, or with `/etc/omamobile/wifi-unload-for-sleep`) | `omamobile-sleep` (`system-sleep/omamobile`), `sleep.conf.d/10-omamobile.conf` |
| Modem bring-up only: its PCIe driver and CPIF never load at boot, and the modem's units aren't enabled (as on main; `systemctl enable --now omamobile-modem omamobile-sitd` to use it, MODEM-PLAN) | `modprobe.d/omamobile-raven-modem.conf` |
| Modem bring-up only: its PCIe driver and CPIF never load at boot, and the modem's units aren't enabled (as on main; `systemctl enable --now omamobile-modem omamobile-sitd` to use it, MODEM-PLAN); once enabled, sitd waits for CP ONLINE and the data fallback needs the modem's port, as on cheetah | `modprobe.d/omamobile-raven-modem.conf`, `omamobile-sitd.service.d/`, `omamobile-sit-data.service.d/` |
| Bluetooth on at boot; the session waits (at most 15 s) for the adapter | `bluetooth.service` (enabled), `sddm.service.d/`, `omamobile-wait-bluetooth` |
| The speakers through speaker protection at stage media (raven's own limits: AUDIO-PLAN R6), the microphones with them; stage c9 and earpiece mode stay off on raven | `omamobile-speaker-protection.service` from omamobile-audio 0.5.15 (enabled); `snd_soc_cs35l41_spi` blacklisted here too, so only that service loads it | `omamobile-raven.conf` |

Expand Down
8 changes: 8 additions & 0 deletions packages/omamobile-device-raven/test/all
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ grep -q "'omamobile-audio>=0.5.15'" PKGBUILD || fail "device-raven depends on om
|| fail "raven never sets aoc_alsa_dev speaker_protection (it would allow stage c9)"
pass "speakers through protection at stage media, the microphones with them"

# The modem's units, when enabled: sitd waits for CP ONLINE (as on cheetah)
d=$tmp/root/usr/lib/systemd/system/omamobile-sitd.service.d/20-cp-online.conf
grep -qx 'ExecStartPre=/usr/lib/omamobile-vendor/omamobile-modem-cp wait-online 120' "$d" || fail "sitd waits for CP ONLINE with the cbd timeout"
grep -q '^\[Service\]' "$d" && ! grep -q '^\[Unit\]' "$d" || fail "the sitd drop-in only adds to [Service]"
d=$tmp/root/usr/lib/systemd/system/omamobile-sit-data.service.d/20-cp-online.conf
grep -qx 'ConditionPathExists=/dev/umts_ipc0' "$d" || fail "sit-data is skipped without the modem's port"
pass "sitd waits for the CP; sit-data needs the modem's port"

# Policy that keeps the phone safe at boot
for m in tcpci_maxim gpio_max77759; do
grep -qx "blacklist $m" vendor/modprobe.d/omamobile-raven.conf || fail "$m stays blacklisted"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: MIT
# The data fallback only with a modem. omamobile-sit-data requires sitd, but
# a sitd skipped by its own condition (no /dev/umts_ipc0: the modem unit was
# skipped on a phone that isn't provisioned) counts as started, and the
# fallback would then wait 60 s for a bearer, fail, and be restarted every
# 10 s for the whole boot. With the modem up the port exists, and
# `omamobile-sit data on` works as before.
[Unit]
ConditionPathExists=/dev/umts_ipc0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: MIT
# Raven's sitd waits for the CP, as the Pixel 7 Pro's does (device-cheetah's
# drop-in of the same name). omamobile-modem.service is ready once CPIF's
# ports exist, before cbd has booted the CP (about 3 s more on raven), and a
# sitd started on that alone exits ("CP is not ONLINE": at every raven boot
# with the modem enabled, 2026-11-04). 120 s is the profile's own cbd
# timeout: a CP that never comes up fails sitd here, and the data fallback
# and the Phone and Messages bridge, ordered after it, stay down until the
# reboot.
[Service]
ExecStartPre=/usr/lib/omamobile-vendor/omamobile-modem-cp wait-online 120
2 changes: 1 addition & 1 deletion packages/omamobile-device-raven/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.35
0.1.36
12 changes: 12 additions & 0 deletions packages/omamobile-modem-sit/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,18 @@ def stop(*_):
if not serve_one(service, connection, clients):
connection.close()
service.broadcast()
except (EOFError, OSError, RuntimeError) as error:
try:
online = cp.online()
except OSError:
online = False
if online:
raise
# The CP crashed under us: omamobile-modem.service records it, tells
# the user and leaves the modem alone until a reboot. Say so in one
# line, not as a traceback through the SIT read.
raise SystemExit('the modem went away (%s): calls, SMS and data are '
'off until the phone restarts' % error) from None
finally:
try:
if service and service.live() and not service.release_unconfirmed:
Expand Down
16 changes: 16 additions & 0 deletions packages/omamobile-modem-sit/test/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,22 @@ def test_unconfirmed_release_turns_radio_off_and_keeps_call_ownership(self):
self.assertTrue(self.service.release_unconfirmed)
self.assertEqual(self.service.live(), [call])
self.assertTrue(json.loads((self.root/'active.json').read_text()))
def run_main_with_channel_closed(self,online):
# raven, 2026-10-27: the CP crashed during start-up and sitd died with
# a traceback from the SIT read.
with patch('sys.argv',['omamobile-sitd']), \
patch.object(app_service.paths,'STATE',self.root), \
patch.object(app_service.cp,'online',side_effect=[True]+online), \
patch.object(app_service,'Sit'), \
patch.object(app_service,'database'), \
patch.object(app_service,'Service',side_effect=EOFError('SIT channel closed')), \
patch.object(app_service.signal,'signal'):
app_service.main()
def test_a_crashed_cp_ends_the_service_in_one_line(self):
with self.assertRaises(SystemExit) as raised: self.run_main_with_channel_closed([False])
self.assertIn('the modem went away (SIT channel closed)',str(raised.exception.code))
def test_a_closed_channel_with_the_cp_online_still_raises(self):
with self.assertRaises(EOFError): self.run_main_with_channel_closed([True])


class RefusedAudioTests(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion packages/omamobile-modem-sit/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.34
0.3.35
2 changes: 1 addition & 1 deletion packages/omamobile-modem/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pkgname=omamobile-modem
pkgver=$(cat "${startdir:-.}/version")
pkgrel=1
pkgdesc="Omarchy Mobile modem runtime for the Pixel 7 Pro: stock rfsd and cbd in a vendor chroot on RAM copies of NV, with a per-phone overlay for the modem's own NV writes"
pkgdesc="Omarchy Mobile modem runtime for the Pixel 7 Pro and 6 Pro: stock rfsd and cbd in a vendor chroot on RAM copies of NV, with a per-phone overlay for the modem's own NV writes"
arch=(aarch64)
url="https://github.com/derekross/omarchy-mobile"
license=(MIT)
Expand Down
Loading