Repository navigation
omamobile-modem 0.1.10: the modem profile starts once per boot - #163
Conversation
…rary and the CP state it waits for On the 9a gps.cfg sets GlueLayer_IsUseCustomGnssLib, and gnssd dlopen()s libcustomgnss.so, which waits for ONLINE at /sys/bus/platform/devices/cpif/modem_state and then opens RIL's GPS channel through libsitril-gps and libsitril-client. The extractor left all three out, since nothing links them, and the chroot's /sys had only the device path, not its bus link. Neither fixes Kepler's engine-start fault yet.
On the palmtop (Pixel 9a) every open and close of umts_boot0 woke the CP's PCIe link for about 100 ms. The watcher opened the file for each 0.5 s poll, so it woke the link about 120 times a minute. It now holds one file open for the whole watch and polls every 5 s, which cuts the link-ups to about 5 a minute. Whether the status ioctl on the held file wakes the link too is being measured. The watcher was one source of link cycling, and the hang seen while gnssd reloaded Kepler is still open: it happened with this watcher in place too. A crash still shows within seconds. The interval, OMAMOBILE_MODEM_WATCH_SECONDS, is read inside watch() and checked against 0.2-60 s, with the default used otherwise, so a bad value can't break the other subcommands, power-off at the profile's stop included. The package test covers it.
…s at 0.5 s Measured on the palmtop with the modem ONLINE: the profile's held-file watcher made 0 link-ups in a minute, and a second held-file watcher at 0.5 s added 0 in its minute. So it is the open and close of umts_boot0 that wakes the CP's PCIe link, not the status ioctl, and the default goes back to 0.5 s with the file held open; crash timing on the other phones stays as it was.
After the profile has stopped, starting it again in the same boot reset the palmtop (Pixel 9a) silently, a watchdog reset with nothing in pstore, and on the 6 Pro an in-place restart left the CP in BOOTING. The start script's own marker only covers a bring-up that never reached ONLINE. The profile now writes a marker under /run at its first start and refuses a second start in the same boot with a message that says to reboot; nothing removes the marker. The test runs the guard twice.
|
Thanks for turning the gotcha into a guard; a reboot really is the only recovery we know works. Since it's still a draft behind #148, here are two things worth fixing before it comes out of draft. Both come from where the marker is checked and written, not from the idea.
Once #148 has merged and you've rebased (its modem files are identical to the copy you stacked on, so the rebase only drops those commits), the version will be 0.1.10 if nothing else has taken it. As with #148, this changes the shared profile the Pixel 7 Pro runs, so I'll start the modem on my phone once before it merges, and try a second start to see the refusal. |
… the CP power-on The once-per-boot guard ran first in profile_start, after the start script had already written its persistent marker, so a refused second start made the next boot skip the modem too. It also counted an rfsd-only staged start as the boot's one start, which the runbooks' rfsd-then-full sequence needs. The check now runs from profile_check (the start script runs modem check before it writes anything) and from profile_start, and the marker is written just before cbd runs, after the rfsd-stage return. The tests cover the staged start, the refusal from the check, and the persistent marker staying as it was.
|
Both points are in, at 9b1bcb0.
Tests ( Still stacked on #148 (open), so this stays a draft; once #148 merges I'll rebase so only this commit remains, at 0.1.10 if it's still free. |
# Conflicts: # packages/omamobile-modem/version
|
Thanks for the quick turnaround. Both points from my last comment are in at 9b1bcb0, and I checked them against the code. The check is the first thing What's left is ordering and paperwork:
Two small optional ideas. The marker could be created atomically ( If you get a minute with the modem up on the 9a, |
Two starts launched at the same moment could both pass the check before either wrote the marker; the mark is now created with set -C, so the second fails there.
|
Description updated as you describe (the marker at the CP power-on, an rfsd-only stage doesn't count, and that |
…t, and runs on real packages The slot-B precondition and a one-hang cap head the runbook, citing the AGENTS line that is on main. Every stop of the modem unit by hand becomes an attended reboot, since a profile stop hard-reset the palmtop once and the power-off path is unqualified; SIM-11's checksum compare moves to after the reboot. SIM-1 now requires a real install of omamobile-modem (0.1.10 once derekross#148 and derekross#163 merge) with pacman -Qkk clean and the profile's sha256 recorded, and omamobile-modem-sit 0.3.4, since 0.3.3's state reads cycle the CP link. The start script the runbook relies on is committed under device/tegu/bringup. Smaller: no calls to the palmtop during the test and what to do if a release isn't confirmed, the cluster watchdog reset named for a hang, test -d for the CPIF check, the unit copy marked temporary, the Linux poweroff question answered, the network no longer named.
|
Thanks for the atomic create. It's right: the second of two starts stops before cbd, and the profile takes rfsd down with it. Once #148 has merged, I can move this onto main myself if you like, by cherry-picking your three 0.1.10 commits ( |
# Conflicts: # packages/omamobile-modem/version
|
Merged main after #148 landed: 0.1.10 now sits on 0.1.9's held-file watcher, with the once-per-boot marker and the noclobber create on top. pr-check and the package test pass; nothing else changed. |
|
Tested on my 7 Pro tonight, from a build identical to your branch: the modem reached ONLINE in about 9 s, the marker was in |
…blocklist
Unplugging the cable and plugging it back in leaves a Pixel 8 Pro off the
USB link until it is rebooted: the MAX77759's Type-C side opens its USB2
data switch (TCPC 0x25, vendor register 0x93) on unplug, and with no Type-C
driver nothing closes it again, only the bootloader does at the next boot.
The README said so ("a replug may need a reboot"); on a Pixel 8 Pro the
kernel log shows nothing at all at the unplug, and the switch reads 0x00
after it and 0x09 once the rescue has written it back.
Add omamobile-usb-rescue, the Pixel 7 Pro's service on husky's bus
(10cb0000.i2c, hsi2c_11): while VBUS is valid (CHG_DETAILS_00.CHGIN_DTLS
== 3) it writes 0x09 to 0x25:0x93 when the switch is not 0x09, and it
stands aside once a Type-C driver owns the chip. It writes that one
register only, and logs every change of the switch, VBUS and the UDC
state to the journal. Without the bus (the base DT disables it) it says
so and exits, so the unit is inert until the bring-up overlay enables
hsi2c_11 (kernel derekross#163). Depends on i2c-tools.
Also add the MAX77759 blocklist the Pixel 7 Pro has, plus max77759_charger:
binding the PMIC creates its charger, GPIO and NVMEM cells, and the
charger driver programs the charge limits from the battery node, so
those and tcpci_maxim must not load before their bring-up steps.
Blacklist only, so a manual modprobe still works; the fuel gauge and the
MFD core still autoload. The test's "modprobe.d only sets options" rule
now has this one file as its exception, checked for what it contains.
Tested on a Pixel 8 Pro (7.3.0-rc6, slot B): unplug at 11:37:08 (switch
0x00, VBUS 0), replug at 11:37:26 (VBUS 1), the service wrote 0x09 and
the desktop had the link back at 11:37:28, no reboot; the same on a wall
charger. test/all passes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ator Three overlays for the MAX77759 steps of the battery plan, none default, listed through DTB_OVERLAYS like the other devices': - battery-clk-test: CMU_PERIC1 and its sysreg, USI11 and the bus still off (step M2b); - battery-i2c-test: also USI11 and hsi2c_11, the bus of the gauge, PMIC, charger registers and Type-C controller (M3). They need kernel derekross#163; - gauge-model: Google's ModelGauge m5 model for the pack, as maxim,fg-model and maxim,fg-params on the fuel gauge (M4c). Without a model the gauge stays in its power-on state (Status 0x0002, Config 0x2354) and reports a battery temperature stuck at exactly 22.0 C: the same gauge on a Pixel 7 does the same without its model and reads 33.1 C with it (kernel derekross#171). With default-a1-0k (what Google's driver falls back to for an unknown pack) loaded through this overlay the driver logs "battery model loaded (DesignCap 0x994, TaskPeriod 0x2d00)", the power-on bit clears, and the temperature reads 34.4 C and moves. The pack (ATL, COS or LSN) is not known yet, so the percentage may be a few points off; the charge voltage comes from the device tree, not the model. tools/gen-gauge-overlay.py writes the overlay from Google's stock husky node, so no number is typed by hand: each stock u32 table cell becomes two u16 words, the stock parameter bytes become big-endian u16 words in the order of struct max77759_fg_params. The shipped gauge-model.dtso is its output for default-a1-0k. tests/device-overlays compiles all three with dtc -@ (48 overlays ok). Booted on a Pixel 8 Pro (7.3.0-rc6, slot B): all three, in order. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The tool's recovery text had the Pixel 7 Pro's buttons: on the 8 Pro the forced restart is Power + Volume Up for 15 to 30 s, then Power + Volume Down for fastboot, and the known-good set is "your known-good image set". Both the recovery text and wd-drill's start message now warn that every reset spends one of slot B's three boot tries. The phone half refuses a board that is not google,zuma-husky. The notes get a boot-count rule in the safety section, a clause on which kernel was booted against derekross#163 and derekross#175 as they stand, the hand writes marked as research, the stock tables' source, the 2 mAh per unit fix, the overlay list, and the matrix cells qualified as a test kernel. gen-gauge- overlay.py gets its SPDX header. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Lef <me@lefteros.com>
…ross#163) A second start of the modem profile in a boot where the CP was already powered is refused: the check runs first in profile_check, and a marker in /run/omamobile-modem is created atomically (noclobber) at the CP power-on, after the rfsd stage, so the staged rfsd-then-full sequence still works and a refused start doesn't write the persistent latch that would skip the next boot. A second start in the same boot reset the 9a and left raven's CP in BOOTING. Tested on the Pixel 7 Pro (2026-10-30): the modem reached ONLINE in about 9 s, and a second start in the same boot was refused with "the modem profile already started this boot …; reboot before starting it again" while the running modem stayed active. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The follow-up from #154: the gotcha becomes a guard on every phone. After the profile has stopped, starting it again in the same boot reset the palmtop (a watchdog reset with nothing in pstore), so the profile refuses a second start in the same boot.
Where the marker goes down: at the CP power-on, not at the first start.
modem checkrefuses a second start before the start script writes anything, and the marker itself is created at the power-on step, so a stage that only ran rfsd doesn't count as a start and doesn't block the next one. The create is atomic (( set -C; : > "$mark" )), so two starts launched at the same moment can't both get through.#148 has merged and this is rebased onto it, so only the two 0.1.10 commits remain (the
versionconflict is resolved to 0.1.10). The 0.1.8 commit is no longer on the branch.Tested on the 9a tonight: the modem reaches ONLINE, the marker lands at the power-on, and a second start in the same boot is refused by
modem checkbefore anything runs.omamobile-vendor-chroot modem checkprints the refusal (read-only) while the modem is up, and "preconditions met" after a reboot.