Skip to content

omamobile-modem-sit 0.3.4: read the CP state on one open file - #156

Merged
derekross merged 2 commits into
derekross:mainfrom
W4HO-ham:modem-sit-held-fd
Oct 31, 2026
Merged

derekross merged 2 commits into
derekross:mainfrom
W4HO-ham:modem-sit-held-fd

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

The related point from #148: the service checks the CP state every 2 s with a fresh open of umts_boot0 each time. On the palmtop each open and close wakes the CP's PCIe link for about 100 ms, while the status ioctl on a held file doesn't wake it at all (0 link-ups in a minute at 0.5 s, measured today for #148), so this check would cycle the link thirty times a minute once the stack runs on the 9a. cp.state() now keeps one file open for the process and reopens it after an error; a missing device still reads as OFFLINE, and ioctl errors still propagate as before.

Independent of #148 (a different package). test/all and tools/pr-check pass. Not run on a phone: the 9a doesn't run this stack yet, and on the 7 Pro the change is one open instead of one per check.

The service checks the CP state every 2 s with a fresh open of umts_boot0 each time. On the palmtop (Pixel 9a) each open and close wakes the CP's PCIe link for about 100 ms, while the status ioctl on a held file doesn't wake it at all (measured for omamobile-modem 0.1.9), so the check would cycle the link thirty times a minute once this stack runs there. cp.state() now keeps one file open and reopens it after an error; the 7 Pro's behaviour is otherwise unchanged.
@derekross

Copy link
Copy Markdown
Owner

Thanks for following up on this so quickly. It's the same fix as #148, and it fits the service well. The error handling keeps the old contract: a missing device still reads as offline, and other errors still reach the caller.

What I checked:

  • tools/pr-check passes and CI is green.
  • The package tests run with the CP state check switched off, so I drove cp.state() on its own with the syscalls stubbed. It opens once and reuses the file. After an I/O error it closes, raises, and reopens on the next call. With no device it returns 0.
  • The file is opened close-on-exec, so the systemctl and ip children don't inherit it.
  • The service has no threads, so the module-level file can't race.

A few small things, none blocking:

  • The description mentions the service's 2 s check. omamobile-sit-data also calls cp.online() every 0.5 s in its route loop, so by your numbers this saves even more on the 9a than you say. It might be worth a word in the commit body.
  • A tiny unit test for cp.state() (held file, reopen after an error, missing device reads offline) would cover what the suite can't, since the suite runs with the state check off.
  • My draft Modem 0.4.0: IPv6 and CLAT, signal strength, carrier IMS values, a scrubbed trace, SIM PIN, and the SIM runbook #66 bumps this package to 0.4.0. Whichever lands second takes the next version, and I'll sort that out at merge.

The 7 Pro runs this service, so I'll boot it there before merging. It will be the boot after #148's, so each change gets its own boot. I'll check that registration and SMS work as before, and that nothing piles up on the boot channel while the file is held open.

The suite runs with the CP check off, so cp.state() wasn't covered: the test stubs the syscalls and checks that the file is opened once and reused, reopened after an error (which still reaches the caller), and that a missing device reads as OFFLINE. Also for the record: omamobile-sit-data's route loop calls cp.online() every 0.5 s, so on the palmtop the held file saves more link wakes than the service's 2 s check alone.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks. Both suggestions taken at ceaebba: a test_cp.py that stubs the syscalls and checks the held file (opened once and reused, reopened after an error that still reaches the caller, a missing device reads OFFLINE, and BOOT=none stays online), and the commit body notes that omamobile-sit-data's route loop calls cp.online() every 0.5 s, so the saving on the 9a is larger than the 2 s check alone suggests. Version: whichever of this and #66 lands second takes the next number, as you say.

@derekross

Copy link
Copy Markdown
Owner

Thanks for the unit test and the note about the route loop. Both are just what I hoped for, and the tests pass on today's main too. As planned, I'll boot this on my 7 Pro the boot after #148's, checking registration, SMS and the boot channel, and merge once that's clean. If my #66 goes in first, I'll bump this to the next free version at merge.

@derekross
derekross merged commit 361d1bd into derekross:main Oct 31, 2026
2 checks passed
@derekross

Copy link
Copy Markdown
Owner

Booted it on my 7 Pro after #148's boot: with 0.1.9 and 0.3.4 the modem reached ONLINE in about 9 s, nothing queued on umts_boot0, no UFS error pass. sitd itself refused to start ("No APN configured"): my 7 Pro has never had a SIM, so sitd has never run on it, and the registration/SMS half of my planned check has to wait for the SIM test. Since your 9a runs and tested this change, and it can't touch the 7 Pro before then, I've merged it. Thank you!

greenbrettmichael added a commit to greenbrettmichael/omarchy-mobile that referenced this pull request Oct 31, 2026
kernel derekross#156's Wi-Fi needs CONFIG_PHY_ZUMA_PCIE, a zuma-only PHY, so it
goes in husky's fragment. On a kernel without derekross#156, olddefconfig drops
the unknown symbol and nothing else changes (checked on omamobile with
derekross#153).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
derekross pushed a commit that referenced this pull request Nov 1, 2026
…214)

Adds husky to extract-vendor-firmware: the BCM4398 firmware, CLM blob and the per-SKU NVRAM (MMW, ROW, NA as in Google's dhd_custom_google.c; other SKUs take the default), named for kernel #156's brcmfmac4398d0-pcie. -s is refused on other devices; the cheetah, panther, raven and tegu paths are unchanged. CONFIG_PHY_ZUMA_PCIE=m in device/husky/kernel.config for bring-up (it moves to the shared fragment when kernel #156 merges).
greenbrettmichael added a commit to greenbrettmichael/omarchy-mobile that referenced this pull request Nov 1, 2026
A NOTES entry for the BCM4398 under kernel derekross#156 (draft): the chip and
its NCI backplane, the pins, zuma's PCIe PHY, how stock picks the
firmware files (derekross#214 does the same), what brcmfmac needed, the reload
fix, throughput, what isn't done, and the BAR read that hung the phone.

DEVICES and the ROADMAP move husky's Wi-Fi from no to testing: it is
not in the kernel the image ships until derekross#156 and the PRs under it land.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
greenbrettmichael added a commit to greenbrettmichael/omarchy-mobile that referenced this pull request Nov 1, 2026
A NOTES entry for the BCM4398 under kernel derekross#156 (draft): the chip and
its NCI backplane, the pins, zuma's PCIe PHY, how stock picks the
firmware files (derekross#214 does the same), what brcmfmac needed, the reload
fix, throughput, what isn't done, and the BAR read that hung the phone.

DEVICES and the ROADMAP move husky's Wi-Fi from no to testing: it is
not in the kernel the image ships until derekross#156 and the PRs under it land.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Nov 1, 2026
…e host when the device tree has it

Kernel derekross#168's standalone host is being replaced by derekross#178, which puts the 9a's channel 1 on derekross#156's pcie_gs201 and phy_zuma_pcie. The graphics start picks the host from the node's compatible, and both new modules are kept out of autoload like the old one.
derekross pushed a commit that referenced this pull request Nov 2, 2026
…ing (#307)

The 9a's row after today's merges, with a NOTES entry for the evening's boots that the new cells link to.

- **Wi-Fi, testing to works.** `omamobile-device-tegu` 0.2.4 (#238) starts it at boot now, through the shared gs201 host and zuma PHY (kernel #178 on #156, both in review) and brcmfmac (kernel #56, in review), with only the extractor's firmware. The NOTES entry has the boot, and the three rebinds with Bluetooth up after #178's FLR commit. The kernel parts are still in review, and the cell says so, as the display cells did.
- **Suspend, WIP to testing.** The power key now lights the lock screen on the first press (#268, #275). Thirty attended sleeps and a day of real use with auto-sleep on all woke (SLEEP-PLAN, #284). The cell still says that three test sleeps on 10-28 to 10-30 never woke and that sleep tests stay attended. If you'd rather keep WIP until that hang is understood, I'll revert just the word.
- **Display:** the display DT is merged, and brightness, DPMS off and on and the 60/120 Hz switch now have a dated record (kernel #125's boot, which also checks the panel ID).
- **Charging, Haptics, Torch, NFC:** kernel #161, #96, #104 and #105 are merged.
- **USB net:** the rescue also handles a replug the gadget didn't see (#280).

The NOTES entry lists each boot with its release: Wi-Fi from the package, the power-key wake, the replug, storage idle (kernel #99), the panel ID (kernel #125), the RTC without the PMIC interrupt (kernel #55), and the auto-sleep day. GNSS and Modem stay as they are until the SIM test on Tuesday. Docs only; `tools/pr-check` passes, and the diff has no identifiers.

Closes #307

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…oss#156)

sitd (2 s checks) and sit-data (cp.online() every 0.5 s in its route loop) each opened umts_boot0 for every state read; on the Pixel 9a each open and close woke the CP's PCIe link. Each now holds one file for its lifetime, as the modem profile's watcher does since 0.1.9. A unit test covers the held file; the commit notes the route loop's polling.

Pixel 7 Pro (2026-10-30): installed with omamobile-modem 0.1.9, the modem reached ONLINE in about 9 s with nothing queued on umts_boot0 and no UFS error pass. sitd itself can't start on the 7 Pro yet (no SIM, so no APN configured), so the 7 Pro is unaffected until its SIM test; the change was exercised on the 9a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…erekross#214)

Adds husky to extract-vendor-firmware: the BCM4398 firmware, CLM blob and the per-SKU NVRAM (MMW, ROW, NA as in Google's dhd_custom_google.c; other SKUs take the default), named for kernel derekross#156's brcmfmac4398d0-pcie. -s is refused on other devices; the cheetah, panther, raven and tegu paths are unchanged. CONFIG_PHY_ZUMA_PCIE=m in device/husky/kernel.config for bring-up (it moves to the shared fragment when kernel derekross#156 merges).
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…ing (derekross#307)

The 9a's row after today's merges, with a NOTES entry for the evening's boots that the new cells link to.

- **Wi-Fi, testing to works.** `omamobile-device-tegu` 0.2.4 (derekross#238) starts it at boot now, through the shared gs201 host and zuma PHY (kernel derekross#178 on derekross#156, both in review) and brcmfmac (kernel derekross#56, in review), with only the extractor's firmware. The NOTES entry has the boot, and the three rebinds with Bluetooth up after derekross#178's FLR commit. The kernel parts are still in review, and the cell says so, as the display cells did.
- **Suspend, WIP to testing.** The power key now lights the lock screen on the first press (derekross#268, derekross#275). Thirty attended sleeps and a day of real use with auto-sleep on all woke (SLEEP-PLAN, derekross#284). The cell still says that three test sleeps on 10-28 to 10-30 never woke and that sleep tests stay attended. If you'd rather keep WIP until that hang is understood, I'll revert just the word.
- **Display:** the display DT is merged, and brightness, DPMS off and on and the 60/120 Hz switch now have a dated record (kernel derekross#125's boot, which also checks the panel ID).
- **Charging, Haptics, Torch, NFC:** kernel derekross#161, derekross#96, derekross#104 and derekross#105 are merged.
- **USB net:** the rescue also handles a replug the gadget didn't see (derekross#280).

The NOTES entry lists each boot with its release: Wi-Fi from the package, the power-key wake, the replug, storage idle (kernel derekross#99), the panel ID (kernel derekross#125), the RTC without the PMIC interrupt (kernel derekross#55), and the auto-sleep day. GNSS and Modem stay as they are until the SIM test on Tuesday. Docs only; `tools/pr-check` passes, and the diff has no identifiers.

Closes derekross#307

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gitColinX added a commit to gitColinX/omarchy-mobile that referenced this pull request Nov 15, 2026
derekross#752 gave the package its Bluetooth address step, so the paragraph
that said a pairing wouldn't survive "until this package has its own
address step" now says that pairings made before 0.1.13 have to be
made again once. The Wi-Fi line named kernel derekross#156 as a draft; it
merged through kernel derekross#187 on 2026-11-09.

Co-Authored-By: Claude Opus 5.5 <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.

2 participants