From 522b86ccce437582d02021555466ffd86fb2dee5 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 19:24:15 -0643 Subject: [PATCH 01/30] device/tegu MODEM-PLAN, AGENTS: GNSS resolved, a fix on the 9a The CHPP link lost bits because spi-s3c64xx's flush cleared the packet count before turning the channels off (linux-omarchy-mobile#150) and because the GNSS SPI's pins ran on the bootloader's drive 0 (#151); with stock's SPI configuration the receiver gets a fix. Holding the CP link up after ONLINE ends the link hang under GNSS traffic. Adds the plan section with the sweep that found it, three agent gotchas, a notes entry, the GNSS SPI bring-up overlays, the session script, and the start script's new module settings. --- AGENTS.md | 3 + device/tegu/MODEM-PLAN.md | 103 ++++++++++++++++++-- device/tegu/NOTES.md | 11 +++ device/tegu/bringup/omamobile-tegu-modem-up | 10 +- device/tegu/bringup/tegu-gnss-session | 31 ++++++ device/tegu/overlays/gnss-spi-autocs.dtso | 17 ++++ device/tegu/overlays/gnss-spi-fb0.dtso | 18 ++++ device/tegu/overlays/gnss-spi-pins.dtso | 32 ++++++ 8 files changed, 213 insertions(+), 12 deletions(-) create mode 100755 device/tegu/bringup/tegu-gnss-session create mode 100644 device/tegu/overlays/gnss-spi-autocs.dtso create mode 100644 device/tegu/overlays/gnss-spi-fb0.dtso create mode 100644 device/tegu/overlays/gnss-spi-pins.dtso diff --git a/AGENTS.md b/AGENTS.md index b75d93b62..b84fb8870 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -153,6 +153,8 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link - **The AoC starts only through Trusty** (`com.android.trusty.gsa.hwmgr.aoc`). The GSA mailbox `START` leaves the A32 held. So Trusty is a dependency of audio and sensors, not just of fingerprint, and it runs at every boot on the integration kernel. - **Fingerprint: nothing writes `persist` or the RPMB without the human's explicit go.** The first `storageproxyd` run (FINGERPRINT-PLAN F4) is irreversible, and `omamobile-fp.service` ships disabled because its first run writes Trusty's secure storage. [FINGERPRINT-PLAN](device/cheetah/FINGERPRINT-PLAN.md) - **Set the Bluetooth address only after powering the controller on:** set on a never-powered controller, the kernel withdrew the index for good. +- **spi-s3c64xx with automatic chip select drops bits between transfers until linux-omarchy-mobile#150:** its FIFO flush cleared the packet count before turning the channels off, so the controller clocked a few bits with the slave still selected. A slave that restarts per chip-select cycle (touch) doesn't notice; one that streams across cycles (the 9a's GNSS core, CHPP) loses 2-6 bits per transfer, and every read lands at a different bit offset. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, resolved" +- **A node without pinctrl runs on the bootloader's pins:** the 9a's GNSS SPI had none and ran at drive 0, which made its data marginal. Before blaming a protocol, read the bank's CON/PUD/DRV in `/sys/kernel/debug/pinctrl//pins` (one controller at a time, as the gs101 note above says) and compare with the bus that works. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, resolved" - **Samsung pinctrl takes pin groups only at its own probe:** groups added later by a runtime overlay are refused ("invalid function … in map table"), so a driver's pin states belong in the base DT even when its node comes from an overlay. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) M2.0 - **On tegu, ABL leaves every GPA5 pin pulled down, and that hides the modem's cp2ap lines:** with the pull-down nothing rose for 10 s after power-on; with stock's pulls (wakeup up, phone-active and ps-hold floating, in the base DT) they rise within 0.5 s. Check a line's pull before blaming the device that drives it. [tegu FAR-ALIVE-PLAN](device/tegu/FAR-ALIVE-PLAN.md) - **brcmfmac on BCM4389 needs control-ring D3 messages:** this firmware ignores the TCM mailbox, so early suspend tests ran with Wi-Fi unloaded. The D3 series on `omamobile-int` sends the D3 inform as a control message, and Wi-Fi now stays connected across s2idle (S5b-3; S5c, 31 of 31 freezes, 2026-10-19). The sleep hook (`omamobile-sleep` in device-cheetah) keeps Wi-Fi loaded when `/etc/omamobile/wifi-keep-across-sleep` exists (set on the reference phone since S5c), and otherwise unloads it; after a failed D3 handshake it falls back to unloading for the rest of the boot. Wi-Fi can't wake the phone (no host-wake consumer). [SUSPEND-PLAN](device/cheetah/SUSPEND-PLAN.md) S5 @@ -181,6 +183,7 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link - **Volume Up is the one key without an internal pull** (`PUD` 0x0, as on stock), and the first freeze woke 3 s in from it with nobody touching it. It didn't recur in the 51 RTC cycles of S4 and S5c, and it isn't proven to be a false edge; if spurious wakes recur, check gpa8-5's power-down pull before blaming the wake path. - **UFS ran its error handler around modem power changes** (PA LINERESET indications, recovered without a reset). Stock's DT shows no shared rail, clock or pin. M2.5 narrowed it down: power-on and a running link are clean, but every modem power-off is followed by one recovered UFS error-handler pass (a PA LINERESET, no I/O errors or resets). Stock powers the modem off only at shutdown, so the modem stays on once it is up (M2.6 is open), and a reboot with the modem up costs one such pass. Keep modem tests attended, don't power-cycle the modem, and check `dmesg | grep ufshcd_err_handler` after each step. [MODEM-PLAN](device/cheetah/MODEM-PLAN.md) M2, M2.5, M2.6 - **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, which alone resets the 9a in s2idle, so the modem's part is unknown. CPIF's PM paths are wake-armed in code, but M6 is design only and no SIM test has happened (M4.2). Keep modem tests on the charger, so upower's critical action doesn't suspend the phone mid-test. [MODEM-PLAN](device/cheetah/MODEM-PLAN.md) 6.3, [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" +- **On the 9a, hold the CP link up only after ONLINE.** CPIF powers the PCIe link down whenever the CP asks, and a link-down access under GNSS traffic hangs the SoC (CLUSTER0_NONCPU_WDTRESET). The bring-up cpif's `keep_link_up=1` stops that, but set at module load it keeps the CP from ever reaching ONLINE (it needs its link cycles while booting): load with `keep_link_up=0` and write 1 to `/sys/module/cpif/parameters/keep_link_up` after ONLINE, as `device/tegu/bringup/tegu-gnss-session` does. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, resolved" - **Never `systemctl restart omamobile-modem` (or stop and start it) to recover a crashed modem.** An in-place restart left raven's CP in BOOTING, and a bring-up that never reaches ONLINE sets a latch that makes the next boot skip the modem. Reboot instead. If a boot skipped it, remove the latch (`rm /var/lib/omamobile/modem-bringup-started`) and `systemctl start omamobile-modem`; `/usr/lib/omamobile-vendor/omamobile-modem-start --retry` also clears it, but run by hand it brings the modem up outside the unit (a stray `rfsd` in your shell's session). [raven MODEM-PLAN](device/raven/MODEM-PLAN.md) D4. The same on the 9a: after the modem profile has stopped, starting it again in the same boot reset the palmtop silently, a watchdog reset with nothing in pstore (the one try was in the rfsd stage). [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) G3 - **Linux never writes the modem's NV.** The modem chroot profile (cbd, rfsd) refuses to start unless the NV partitions read `ro=1` and none is mounted, works on checksum-verified RAM copies only, and loses what the modem writes at stop. Don't give the chroot a real block device. diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 075e67820..a5370fec8 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -7,15 +7,14 @@ modem's cp2ap lines) is bound with its EINTs in the base DT trains Gen1 x1 and enumerates as 144d:a5a5; M3-M5 passed: CPIF and cbd boot it to **ONLINE** (Gen3 x2) with working IPC (pktproc), no SIM yet; G1-G2 passed: gnssd loads Kepler's firmware and talks CHPP over SPI; -G3 partial: our HAL client starts sessions and the engine tracks -satellites, but the CHPP link over the GNSS SPI loses bytes and gnssd's -own watchdog resets Kepler (the "hardfault"); the clock and the transfer -cut are in derekross/linux-omarchy-mobile#138 (in review), and GNSS is parked without a -hardware probe (the owner's decision, 2026-10-29); G3-A (automatic chip -select, 2026-10-30) ended in the same CHPP failure with clean checksums, and -G3-A2 (32-bit words with the controller's swap) is the one boot left to -build. The CP link hang with frequent Kepler resets is open. Next: a stock -GNSS capture, IOCC, the SIM. +**G3 resolved (2026-10-30, evening): a position fix on the owner's kernel.** +The CHPP link lost bits because spi-s3c64xx's flush cleared the packet +count before turning the channels off +(derekross/linux-omarchy-mobile#150) and because the GNSS SPI's pins ran on +the bootloader's drive 0 (#151); the CP link hang under GNSS traffic goes +away with the link held up after ONLINE. Section "G3, resolved" below. +Left: the GNSS and CPIF drivers aren't in the published kernel, and GNSS +still starts by hand. Next: the SIM. The staged plan (sections F, K, U and runbooks M0.2-M6, G1-G4) is below, with each step's results under it. Kernel branches `omamobile-tegu-modem` and `omamobile-tegu-gnssif` (section K). @@ -937,6 +936,92 @@ does no software swap, which is not built yet. One session, no reset: this was G3-A's own one DTB round, not a G3-L1 session, so the trace's cap of three sessions and two resets is untouched. GNSS stays parked otherwise. +### G3, resolved: a fix (2026-10-30, evening, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`) + +[V] **The receiver gets a position fix.** On the owner's kernel with the +two fixes below and stock's SPI configuration: a 3-minute session by a +window with 36 of 38 GGA sentences at fix quality 1, 13 satellites used, +HDOP 0.8; a 10-minute session with 38 of 43 fixed, 10-13 satellites, HDOP +about 1; GPS, Galileo, BeiDou and GLONASS tracked at C/N0 up to about +41 dB-Hz. CHPP clean in both: no ACK timeout, no bad checksum, no permanent +failure, no Kepler fault, no CP link isolation, no UFS error, no reset (11 +minutes of uptime at the end of the long one). No position or height is +recorded here. + +**Cause 1, the flush order (kernel, [linux-omarchy-mobile#150](https://github.com/derekross/linux-omarchy-mobile/pull/150)).** +`s3c64xx_flush_fifo()` cleared PACKET_CNT, and with it PACKET_CNT_EN, while +RXCH_ON was still set. For that one write the controller received with no +packet count and ran SCK freely, and with automatic chip select the slave +stayed selected and shifted out bits the flush threw away. Kepler streams +CHPP across chip-select cycles, so every transfer lost 2-6 bits: each read +arrived at a different bit offset (0, 2, 4 or 6, changing from read to read), +the data inside a read was intact, and frames that crossed reads failed +their CRC. Google's driver turns the channels off first; #150 does the same. +Found by comparing Google's and mainline's transfer paths register write by +register write, after the sweep below had shown the slip per transfer. + +**Cause 2, the pins (DT, [linux-omarchy-mobile#151](https://github.com/derekross/linux-omarchy-mobile/pull/151)).** +SPI21 had no pinctrl, so the bus ran on the bootloader's pin state, read +from PERIC1's pin registers on the palmtop: gpp22-0..3 in function 2 at +drive 0, gpp22-2 (data in) pulled down. With drive 3 (as gpp21, the other +SPI bus on PERIC1, the touchscreen's) the data inside each read became +clean; with the flush fix as well, every read arrived at bit 0 with a valid +CRC32. #151 describes the pins in the board DT; the palmtop uses +[`overlays/gnss-spi-pins.dtso`](overlays/gnss-spi-pins.dtso) until it lands. + +**The configuration that works is stock's**: SPI mode 0 (stock's node has +no spi-cpha or spi-cpol), 32-bit words, feedback delay 0 +([`overlays/gnss-spi-fb0.dtso`](overlays/gnss-spi-fb0.dtso)), automatic chip +select ([`overlays/gnss-spi-autocs.dtso`](overlays/gnss-spi-autocs.dtso), the +`google,gs101-spi` compatible), 64-byte reads (`gnss_spi piece=64`, one +transfer that fills the FIFO, polled whole since #138), no software realign. +**The byte swap needs no new DT property**: Google's `swap-mode` (the +controller's SWAP_CFG, commit 11ea0ef5e on the bring-up branch) works, and so +does swapping in gnss_spi (`word32=2`, commit 734f5f8c8 on +`tegu-gnss-spi-bringup`): 54 of 56 GGA fixed, 10 satellites, HDOP 1.2, no +errors, on a boot without the swap-mode property. The palmtop runs the +software swap. + +**The CP link hang under GNSS traffic, G3-L1's first step answered.** With +GNSS running for minutes, the hang of 10-29 came back once +(CLUSTER0_NONCPU_WDTRESET about 260 s into a session, after 62 fixes). +cpif's `keep_link_up` (bring-up module `cpif-keep-link.ko`, branch +`tegu-cpif-keep-link`, 3f76f123b) set at load keeps the CP from ever reaching +ONLINE (`cbd exit 143 and the CP is BOOTING`): the CP needs its link +power cycles while it boots. The parameter is writable at runtime (0644); set +after ONLINE, the link is never isolated again, and both sessions above ran +with it. So the hang is a link-down access while GNSS traffic flows, as the +10-29 console reading said; holding the link after ONLINE is the bring-up +answer until CPIF's power-off path is made safe. + +**How the sweep got there** (runners in the owner's +`logs/tegu-review-20261029/runners/05-g3a*.sh`, not in git): +- G3-A2: 32-bit words with swap-mode; the first Image, built from the GNSS + worktree, lacked the S2MPG15 regulator work (6 regulators instead of 28, + no GNSS rails) and was rebuilt from the gn3 tree. The reads showed the + reply frames intact but 2, 4 and 6 bits late in successive reads. +- SPI modes 0-3 (a `spi_mode` override in gnss_spi): mode 3 brought the link + up once (24 frames), but marginally; the same boot again failed. +- Feedback delays 1-3 with mode 3: a stable offset per boot (1 or 3 bits), + different from boot to boot. +- Software realign in gnss_spi: `realign=3` (offset found from each read's + preamble) got 86 of 173 frames valid; `realign=4` (carrying the bits + across reads) made it worse, which showed the stream isn't continuous + across reads, so bits were being lost between transfers. +- The pins at drive 3: frames inside a read clean, offsets still changing. +- The flush order: offsets gone, link up, a fix. + +**Left for GNSS:** the GNSS link driver (gnssif) and CPIF aren't in the +published kernel, so this runs on the owner's kernel only; #150 and #151 are +open; the link hold is a runtime parameter of a bring-up CPIF build, and a +proper fix belongs in CPIF's power-off path; GNSS still starts by hand +([`bringup/tegu-gnss-session`](bringup/tegu-gnss-session), which starts the +modem, holds the link after ONLINE and runs the HAL for a set time; once per +boot). The bring-up start script +[`bringup/omamobile-tegu-modem-up`](bringup/omamobile-tegu-modem-up) loads +`cpif-keep-link.ko keep_link_up=0` and `gnss_spi.ko word32=2 piece=64 +spi_mode=0`. + ### Suspend with the modem on (2026-10-27, early morning, same kernel) - **What ran:** s2idle on `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty` diff --git a/device/tegu/NOTES.md b/device/tegu/NOTES.md index 292ac9254..7bdc78111 100644 --- a/device/tegu/NOTES.md +++ b/device/tegu/NOTES.md @@ -13,6 +13,17 @@ hash/build ID; this dirty release is not a published kernel package. `[V]` marks verified observations; `[I]` marks an inference still to test. Raw captures, recordings, backups and vendor files remain off repository. +## 2026-10-30, evening: GNSS gets a fix + +The receiver gets a position fix on the owner's kernel: up to 13 satellites +used, HDOP 0.8-1.2, GPS, Galileo, BeiDou and GLONASS tracked, CHPP clean +over 3- and 10-minute sessions with no reset. Two fixes did it: spi-s3c64xx +turned the channels off after clearing the packet count, which lost a few +bits per transfer on a streaming slave (linux-omarchy-mobile#150), and the +GNSS SPI's pins ran on the bootloader's drive 0 (#151). The CP link hang under +GNSS traffic goes away with cpif's link held up after ONLINE. Details, the +configuration and the sweep in [MODEM-PLAN](MODEM-PLAN.md) "G3, resolved". + ## 2026-10-29: two resets at about 34 s, right after Bluetooth started [V] During the night's GNSS G3 tries (kernel diff --git a/device/tegu/bringup/omamobile-tegu-modem-up b/device/tegu/bringup/omamobile-tegu-modem-up index 4063c5a1e..f86e5671b 100755 --- a/device/tegu/bringup/omamobile-tegu-modem-up +++ b/device/tegu/bringup/omamobile-tegu-modem-up @@ -22,14 +22,18 @@ if [[ -d /sys/module/cpif ]]; then say "CPIF was loaded earlier this boot; reboot before starting the modem again"; exit 1 fi [[ -e /sys/bus/platform/devices/154e0000.pinctrl ]] || { say "no FAR_ALIVE pinctrl (old DTB)"; exit 1; } -for f in tegu-modem-cpif-activate.ko tegu-pcie0-cp.ko shm_ipc.ko cpif.ko gnss_spi.ko gnssif.ko; do +for f in tegu-modem-cpif-activate.ko tegu-pcie0-cp.ko shm_ipc.ko cpif.ko cpif-keep-link.ko gnss_spi.ko gnssif.ko; do [[ -f $M/$f ]] || { say "missing $M/$f"; exit 1; } done insmod $M/tegu-modem-cpif-activate.ko activate=1 insmod $M/tegu-pcie0-cp.ko allow_hw=1 insmod $M/shm_ipc.ko -insmod $M/cpif.ko -insmod $M/gnss_spi.ko +# cpif built with keep_link_up (bring-up, branch tegu-cpif-keep-link 3f76f123b): +# off at load, or the CP never reaches ONLINE; tegu-gnss-session turns it on +# after ONLINE (MODEM-PLAN G3, resolved) +insmod $M/cpif-keep-link.ko keep_link_up=0 +# stock's GNSS SPI setup: mode 0, 32-bit words swapped in gnss_spi, 64-byte reads +insmod $M/gnss_spi.ko word32=2 piece=64 spi_mode=0 insmod $M/gnssif.ko echo performance > /sys/module/pcie_aspm/parameters/policy 2>/dev/null || true /usr/lib/omamobile-vendor/omamobile-vendor-chroot modem check diff --git a/device/tegu/bringup/tegu-gnss-session b/device/tegu/bringup/tegu-gnss-session new file mode 100755 index 000000000..476b2ac52 --- /dev/null +++ b/device/tegu/bringup/tegu-gnss-session @@ -0,0 +1,31 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Pixel 9a bring-up: one GNSS session (MODEM-PLAN G3, resolved). Checks the +# GNSS rails, starts the modem with GNSS (omamobile-tegu-modem-up --gnss), +# holds the CP link up once the CP is ONLINE (cpif keep_link_up=1; at load it +# would keep the CP from booting), starts the gnss-slsi HAL and its client for +# SECS seconds (default 180), then saves the HAL's NMEA, the SPI dump and the +# modem log under /var/log/omamobile/g7min. +# It starts the modem: once per boot. Reboot before running it again. +# tegu-gnss-session [SECS] +set -uo pipefail +SECS=${1:-180} +O=/var/log/omamobile/g7min; rm -rf "$O"; mkdir -p "$O" +say() { printf 'g7min: %s\n' "$*"; } +for n in gnss-core gnss-rf gnss-aux; do + r=$(grep -lx "$n" /sys/class/regulator/*/name 2>/dev/null | head -1) + [[ -n $r && $(cat "$(dirname "$r")/state") == enabled ]] || { say "STOP: $n"; exit 1; } +done +/usr/local/bin/omamobile-tegu-modem-up --gnss || { say "STOP: modem not ONLINE"; exit 1; } +echo 1 > /sys/module/cpif/parameters/keep_link_up 2>/dev/null && say "link held up from here (keep_link_up=1)" +for _ in $(seq 1 120); do pgrep -x gnssd >/dev/null && break; sleep 0.25; done +pgrep -x gnssd >/dev/null || { say "STOP: no gnssd"; exit 1; } +dmesg -C +sleep 5 +systemd-run -q --unit=x-gnss-slsi -p KillMode=control-group sh -c \ + "OMAMOBILE_GNSS_NMEA_OUT=stdout /usr/lib/omamobile-vendor/omamobile-vendor-chroot gnss-slsi start > $O/gnss-slsi.log 2>&1" +sleep "$SECS" +systemctl stop x-gnss-slsi 2>/dev/null +dmesg | grep -a "gnss_spi: " > "$O/rx.txt" +tail -n 400 /var/log/omamobile/modem.log > "$O/modem.log" +say "done: $(wc -l < "$O/rx.txt") dump lines" diff --git a/device/tegu/overlays/gnss-spi-autocs.dtso b/device/tegu/overlays/gnss-spi-autocs.dtso new file mode 100644 index 000000000..6cfe76730 --- /dev/null +++ b/device/tegu/overlays/gnss-spi-autocs.dtso @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-only +/dts-v1/; +/plugin/; + +/* + * Pixel 9a bring-up only; in no device's default DTB_OVERLAYS + * (MODEM-PLAN G3, resolved; the palmtop's run kit applies it): the GNSS SPI with + * the controller's automatic chip select, as Google's driver uses for + * this device (no samsung,spi-chip-select-mode). Upstream this becomes the + * SPI21 node's own compatible choice once the GNSS driver is in. Dropping the + * google,zumapro-spi compatible leaves google,gs101-spi, for which + * spi-s3c64xx in this tree lets the controller drive chip select itself. + * Applied to the palmtop's integration DTB (gn3). + */ +&spi21 { + compatible = "google,gs101-spi"; +}; diff --git a/device/tegu/overlays/gnss-spi-fb0.dtso b/device/tegu/overlays/gnss-spi-fb0.dtso new file mode 100644 index 000000000..df73dcc42 --- /dev/null +++ b/device/tegu/overlays/gnss-spi-fb0.dtso @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-only +/dts-v1/; +/plugin/; + +/* + * Pixel 9a bring-up only; in no device's default DTB_OVERLAYS + * (MODEM-PLAN G3, resolved; the palmtop's run kit applies it): the GNSS SPI with + * stock's feedback delay 0 instead of the ported node's 2. Upstream this is + * the GNSS node's controller-data once the GNSS driver is in. Applied to + * the palmtop's integration DTB (gn3), which has the spi21 label. + */ +&spi21 { + gnss@0 { + controller-data { + samsung,spi-feedback-delay = <0>; + }; + }; +}; diff --git a/device/tegu/overlays/gnss-spi-pins.dtso b/device/tegu/overlays/gnss-spi-pins.dtso new file mode 100644 index 000000000..776cc019e --- /dev/null +++ b/device/tegu/overlays/gnss-spi-pins.dtso @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-only +/dts-v1/; +/plugin/; + +/* + * Pixel 9a bring-up only; in no device's default DTB_OVERLAYS + * (MODEM-PLAN G3, resolved; the palmtop's run kit applies it): the GNSS SPI's + * pins. Replaced upstream by linux-omarchy-mobile#151, which describes the + * same pins in zumapro-tegu.dts. Our SPI21 node has no pinctrl, so the bus runs on the + * bootloader's pin state: gpp22-0..3 in function 2 at drive 0, gpp22-2 + * pulled down. This gives them function 2 and drive 3 (as gpp21, the + * other SPI bus on PERIC1), keeping the pulls as found. + */ +&pinctrl_peric1 { + gnss_spi_pins: gnss-spi-pins { + samsung,pins = "gpp22-0", "gpp22-1", "gpp22-3"; + samsung,pin-function = <2>; + samsung,pin-pud = <0>; + samsung,pin-drv = <3>; + }; + gnss_spi_miso: gnss-spi-miso-pins { + samsung,pins = "gpp22-2"; + samsung,pin-function = <2>; + samsung,pin-pud = <1>; + samsung,pin-drv = <3>; + }; +}; + +&spi21 { + pinctrl-names = "default"; + pinctrl-0 = <&gnss_spi_pins &gnss_spi_miso>; +}; From 407b764063d4b9474fc648079f0e257c47c1b2bf Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:01:15 -0643 Subject: [PATCH 02/30] MODEM-PLAN, NOTES, AGENTS: the link hold crashes the CP; the fix lasts a minute per boot --- AGENTS.md | 2 +- device/tegu/MODEM-PLAN.md | 47 +++++++++++++++++---------- device/tegu/NOTES.md | 10 +++--- device/tegu/bringup/tegu-gnss-session | 7 ++-- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b84fb8870..c6a234454 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -183,7 +183,7 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link - **Volume Up is the one key without an internal pull** (`PUD` 0x0, as on stock), and the first freeze woke 3 s in from it with nobody touching it. It didn't recur in the 51 RTC cycles of S4 and S5c, and it isn't proven to be a false edge; if spurious wakes recur, check gpa8-5's power-down pull before blaming the wake path. - **UFS ran its error handler around modem power changes** (PA LINERESET indications, recovered without a reset). Stock's DT shows no shared rail, clock or pin. M2.5 narrowed it down: power-on and a running link are clean, but every modem power-off is followed by one recovered UFS error-handler pass (a PA LINERESET, no I/O errors or resets). Stock powers the modem off only at shutdown, so the modem stays on once it is up (M2.6 is open), and a reboot with the modem up costs one such pass. Keep modem tests attended, don't power-cycle the modem, and check `dmesg | grep ufshcd_err_handler` after each step. [MODEM-PLAN](device/cheetah/MODEM-PLAN.md) M2, M2.5, M2.6 - **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, which alone resets the 9a in s2idle, so the modem's part is unknown. CPIF's PM paths are wake-armed in code, but M6 is design only and no SIM test has happened (M4.2). Keep modem tests on the charger, so upower's critical action doesn't suspend the phone mid-test. [MODEM-PLAN](device/cheetah/MODEM-PLAN.md) 6.3, [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" -- **On the 9a, hold the CP link up only after ONLINE.** CPIF powers the PCIe link down whenever the CP asks, and a link-down access under GNSS traffic hangs the SoC (CLUSTER0_NONCPU_WDTRESET). The bring-up cpif's `keep_link_up=1` stops that, but set at module load it keeps the CP from ever reaching ONLINE (it needs its link cycles while booting): load with `keep_link_up=0` and write 1 to `/sys/module/cpif/parameters/keep_link_up` after ONLINE, as `device/tegu/bringup/tegu-gnss-session` does. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, resolved" +- **On the 9a, never hold the CP's PCIe link up for long, and never from module load.** CPIF powers the link down whenever the CP asks, and a link-down access under GNSS traffic hangs the SoC (CLUSTER0_NONCPU_WDTRESET, about 170 s after ONLINE). The bring-up cpif's `keep_link_up=1` stops the hang, but set at module load it keeps the CP from reaching ONLINE (it needs its link cycles while booting), and set after ONLINE the CP crashes 103-108 s later, every boot (`ONLINE -> CRASH_EXIT`, 2026-10-30). Use it only as a diagnostic in a short session. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, resolved" - **Never `systemctl restart omamobile-modem` (or stop and start it) to recover a crashed modem.** An in-place restart left raven's CP in BOOTING, and a bring-up that never reaches ONLINE sets a latch that makes the next boot skip the modem. Reboot instead. If a boot skipped it, remove the latch (`rm /var/lib/omamobile/modem-bringup-started`) and `systemctl start omamobile-modem`; `/usr/lib/omamobile-vendor/omamobile-modem-start --retry` also clears it, but run by hand it brings the modem up outside the unit (a stray `rfsd` in your shell's session). [raven MODEM-PLAN](device/raven/MODEM-PLAN.md) D4. The same on the 9a: after the modem profile has stopped, starting it again in the same boot reset the palmtop silently, a watchdog reset with nothing in pstore (the one try was in the rfsd stage). [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) G3 - **Linux never writes the modem's NV.** The modem chroot profile (cbd, rfsd) refuses to start unless the NV partitions read `ro=1` and none is mounted, works on checksum-verified RAM copies only, and loses what the modem writes at stop. Don't give the chroot a real block device. diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index a5370fec8..d50730203 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -11,8 +11,11 @@ G1-G2 passed: gnssd loads Kepler's firmware and talks CHPP over SPI; The CHPP link lost bits because spi-s3c64xx's flush cleared the packet count before turning the channels off (derekross/linux-omarchy-mobile#150) and because the GNSS SPI's pins ran on -the bootloader's drive 0 (#151); the CP link hang under GNSS traffic goes -away with the link held up after ONLINE. Section "G3, resolved" below. +the bootloader's drive 0 (#151). Open: the CP link under GNSS traffic. Held +up (cpif `keep_link_up=1` after ONLINE) the CP crashes 103-108 s after +ONLINE, six boots of six; left to cycle, the SoC hangs about 170 s after +ONLINE (the 10-29 hang), so a fix lasts about a minute. Section "G3, +resolved" below, and G3-L1. Left: the GNSS and CPIF drivers aren't in the published kernel, and GNSS still starts by hand. Next: the SIM. The staged plan (sections F, K, U and runbooks M0.2-M6, G1-G4) is below, @@ -982,17 +985,26 @@ does swapping in gnss_spi (`word32=2`, commit 734f5f8c8 on errors, on a boot without the swap-mode property. The palmtop runs the software swap. -**The CP link hang under GNSS traffic, G3-L1's first step answered.** With -GNSS running for minutes, the hang of 10-29 came back once -(CLUSTER0_NONCPU_WDTRESET about 260 s into a session, after 62 fixes). -cpif's `keep_link_up` (bring-up module `cpif-keep-link.ko`, branch -`tegu-cpif-keep-link`, 3f76f123b) set at load keeps the CP from ever reaching -ONLINE (`cbd exit 143 and the CP is BOOTING`): the CP needs its link -power cycles while it boots. The parameter is writable at runtime (0644); set -after ONLINE, the link is never isolated again, and both sessions above ran -with it. So the hang is a link-down access while GNSS traffic flows, as the -10-29 console reading said; holding the link after ONLINE is the bring-up -answer until CPIF's power-off path is made safe. +**The CP link under GNSS traffic, G3-L1's first step answered, and a +correction.** With GNSS running for minutes on the normal boot, the hang of +10-29 came back once (CLUSTER0_NONCPU_WDTRESET about 260 s into the boot, +170 s after ONLINE, after 62 fixes). cpif's `keep_link_up` (bring-up module +`cpif-keep-link.ko`, branch `tegu-cpif-keep-link`, 3f76f123b) set at load +keeps the CP from ever reaching ONLINE (`cbd exit 143 and the CP is +BOOTING`): the CP needs its link power cycles while it boots. Set after +ONLINE (the parameter is 0644), no hang followed, and that is as far as the +good news goes: in every one of the six boots that held the link (18:31 to +19:31), `cp_active_handler` saw PHONE_ACTIVE drop 103-108 s after ONLINE +(`ONLINE -> CRASH_EXIT`, the CP's own crash, nothing in the kernel log +before it, CHPP healthy: 9 bad checksums in thousands of frames), gnssd went +into crash handling and the modem profile stopped. The sessions first +reported as clean 3- and 10-minute runs were not: their 38-56 GGA sentences +are about a minute of fixes before that crash, which the counting (fixed of +total) hid. So: the hang is a link-down access while GNSS traffic flows, as +the 10-29 console reading said, and refusing the CP's power-down crashes +the CP about 105 s later. `keep_link_up` is a diagnostic, not an answer; +the answer is in CPIF's power-off path (G3-L1's trace: which BAR access +lands after isolation), so that the link may cycle as the CP asks. **How the sweep got there** (runners in the owner's `logs/tegu-review-20261029/runners/05-g3a*.sh`, not in git): @@ -1013,11 +1025,12 @@ answer until CPIF's power-off path is made safe. **Left for GNSS:** the GNSS link driver (gnssif) and CPIF aren't in the published kernel, so this runs on the owner's kernel only; #150 and #151 are -open; the link hold is a runtime parameter of a bring-up CPIF build, and a -proper fix belongs in CPIF's power-off path; GNSS still starts by hand +open; the CP link under GNSS traffic is unsolved (above: the hold crashes +the CP, the cycling hangs the SoC), so a fix lasts about a minute per boot +until CPIF's power-off path is made safe; GNSS still starts by hand ([`bringup/tegu-gnss-session`](bringup/tegu-gnss-session), which starts the -modem, holds the link after ONLINE and runs the HAL for a set time; once per -boot). The bring-up start script +modem, holds the link after ONLINE for the diagnostic and runs the HAL for a +set time; once per boot). The bring-up start script [`bringup/omamobile-tegu-modem-up`](bringup/omamobile-tegu-modem-up) loads `cpif-keep-link.ko keep_link_up=0` and `gnss_spi.ko word32=2 piece=64 spi_mode=0`. diff --git a/device/tegu/NOTES.md b/device/tegu/NOTES.md index 7bdc78111..1097e40a9 100644 --- a/device/tegu/NOTES.md +++ b/device/tegu/NOTES.md @@ -17,12 +17,14 @@ Raw captures, recordings, backups and vendor files remain off repository. The receiver gets a position fix on the owner's kernel: up to 13 satellites used, HDOP 0.8-1.2, GPS, Galileo, BeiDou and GLONASS tracked, CHPP clean -over 3- and 10-minute sessions with no reset. Two fixes did it: spi-s3c64xx +for about a minute per boot. Two fixes did it: spi-s3c64xx turned the channels off after clearing the packet count, which lost a few bits per transfer on a streaming slave (linux-omarchy-mobile#150), and the -GNSS SPI's pins ran on the bootloader's drive 0 (#151). The CP link hang under -GNSS traffic goes away with cpif's link held up after ONLINE. Details, the -configuration and the sweep in [MODEM-PLAN](MODEM-PLAN.md) "G3, resolved". +GNSS SPI's pins ran on the bootloader's drive 0 (#151). What ends the fix is +the CP link under GNSS traffic: held up it crashes the CP 103-108 s after +ONLINE (six boots of six), left to cycle it hangs the SoC about 170 s after +ONLINE. Details, the configuration and the sweep in +[MODEM-PLAN](MODEM-PLAN.md) "G3, resolved". ## 2026-10-29: two resets at about 34 s, right after Bluetooth started diff --git a/device/tegu/bringup/tegu-gnss-session b/device/tegu/bringup/tegu-gnss-session index 476b2ac52..e4e4b8f98 100755 --- a/device/tegu/bringup/tegu-gnss-session +++ b/device/tegu/bringup/tegu-gnss-session @@ -2,8 +2,9 @@ # SPDX-License-Identifier: MIT # Pixel 9a bring-up: one GNSS session (MODEM-PLAN G3, resolved). Checks the # GNSS rails, starts the modem with GNSS (omamobile-tegu-modem-up --gnss), -# holds the CP link up once the CP is ONLINE (cpif keep_link_up=1; at load it -# would keep the CP from booting), starts the gnss-slsi HAL and its client for +# with HOLD=1 holds the CP link up once the CP is ONLINE (cpif keep_link_up=1, +# a diagnostic: the CP then crashes 103-108 s later; at load it would keep the +# CP from booting), starts the gnss-slsi HAL and its client for # SECS seconds (default 180), then saves the HAL's NMEA, the SPI dump and the # modem log under /var/log/omamobile/g7min. # It starts the modem: once per boot. Reboot before running it again. @@ -17,7 +18,7 @@ for n in gnss-core gnss-rf gnss-aux; do [[ -n $r && $(cat "$(dirname "$r")/state") == enabled ]] || { say "STOP: $n"; exit 1; } done /usr/local/bin/omamobile-tegu-modem-up --gnss || { say "STOP: modem not ONLINE"; exit 1; } -echo 1 > /sys/module/cpif/parameters/keep_link_up 2>/dev/null && say "link held up from here (keep_link_up=1)" +[[ ${HOLD:-0} == 1 ]] && echo 1 > /sys/module/cpif/parameters/keep_link_up 2>/dev/null && say "link held up from here (keep_link_up=1; the CP crashes about 105 s after ONLINE)" for _ in $(seq 1 120); do pgrep -x gnssd >/dev/null && break; sleep 0.25; done pgrep -x gnssd >/dev/null || { say "STOP: no gnssd"; exit 1; } dmesg -C From 0084409937c789ecc8ed69b37370bf487db54a6d Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:55:36 -0643 Subject: [PATCH 03/30] device/tegu: the hand units that put the 9a's GNSS behind Omarchy's Location switch omamobile-gnss.service loads a GNSS chip driver and runs the gnss vendor profile, which is right for the 7 Pro's BCM4775x. On the 9a the receiver is the modem's GNSS core, so the stack is the modem with GNSS plus the gnss-slsi profile. These are the two drop-ins and the start script the palmtop runs, so the switch starts the receiver and GeoClue's clients get its NMEA. --- .../omamobile-gnss-nmea.service.d-tegu.conf | 8 ++++ .../omamobile-gnss.service.d-tegu.conf | 10 +++++ device/tegu/bringup/location/tegu-gnss-start | 37 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 device/tegu/bringup/location/omamobile-gnss-nmea.service.d-tegu.conf create mode 100644 device/tegu/bringup/location/omamobile-gnss.service.d-tegu.conf create mode 100755 device/tegu/bringup/location/tegu-gnss-start diff --git a/device/tegu/bringup/location/omamobile-gnss-nmea.service.d-tegu.conf b/device/tegu/bringup/location/omamobile-gnss-nmea.service.d-tegu.conf new file mode 100644 index 000000000..3f74cd90f --- /dev/null +++ b/device/tegu/bringup/location/omamobile-gnss-nmea.service.d-tegu.conf @@ -0,0 +1,8 @@ +# Pixel 9a (hand unit, 2026-10-30): the NMEA FIFO is the gnss-slsi profile state. +[Service] +ExecStartPre= +ExecStartPre=/bin/sh -c "for i in $(seq 1 900); do [ -p /var/lib/omamobile-vendor/gnss-slsi/data/vendor/gps/nmea_out ] && exit 0; sleep 0.2; done; exit 1" +ExecStart= +ExecStart=/usr/lib/omamobile-vendor/omamobile-gnss-nmea --fifo /var/lib/omamobile-vendor/gnss-slsi/data/vendor/gps/nmea_out --idle-exit 60 +ReadWritePaths=-/var/lib/omamobile-vendor/gnss-slsi/data/vendor/gps -/run/omamobile-gnss +TimeoutStartSec=240 diff --git a/device/tegu/bringup/location/omamobile-gnss.service.d-tegu.conf b/device/tegu/bringup/location/omamobile-gnss.service.d-tegu.conf new file mode 100644 index 000000000..3652faf80 --- /dev/null +++ b/device/tegu/bringup/location/omamobile-gnss.service.d-tegu.conf @@ -0,0 +1,10 @@ +# Pixel 9a (hand unit, 2026-10-30): the GNSS stack is the modem profile plus gnss-slsi. +[Unit] +ConditionPathExists= +ConditionPathExists=/usr/lib/omamobile-vendor/gnss-slsi/root +[Service] +ExecStart= +ExecStart=/usr/bin/systemd-inhibit --what=sleep --mode=block "--who=Omarchy Mobile GNSS" "--why=A location session is running" /usr/local/sbin/tegu-gnss-start +ExecStop= +ExecStop=/usr/lib/omamobile-vendor/omamobile-vendor-chroot gnss-slsi stop +TimeoutStartSec=240 diff --git a/device/tegu/bringup/location/tegu-gnss-start b/device/tegu/bringup/location/tegu-gnss-start new file mode 100755 index 000000000..491f38433 --- /dev/null +++ b/device/tegu/bringup/location/tegu-gnss-start @@ -0,0 +1,37 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# tegu-gnss-start: the Pixel 9a's GNSS stack for omamobile-gnss.service, so +# that Omarchy's Location switch starts it (MODEM-PLAN G3, resolved). +# +# On the 7 Pro omamobile-gnss.service loads a GNSS chip driver and runs the +# gnss vendor profile. On the 9a the receiver is the modem's own GNSS core, so +# the stack is: the modem up with GNSS (gnssd listens on @GNSSND), then the +# gnss-slsi profile with its NMEA on the FIFO omamobile-gnss-nmea reads. +# +# Two bring-up limits, both in the plan: the modem starts once per boot (a +# second start needs a reboot), and the CP's PCIe link under GNSS traffic is +# unsolved, so a session lasts a minute or two. HOLD picks which way it fails: +# 2 (default) holds the link and answers the CP on ap2cp_wakeup, 1 holds it +# with the line high (the CP then crashes 103-108 s after ONLINE), 0 lets the +# link cycle (the SoC hangs about 170 s after ONLINE). +# +# Install: /usr/local/sbin, with the two drop-ins beside this file. +set -euo pipefail +say() { printf "tegu-gnss: %s\n" "$*" >&2; } +grep -qs okay /sys/firmware/devicetree/base/soc/usi@111e00c0/spi@111e0000/status || + { say "SPI21 is not enabled in this device tree; nothing to do"; exit 0; } +if ! systemctl is-active -q omamobile-tegu-modem; then + if [[ -d /sys/module/cpif ]]; then + say "the modem ran this boot and is down; reboot before turning location on again"; exit 1 + fi + /usr/local/bin/omamobile-tegu-modem-up --gnss +fi +# The CP's link: see HOLD in the header. Nothing here fixes it; this only +# chooses which failure the session gets. +echo "${HOLD:-2}" > /sys/module/cpif/parameters/keep_link_up 2>/dev/null && + say "CP link: keep_link_up=$(cat /sys/module/cpif/parameters/keep_link_up)" +for _ in $(seq 1 120); do grep -q "@GNSSND" /proc/net/unix && break; sleep 0.25; done +grep -q "@GNSSND" /proc/net/unix || { say "gnssd is not listening (the modem profile ran without GNSS?)"; exit 1; } +sleep 5 # let gnssd settle before the HAL opens the link +mkdir -p /run/omamobile-gnss && touch /run/omamobile-gnss/pinned +exec env OMAMOBILE_GNSS_NMEA_OUT=fifo /usr/lib/omamobile-vendor/omamobile-vendor-chroot gnss-slsi start From 42825f00eccf9fd0b7586cdbf9807e5d942d8080 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:56:05 -0643 Subject: [PATCH 04/30] MODEM-PLAN: the Location switch on the 9a, and the doorbell guard that didn't stop the hang --- device/tegu/MODEM-PLAN.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index d50730203..e6aa2f9a4 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1030,7 +1030,35 @@ the CP, the cycling hangs the SoC), so a fix lasts about a minute per boot until CPIF's power-off path is made safe; GNSS still starts by hand ([`bringup/tegu-gnss-session`](bringup/tegu-gnss-session), which starts the modem, holds the link after ONLINE for the diagnostic and runs the HAL for a -set time; once per boot). The bring-up start script +set time; once per boot), or through Omarchy's Location switch with the hand +units in [`bringup/location/`](bringup/location): two drop-ins that make +`omamobile-gnss.service` run the 9a's stack instead of the 7 Pro's chip +driver, and `tegu-gnss-start`, which brings the modem up with GNSS and runs +the gnss-slsi profile with its NMEA on the FIFO `omamobile-gnss-nmea` reads. +Tested on 2026-10-30: `omamobile-gnss-nmea.socket` enabled, a client's connect +starts the stack, the HAL serves NMEA to `/run/omamobile-gnss/nmea.sock` and +the fixes arrive (first fix about 80 s after the connect, 46 of 52 GGA +sentences fixed in the first run), for as long as the CP link lasts. The +package's own units are masked on the 9a by the boot command line +(`systemd.mask=omamobile-gnss.service` in `package-startup.dtso`), so the +switch needs that mask dropped as well. + +**The doorbell under the controller's lock didn't stop the hang.** The modem +driver's doorbell write and its read-back loop in the modem's BAR window were +the clearest unguarded access in the window (the read-back retries for up to +100 ms, and the CP can ask for the link down inside it), so the controller got +a doorbell access that runs under `cfg_lock`, the lock `cp_link_down()` takes +to clear `cfg_ep_ok` (branch `tegu-cpif-doorbell`, ee8ce0061 on the owner's +fork). With it, a 10-minute GNSS session ran 26 minutes into the boot before +the same hang (`CLUSTER0_NONCPU_WDTRESET`, the console ending mid-cycle right +after `wake enabled for irq 96`), so the doorbell is not it, or not all of it. +What is left in that window: the MSI set-up and `s51xx_pcie_restore_state()` +on the way up, CPIF's own status reads, and the cycle itself (PHY isolate and +un-isolate twice a second, each with its PMU write through the secure +monitor). The trace of G3-L1 is the next step, now with the doorbell ruled +out. + +The bring-up start script [`bringup/omamobile-tegu-modem-up`](bringup/omamobile-tegu-modem-up) loads `cpif-keep-link.ko keep_link_up=0` and `gnss_spi.ko word32=2 piece=64 spi_mode=0`. From 96cf092b1a4f82e9a8c24d07ef9085ef0d70858f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 21:11:34 -0643 Subject: [PATCH 05/30] MODEM-PLAN, AGENTS: the CP link three ways, and why ap2cp_wakeup decides it --- AGENTS.md | 2 +- device/tegu/MODEM-PLAN.md | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index c6a234454..fcefa6e70 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -183,7 +183,7 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link - **Volume Up is the one key without an internal pull** (`PUD` 0x0, as on stock), and the first freeze woke 3 s in from it with nobody touching it. It didn't recur in the 51 RTC cycles of S4 and S5c, and it isn't proven to be a false edge; if spurious wakes recur, check gpa8-5's power-down pull before blaming the wake path. - **UFS ran its error handler around modem power changes** (PA LINERESET indications, recovered without a reset). Stock's DT shows no shared rail, clock or pin. M2.5 narrowed it down: power-on and a running link are clean, but every modem power-off is followed by one recovered UFS error-handler pass (a PA LINERESET, no I/O errors or resets). Stock powers the modem off only at shutdown, so the modem stays on once it is up (M2.6 is open), and a reboot with the modem up costs one such pass. Keep modem tests attended, don't power-cycle the modem, and check `dmesg | grep ufshcd_err_handler` after each step. [MODEM-PLAN](device/cheetah/MODEM-PLAN.md) M2, M2.5, M2.6 - **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, which alone resets the 9a in s2idle, so the modem's part is unknown. CPIF's PM paths are wake-armed in code, but M6 is design only and no SIM test has happened (M4.2). Keep modem tests on the charger, so upower's critical action doesn't suspend the phone mid-test. [MODEM-PLAN](device/cheetah/MODEM-PLAN.md) 6.3, [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" -- **On the 9a, never hold the CP's PCIe link up for long, and never from module load.** CPIF powers the link down whenever the CP asks, and a link-down access under GNSS traffic hangs the SoC (CLUSTER0_NONCPU_WDTRESET, about 170 s after ONLINE). The bring-up cpif's `keep_link_up=1` stops the hang, but set at module load it keeps the CP from reaching ONLINE (it needs its link cycles while booting), and set after ONLINE the CP crashes 103-108 s later, every boot (`ONLINE -> CRASH_EXIT`, 2026-10-30). Use it only as a diagnostic in a short session. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, resolved" +- **On the 9a, the CP's PCIe link has to cycle, and `ap2cp_wakeup` is why.** CPIF powers the link down whenever the CP asks, and a link-down access under GNSS traffic hangs the SoC (`CLUSTER0_NONCPU_WDTRESET`). The bring-up cpif's `keep_link_up` stops the hang and costs the link: with the wake line left high (1) the CP crashes 103-108 s after ONLINE, every boot; with the line answered (2) nothing crashes for 16 minutes and the GNSS bus never transfers a byte, because a low wake line tells the CP the AP doesn't want the link. So don't hold the link to make a session last; guard the accesses in the cycling window instead (the doorbell one is "PCI: gs201-cp, cpif: ring the modem's doorbell under the link lock", which moved the hang from 170 s to 26 minutes). [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, resolved" - **Never `systemctl restart omamobile-modem` (or stop and start it) to recover a crashed modem.** An in-place restart left raven's CP in BOOTING, and a bring-up that never reaches ONLINE sets a latch that makes the next boot skip the modem. Reboot instead. If a boot skipped it, remove the latch (`rm /var/lib/omamobile/modem-bringup-started`) and `systemctl start omamobile-modem`; `/usr/lib/omamobile-vendor/omamobile-modem-start --retry` also clears it, but run by hand it brings the modem up outside the unit (a stray `rfsd` in your shell's session). [raven MODEM-PLAN](device/raven/MODEM-PLAN.md) D4. The same on the 9a: after the modem profile has stopped, starting it again in the same boot reset the palmtop silently, a watchdog reset with nothing in pstore (the one try was in the rfsd stage). [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) G3 - **Linux never writes the modem's NV.** The modem chroot profile (cbd, rfsd) refuses to start unless the NV partitions read `ro=1` and none is mounted, works on checksum-verified RAM copies only, and loses what the modem writes at stop. Don't give the chroot a real block device. diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index e6aa2f9a4..498ea28c0 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1058,6 +1058,28 @@ un-isolate twice a second, each with its PMU write through the secure monitor). The trace of G3-L1 is the next step, now with the doorbell ruled out. +**The CP link, three ways, none of them good (2026-10-30 night, same +kernel plus the doorbell commit).** `keep_link_up` now takes a value, and +each one fails differently, which between them says what the link is for: + +| cpif `keep_link_up` | What the link does | Result | +| --- | --- | --- | +| 0 | cycles twice a second under GNSS traffic | fixes arrive; the SoC hangs. About 170 s after ONLINE without the doorbell commit (five boots); with it, one session reached 26 minutes of uptime before the same `CLUSTER0_NONCPU_WDTRESET`, the console ending mid-cycle right after `wake enabled for irq 96` | +| 1 | held up, `ap2cp_wakeup` left high | fixes arrive for about a minute; the CP crashes 103-108 s after ONLINE (`PHONE_ACTIVE` drops, `ONLINE -> CRASH_EXIT`), six boots of six | +| 2 | held up, `ap2cp_wakeup` answered as the full path does | nothing hangs and nothing crashes: 16 minutes with the modem ONLINE, no isolation, no UFS error. And no GNSS at all: `gnss_spi` transferred nothing all boot, the HAL reported status 1 and 3 and served no sentence | + +So `ap2cp_wakeup` is not a formality: high means the AP wants the link, and +the CP stops serving GNSS when it goes low, while leaving it high with the +link held makes the CP declare a fault. The link has to cycle, and the +answer is to make the cycling safe. The doorbell commit moved the hang from +170 s to 26 minutes, so that access was one of the unguarded ones but not +the last. What is left in the window: the MSI set-up and +`s51xx_pcie_restore_state()` on the way up, CPIF's own BAR reads +(`offset_boot_indicator`, the capability and magic words, the queue +head/tail if any of them sit in the window rather than in the reserved +DRAM), and the cycle itself, each step of which writes the PMU through the +secure monitor. That is G3-L1's trace, and it is next. + The bring-up start script [`bringup/omamobile-tegu-modem-up`](bringup/omamobile-tegu-modem-up) loads `cpif-keep-link.ko keep_link_up=0` and `gnss_spi.ko word32=2 piece=64 From 4afc11fa35528d5463b0f45f014a6f17fa3011ed Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 22:01:10 -0643 Subject: [PATCH 06/30] MODEM-PLAN: every register path in the link-cycling window, audited; none is unguarded --- device/tegu/MODEM-PLAN.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 498ea28c0..9278c543d 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1080,6 +1080,43 @@ head/tail if any of them sit in the window rather than in the reserved DRAM), and the cycle itself, each step of which writes the PMU through the secure monitor. That is G3-L1's trace, and it is next. +**Every register path in the cycling window, audited from the source +(2026-10-30 night, offline).** With the doorbell fixed and the hang still +there at 26 minutes, the obvious next question is which other access lands +after isolation. Reading all of them says: none that is unguarded. + +- The modem driver's shared-memory reads are not in the BAR window at all. + `mld->base` comes from `cp_shmem_get_region()` / `cp_shmem_get_nc_region()` + (`shm_ipc.c`, `memremap()` of the reserved DRAM), so the boot indicator, + the magic and capability words and the queue head/tail are plain DRAM and + safe while the link is down. +- Every DBI access goes through `cp_dbi_read()` / `cp_dbi_write()` + (`.read_dbi` / `.write_dbi` of `cp_dw_ops`), which take `dbi_lock` and do + nothing unless `dbi_ok`. That covers the per-queue MSI handlers' + `dw_pcie_readl_dbi()`, which fire on exactly this traffic. +- The link's own interrupt handler, `cp_ctrl_irq_handler()`, takes + `cfg_lock` and returns `IRQ_NONE` unless `cfg_root_ok`; `cp_ctrl_irq(cp, + false)` uses `disable_irq()`, which waits for a handler already running, + and it runs first in `cp_link_down()`. +- Configuration space, root and endpoint, is behind `cfg_root_ok` and + `cfg_ep_ok` under the same lock, which `cp_link_down()` clears before it + touches PERST#, the PHY or the isolation. +- `gs201_pcie_cp_link_ok()` and `gs201_pcie_cp_dump()` read ELBI under + `cfg_lock` with `cfg_root_ok` checked. +- The doorbell was the one exception, and it is fixed (branch + `tegu-cpif-doorbell`, in `gs201_pcie_cp_doorbell()`). + +So the remaining hang is most likely not a stray register read but +something that accumulates over the cycles themselves: about 3000 of them +in the 26 minutes that session lasted, each with a PMU write through the +secure monitor, a `phy_init()` / `phy_exit()` pair, an MSI re-arm and a +root-port window restore. G3-L1's trace should therefore number the cycles +and log each step's entry, so the console says which step of which cycle +stopped, rather than hunting a read that the audit above says is not +there. The interrupt enable and disable calls are paired behind +`ctrl_irq_on` and `msi_irqs_on`, so a plain enable/disable imbalance is +out. + The bring-up start script [`bringup/omamobile-tegu-modem-up`](bringup/omamobile-tegu-modem-up) loads `cpif-keep-link.ko keep_link_up=0` and `gnss_spi.ko word32=2 piece=64 From 21fb50e90c14f15a0e003324ab95e7bd14b6525b Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 22:14:04 -0643 Subject: [PATCH 07/30] MODEM-PLAN: the link cycles because our L1 substates are a stub --- device/tegu/MODEM-PLAN.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 9278c543d..f666e1cb5 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1117,6 +1117,34 @@ there. The interrupt enable and disable calls are paired behind `ctrl_irq_on` and `msi_irqs_on`, so a plain enable/disable imbalance is out. +**Why the link cycles twice a second at all: our L1 substates are a stub +(2026-10-30 night, offline).** `gs201_pcie_cp_l1ss()` in our controller +returns 0 and does nothing; its own comment says L1 substates are never +enabled on this link. The modem driver asks for them after every link-up +(`s51xx_pcie_restore_state()` calls `s51xx_pcie_l1ss_ctrl(1, ...)`), and +Google's driver implements that call: `exynos_pcie_rc_set_l1ss()` finds the +endpoint's L1SS capability and writes `PCI_L1SS_CTL1`/`CTL2` and the link +control register on both ends, for the Samsung modem endpoint among others, +behind a `use_l1ss` property in its device tree. + +So on stock the modem can park an idle link in L1.2 and keep it up; on ours +the only way it can save power when it goes idle is to ask the AP to power +the link off, which is exactly the isolate and un-isolate pair we see about +twice a second under GNSS traffic. That is not a symptom of the hang, it is +what makes the hang reachable in minutes: every cycle is another chance at +whatever breaks, and the console shows the hang falling inside one. + +That gives the next kernel change after the trace: implement +`gs201_pcie_cp_l1ss()` for real, as Google does, so an idle link parks +instead of being torn down. If the cycling stops, the hang stops mattering +for a GNSS session even before its root cause is found, and the +`keep_link_up` diagnostic can be dropped. The registers to write are the +root port's and the endpoint's `PCI_L1SS_CTL1` and `CTL2` plus +`PCI_EXP_LNKCTL`'s ASPM bits, with the endpoint's capability found through +`pci_find_ext_capability(..., PCI_EXT_CAP_ID_L1SS)`; it needs the link up +and the ATU set, which is why Google defers the request until then and +keeps a pending mask. + The bring-up start script [`bringup/omamobile-tegu-modem-up`](bringup/omamobile-tegu-modem-up) loads `cpif-keep-link.ko keep_link_up=0` and `gnss_spi.ko word32=2 piece=64 From aad80476d3155f6d44c694cd8a4ad00ab5eaad7f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 07:44:33 -0643 Subject: [PATCH 08/30] MODEM-PLAN: G3-L1 answered, the link cycled because L1 substates were a stub --- device/tegu/MODEM-PLAN.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index f666e1cb5..64094dc9a 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1080,6 +1080,34 @@ head/tail if any of them sit in the window rather than in the reserved DRAM), and the cycle itself, each step of which writes the PMU through the secure monitor. That is G3-L1's trace, and it is next. +**G3-L1 answered (2026-10-31 morning): the link cycled because our L1 +substates were a stub, and with them the session holds.** Implemented as +Google's `exynos_pcie_rc_set_l1ss()` does for the modem endpoint, behind a +`l1ss` parameter on the controller because the modem driver's last call in +`s51xx_pcie_restore_state()` is an unconditional enable that also arrives +during the ROM boot: acting on it there stops the image download (the CP +never leaves BOOTING, `cpif` reports no PCIe endpoint for the ROM boot, +three boots of three). Set after the CP is ONLINE: + +| | before (10-30 night) | with L1 substates (10-31) | +| --- | --- | --- | +| isolate/un-isolate pairs under GNSS traffic | about 2 a second, thousands in a session | 2 in the first 2.5 minutes, 7 in 5 minutes | +| the SoC hang | about 170 s after ONLINE, or 26 minutes with the doorbell fix | none | +| the CP | crashed 103-108 s after ONLINE when the link was held instead | ONLINE throughout | +| fixes | about a minute's worth | 157 of 165 GGA sentences fixed at 5 minutes, still running | + +So the hang was never reached because the link stopped being torn down, +which is what stock does and what the modem asks for. Three mistakes of +mine on the way there, all worth recording: the module built for this +palmtop must carry `google,zumapro-pcie-cp` in its match table and treat +`samsung,sysreg` as optional (the in-tree branch has neither, so a module +built from it never binds and the modem reports "no PCIe endpoint for the +ROM boot"); a module built without `LOCALVERSION=-s2mpg15-m1` is refused as +"Invalid module format", and a plain `make drivers/.../x.o` in the shared +output tree rewrites `utsrelease.h` so later module builds inherit the +wrong release; and the controller needs `allow_hw=1`, which an edit to the +start script's insmod line must not drop. + **Every register path in the cycling window, audited from the source (2026-10-30 night, offline).** With the doorbell fixed and the hang still there at 26 minutes, the obvious next question is which other access lands From 85035c8be835154f7a6fe997e14de4f0e7ae5352 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 07:52:38 -0643 Subject: [PATCH 09/30] MODEM-PLAN: L1.2 stops the cycling but drops the link after minutes; L1.1 alone does not help --- device/tegu/MODEM-PLAN.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 64094dc9a..c2f4287cc 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1096,8 +1096,33 @@ three boots of three). Set after the CP is ONLINE: | the CP | crashed 103-108 s after ONLINE when the link was held instead | ONLINE throughout | | fixes | about a minute's worth | 157 of 165 GGA sentences fixed at 5 minutes, still running | -So the hang was never reached because the link stopped being torn down, -which is what stock does and what the modem asks for. Three mistakes of +So the hang was never reached, because the link stopped being torn down. +It is not the end of the story, though, and two further runs the same +morning say why: + +- **L1.2 (`l1ss_mask` 0xf, Google's value): the cycling stops and the + session holds for minutes, then the link drops on its own.** At 325 s the + console has `link down completion timeout (IRQ0/1/2 0x0 0x400 + 0x371b1000)`, with IRQ1 bit 10 (LINK_DOWN) latched, then `s51xx + 0001:01:00.0: Unable to change power state from D0 to D3hot, device + inaccessible` and cpif's `Can't set D3 state!!!!`: the link was already + down when the orderly power-off began, so PME_Turn_Off could not + complete, and the SoC went with it. Our `cp_pme_turn_off()` does ask for + an L1 exit first, so this is the link leaving L1.2 unexpectedly rather + than a missing exit request. CLKREQ#, which L1.2 needs to remove the + reference clock, is the first thing to check on this board. +- **L1.1 only (`l1ss_mask` 0xa): the cycling does not stop.** Without L1.2 + the modem still asks for the link to be powered off when it goes idle, so + the isolate and un-isolate pairs continue and the original hang came back + at 165.9 s, with the console ending right after a link-up + (`restore_state`, the BAR0 write, the wake-irq toggle), which is the same + shape as 10-29 and 10-30. + +So the avoidance needs L1.2, and L1.2 needs its own problem solved. What +remains: why the link leaves L1.2 after minutes (CLKREQ# wiring and the +timings this commit programs, TPowerOn 200 us, TCommon 32 us, entrance +latency 64 us, are all worth checking against stock's), and handling an +unexpected link-down in that state rather than dying with it. Three mistakes of mine on the way there, all worth recording: the module built for this palmtop must carry `google,zumapro-pcie-cp` in its match table and treat `samsung,sysreg` as optional (the in-tree branch has neither, so a module From ab682cb30f3a8d3885596f0fe11aa7472e43bebf Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:04:42 -0643 Subject: [PATCH 10/30] MODEM-PLAN: three L1 substate configurations measured, and the longer TPowerOn was my wrong guess --- device/tegu/MODEM-PLAN.md | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index c2f4287cc..19cad5352 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1118,11 +1118,36 @@ morning say why: (`restore_state`, the BAR0 write, the wake-irq toggle), which is the same shape as 10-29 and 10-30. -So the avoidance needs L1.2, and L1.2 needs its own problem solved. What -remains: why the link leaves L1.2 after minutes (CLKREQ# wiring and the -timings this commit programs, TPowerOn 200 us, TCommon 32 us, entrance -latency 64 us, are all worth checking against stock's), and handling an -unexpected link-down in that state rather than dying with it. Three mistakes of +A third run settles the timing question and corrects a guess of mine. With +`tpoweron` raised to Google's largest value (0xfa, 3100 us) on the theory +that the endpoint needed longer to restore its clock, the cycling did not +stop at all: the trace counted **486 link cycles by 244 s**, and the +console ends mid-cycle right after `PHY isolated`, which is the original +hang. So the 200 us Google uses for this modem (0xa1) is right, and a +longer TPowerOn makes L1.2 unusable, after which the modem goes back to +asking for a full power-off. + +The three configurations, all on the same kernel and session script: + +| `l1ss_mask` / `tpoweron` | link cycles | result | +| --- | --- | --- | +| 0xf / 0xa1 (Google's) | 7 in 5 minutes | 157 of 165 GGA fixed, CP ONLINE throughout, then an unexpected LINK_DOWN at 325 s and the SoC with it | +| 0xa / 0xa1 (no L1.2) | continuous | the original hang at 165.9 s | +| 0xf / 0xfa (3100 us) | 486 by 244 s | the original hang | + +What the pin side says: CLKREQ# is described and applied. The overlay gives +`pcie@12100000` `pinctrl-0 = <&pcie0_clkreq>, <&pcie0_perst>` under the +name "active", and the driver selects that state before the PHY, with +gph0-1 at function 2, pull-up, drive 3 and the same through power-down. Our +`MSTR_PEND_SEL_NAK`, `DBI_L1_EXIT_DISABLE` ("use aux_clk in L1.2") and the +HW L1-exit mode all match Google's. So the configuration is not obviously +wrong, and what is left is the unexpected LINK_DOWN itself: recovering from +it instead of dying with it, and reading the LTSSM and the endpoint's L1SS +status at the moment it happens. + +Best known configuration for a GNSS session today: `l1ss_mask` 0xf, +`tpoweron` 0xa1, set after the CP is ONLINE, which gives about five +minutes of fixes. Three mistakes of mine on the way there, all worth recording: the module built for this palmtop must carry `google,zumapro-pcie-cp` in its match table and treat `samsung,sysreg` as optional (the in-tree branch has neither, so a module From e7d6c4590214735696b62c2fd3bd9850ca9273ab Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:40:07 -0643 Subject: [PATCH 11/30] MODEM-PLAN: the L1SS writes went to the wrong offset, so those three runs measured nothing --- device/tegu/MODEM-PLAN.md | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 19cad5352..c0cd16e98 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1145,9 +1145,38 @@ wrong, and what is left is the unexpected LINK_DOWN itself: recovering from it instead of dying with it, and reading the LTSSM and the endpoint's L1SS status at the moment it happens. -Best known configuration for a GNSS session today: `l1ss_mask` 0xf, -`tpoweron` 0xa1, set after the CP is ONLINE, which gives about five -minutes of fixes. Three mistakes of +**And then the instrumentation showed all three of those runs were measuring +nothing (2026-10-31, later).** With the link-down capture in place, every +drop printed `L1SS_CTL1 0x0, CTL2 0x0` with `LNKCTL 0x...42`: the root +port's substate control read zero while ASPM L1 was on. Two mistakes +behind that: + +- The register offsets came from Google's driver (`PCIE_LINK_L1SS_CONTROL` + 0x19c, `CONTROL2` 0x1a0). On this controller the L1SS capability sits at + **0x160** on both the root port and the endpoint, read from the hardware + with `pci_find_ext_capability()`; 0x19c is something else, so the writes + landed on unrelated registers and read back as zero. +- Those registers are also behind DBI's read-only lock, which a write needs + `dw_pcie_dbi_ro_wr_en()` to lift. Lifting it alone changed nothing, + because the offset was still wrong. + +What that means for the three rows above: the `l1ss_mask` and `tpoweron` +values never reached the hardware, so the differences between those runs +are not the substates. The one real change was plain ASPM L1 on the link +control register, which does take (`LNKCTL` bit 1 set, `0x...42`), and +that alone is what the five-minute run had. The capability's own values at +that point, read live during a session with the link up: + +| | capability | CTL1 | CTL2 | +| --- | --- | --- | --- | +| root port 0000:00:00.0 | 0x160 | 0x40a30a00 (substates off) | 0x79 | +| endpoint 0000:01:00.0 | 0x160 | 0x40a30000 (substates off) | 0x79 | + +So the LTR threshold and TCommon fields are already populated by whoever +set them, and only the four enable bits are clear. The implementation now +reads both offsets from the hardware and logs CTL1 back after writing, so +the next run says whether the substates are on rather than leaving it to +be assumed. Three mistakes of mine on the way there, all worth recording: the module built for this palmtop must carry `google,zumapro-pcie-cp` in its match table and treat `samsung,sysreg` as optional (the in-tree branch has neither, so a module From 97293c4edb4ebd1e087e404e7bba1dc9f6966e36 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:57:55 -0643 Subject: [PATCH 12/30] MODEM-PLAN: both ends support all four L1 substates; what takes and what does not --- device/tegu/MODEM-PLAN.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index c0cd16e98..b09017a31 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1172,8 +1172,31 @@ that point, read live during a session with the link up: | root port 0000:00:00.0 | 0x160 | 0x40a30a00 (substates off) | 0x79 | | endpoint 0000:01:00.0 | 0x160 | 0x40a30000 (substates off) | 0x79 | -So the LTR threshold and TCommon fields are already populated by whoever -set them, and only the four enable bits are clear. The implementation now +Decoded, both ends support everything that is needed (read live, link up): + +| | CAP | supports | CTL1 enables | TCommon | LTR threshold | TPowerOn | +| --- | --- | --- | --- | --- | --- | --- | +| root port | 0x280a1f | PCI-PM L1.1/L1.2, ASPM L1.1/L1.2, L1 PM substates | 0 (none) | 10 us | 163 x scale 2 | 57 x scale 1 | +| endpoint | 0x790a1f | the same four | 0 (none) | 0 | 163 x scale 2 | 57 x scale 1 | + +So the hardware is willing on both sides and the timing fields are already +populated by whoever set them; only the four enable bits are clear. An +earlier reading of mine that the endpoint had no L1SS capability was taken +with the link down, where the whole config space reads 0xffff, and is +withdrawn. + +What has and has not been made to work from userspace, with `setpci` during +a session: the root port takes the enable bits (CTL1 0x4600 to 0x460f) and +ASPM L1 in its link control (0x40 to 0x42), and so does the endpoint's link +control, but a window in which both ends' config space is readable is hard +to catch once the CP is ONLINE, because the link is down most of the time: +a 1 Hz poll missed it for 120 s, and a 50 Hz poll caught one window but the +boot ended before the measurement. Inside the driver the write belongs +right after the ATU is set, which is where the implementation puts it, and +it has not yet been observed to take effect: no readback line appeared in +three runs, so the next step is a print at the entry of +`gs201_pcie_cp_l1ss()` to see whether the modem driver's request arrives at +all, rather than more guessing about the registers. The implementation now reads both offsets from the hardware and logs CTL1 back after writing, so the next run says whether the substates are on rather than leaving it to be assumed. Three mistakes of From 9f7d727bb898208c2042ca192b28f0d266acad9a Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 09:55:30 -0643 Subject: [PATCH 13/30] MODEM-PLAN, NOTES, AGENTS: the pin drive change is withdrawn, #150 alone fixes GNSS The maintainer asked whether the CRC improvement holds with the SPI flush fix alone at the bootloader's drive 0. It does: 50 of 53 GGA fixed, every received frame at bit offset 0 with a valid CRC32, the same as at drive 3. Kernel #151 is closed; the plan's cause 2, the notes and the AGENTS gotcha now say so, and the gotcha keeps the lesson: one change per boot, and check whose pins they are first. --- AGENTS.md | 2 +- device/tegu/MODEM-PLAN.md | 34 ++++++++++++++++++++++------------ device/tegu/NOTES.md | 8 +++++--- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c43744e01..37f9ac114 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -154,7 +154,7 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link - **Fingerprint: nothing writes `persist` or the RPMB without the human's explicit go.** The first `storageproxyd` run (FINGERPRINT-PLAN F4) is irreversible, and `omamobile-fp.service` ships disabled because its first run writes Trusty's secure storage. [FINGERPRINT-PLAN](device/cheetah/FINGERPRINT-PLAN.md) - **Set the Bluetooth address only after powering the controller on:** set on a never-powered controller, the kernel withdrew the index for good. - **spi-s3c64xx with automatic chip select drops bits between transfers until linux-omarchy-mobile#150:** its FIFO flush cleared the packet count before turning the channels off, so the controller clocked a few bits with the slave still selected. A slave that restarts per chip-select cycle (touch) doesn't notice; one that streams across cycles (the 9a's GNSS core, CHPP) loses 2-6 bits per transfer, and every read lands at a different bit offset. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, GNSS gets a fix" -- **A node without pinctrl runs on the bootloader's pins:** the 9a's GNSS SPI had none and ran at drive 0, which made its data marginal. Before blaming a protocol, read the bank's CON/PUD/DRV in `/sys/kernel/debug/pinctrl//pins` (one controller at a time, as the gs101 note above says) and compare with the bus that works. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, GNSS gets a fix" +- **A node without pinctrl runs on the bootloader's pins, and a pin change tested next to another fix proves nothing on its own.** The 9a's GNSS SPI has no pin group and runs at the bootloader's drive 0; raising the drive looked like it cleaned the data, but it was tested together with the SPI flush fix, and with the flush fix alone at drive 0 the data was just as clean (#151 closed). Read the bank's CON/PUD/DRV in `/sys/kernel/debug/pinctrl//pins` (one controller at a time, as the gs101 note above says) before changing anything, then change one thing per boot, and check whose pins they are in the vendor tree before claiming them (gpp22 is the eSE's). [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, GNSS gets a fix" - **Samsung pinctrl takes pin groups only at its own probe:** groups added later by a runtime overlay are refused ("invalid function … in map table"), so a driver's pin states belong in the base DT even when its node comes from an overlay. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) M2.0 - **On tegu, ABL leaves every GPA5 pin pulled down, and that hides the modem's cp2ap lines:** with the pull-down nothing rose for 10 s after power-on; with stock's pulls (wakeup up, phone-active and ps-hold floating, in the base DT) they rise within 0.5 s. Check a line's pull before blaming the device that drives it. [tegu FAR-ALIVE-PLAN](device/tegu/FAR-ALIVE-PLAN.md) - **brcmfmac on BCM4389 needs control-ring D3 messages:** this firmware ignores the TCM mailbox, so early suspend tests ran with Wi-Fi unloaded. The D3 series on `omamobile-int` sends the D3 inform as a control message, and Wi-Fi now stays connected across s2idle (S5b-3; S5c, 31 of 31 freezes, 2026-10-19). The sleep hook (`omamobile-sleep` in device-cheetah) keeps Wi-Fi loaded when `/etc/omamobile/wifi-keep-across-sleep` exists (set on the reference phone since S5c), and otherwise unloads it; after a failed D3 handshake it falls back to unloading for the rest of the boot. Wi-Fi can't wake the phone (no host-wake consumer). [SUSPEND-PLAN](device/cheetah/SUSPEND-PLAN.md) S5 diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 19c4ac795..e73f62427 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -10,8 +10,9 @@ G1-G2 passed: gnssd loads Kepler's firmware and talks CHPP over SPI; **G3 resolved (2026-10-30, evening): a position fix on the owner's kernel.** The CHPP link lost bits because spi-s3c64xx's flush cleared the packet count before turning the channels off -(derekross/linux-omarchy-mobile#150) and because the GNSS SPI's pins ran on -the bootloader's drive 0 (#151). Open: the CP link under GNSS traffic. Our +(derekross/linux-omarchy-mobile#150). That fix alone does it: a pin drive +change (#151) was credited at first and withdrawn on 10-31, see cause 2. +Open: the CP link under GNSS traffic. Our controller never enabled the link's L1 substates (a stub), so an idle link is torn down and rebuilt about twice a second and one of those cycles hangs the SoC, about 170 s after ONLINE; holding the link instead crashes the CP @@ -967,14 +968,22 @@ their CRC. Google's driver turns the channels off first; #150 does the same. Found by comparing Google's and mainline's transfer paths register write by register write, after the sweep below had shown the slip per transfer. -**Cause 2, the pins (DT, [linux-omarchy-mobile#151](https://github.com/derekross/linux-omarchy-mobile/pull/151)).** -SPI21 had no pinctrl, so the bus ran on the bootloader's pin state, read +**Cause 2, the pins: withdrawn ([linux-omarchy-mobile#151](https://github.com/derekross/linux-omarchy-mobile/pull/151), closed 2026-10-31).** +SPI21 has no pinctrl, so the bus runs on the bootloader's pin state, read from PERIC1's pin registers on the palmtop: gpp22-0..3 in function 2 at -drive 0, gpp22-2 (data in) pulled down. With drive 3 (as gpp21, the other -SPI bus on PERIC1, the touchscreen's) the data inside each read became -clean; with the flush fix as well, every read arrived at bit 0 with a valid -CRC32. #151 describes the pins in the board DT; the palmtop uses -[`overlays/gnss-spi-pins.dtso`](overlays/gnss-spi-pins.dtso) until it lands. +drive 0, gpp22-2 (data in) pulled down. Raising the drive to 3 (as gpp21, +the touchscreen's SPI) seemed to clean the data inside each read, and #151 +put that in the board DT. The maintainer's reading of Google's tegu tree +said gpp22 is the eSE's SPI15 (chip select on gpp22-3) and stock's SPI21 +has no pin group at all, and asked for a check with #150 alone at drive 0. +That boot (10-31, `DRV(0x0)` on all four pins read back from the +controller) gave 50 of 53 GGA fixed in a 3-minute session, 0 bad +checksums, 0 ACK timeouts, 0 permanent failures, and all 41 received +reads holding a frame at bit offset 0 with a valid CRC32: the same quality +as at drive 3. The improvement was #150's throughout; the drive-3 run that +looked cleaner had been compared against reads with the flush bug still in +place. #151 is closed, `overlays/gnss-spi-pins.dtso` stays in the tree as +a record only and is not in the palmtop's boot set. **The configuration that works is stock's**: SPI mode 0 (stock's node has no spi-cpha or spi-cpol), 32-bit words, feedback delay 0 @@ -1024,12 +1033,13 @@ lands after isolation), so that the link may cycle as the CP asks. preamble) got 86 of 173 frames valid; `realign=4` (carrying the bits across reads) made it worse, which showed the stream isn't continuous across reads, so bits were being lost between transfers. -- The pins at drive 3: frames inside a read clean, offsets still changing. +- The pins at drive 3: frames inside a read looked clean, offsets still + changing (later shown to be no change: see cause 2). - The flush order: offsets gone, link up, a fix. **Left for GNSS:** the GNSS link driver (gnssif) and CPIF aren't in the -published kernel, so this runs on the owner's kernel only; #150 and #151 are -open; the CP link under GNSS traffic is unsolved: the hold crashes the CP, +published kernel, so this runs on the owner's kernel only; #150 is open +and #151 is closed as unnecessary; the CP link under GNSS traffic is unsolved: the hold crashes the CP, the cycling hangs the SoC, and the way out is the L1 substates the controller never enabled (G3-L1, 10-31), which are being enabled on the real capability offset and have not yet been seen to take effect. A session diff --git a/device/tegu/NOTES.md b/device/tegu/NOTES.md index ba591329b..b0bce5fcb 100644 --- a/device/tegu/NOTES.md +++ b/device/tegu/NOTES.md @@ -17,10 +17,12 @@ Raw captures, recordings, backups and vendor files remain off repository. The receiver gets a position fix on the owner's kernel: up to 13 satellites used, HDOP 0.8-1.2, GPS, Galileo, BeiDou and GLONASS tracked, CHPP clean -for about a minute per boot. Two fixes did it: spi-s3c64xx +for about a minute per boot. One fix did it: spi-s3c64xx turned the channels off after clearing the packet count, which lost a few -bits per transfer on a streaming slave (linux-omarchy-mobile#150), and the -GNSS SPI's pins ran on the bootloader's drive 0 (#151). What ends the fix is +bits per transfer on a streaming slave (linux-omarchy-mobile#150). A pin +drive change (#151) was credited too and withdrawn on 10-31: at the +bootloader's drive 0 with #150 alone, 50 of 53 fixed and every frame at bit +offset 0 with a valid CRC. What ends the fix is the CP link under GNSS traffic: held up it crashes the CP 103-108 s after ONLINE (six boots of six), left to cycle it hangs the SoC about 170 s after ONLINE. Details, the configuration and the sweep in From a9877d7d45d3ff15104f1be7d165bed283db342d Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 10:39:49 -0643 Subject: [PATCH 14/30] MODEM-PLAN: G3-L1, the L1 substates take effect but the link hang remains A traced controller build shows the substates enabled on both ends at every link-up. The link still cycles because the modem driver powers it off whenever the CP sleeps, as on stock, and the palmtop hung about 630 seconds after ONLINE instead of 170. --- device/tegu/MODEM-PLAN.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index e73f62427..6b8bb7f3e 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -998,6 +998,25 @@ does swapping in gnss_spi (`word32=2`, commit 734f5f8c8 on errors, on a boot without the swap-mode property. The palmtop runs the software swap. +**G3-L1, the L1 substates on for real (2026-10-31, one boot, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** +The controller module's v8 bring-up build (sha256 `dbbb6f5f335f7640…`) +logs each step of its L1SS path behind `trace=1` and with `l1ss=2` enables +the substates at every link-up. The trace answered why the earlier runs +showed nothing: with `l1ss` at its default 0 the requests were dropped. With +`l1ss=2` both ends read back enabled at every link-up (root CTL1 +`0x40a3200f`, endpoint `0x40a3000f`, capability at 0x160 on both). The +cycling did not stop, and that is by design: cpif's `cp2ap_suspend` +handler, the CP saying it sleeps, disables the substates in +`s51xx_pcie_save_state()` and calls `s5100_poweroff_pcie()` about 90 ms +after each enable, so the link powers down and up about twice a second as +on stock. So the substates are not what the cycling lacks. With them on, +one 240 s Location session gave 87 of 155 fixed and the palmtop survived +the session, `omamobile-gnss off`, and minutes of idle cycling, then hung +about 630 s after ONLINE (cycle 1083, last line `up: dbi allowed`, nothing +in pstore). Earlier hangs came about 170 s after ONLINE. One boot each way, +so the substates may delay the hang; they do not prevent it. The next step +is the hang inside one cycle: what follows `up: dbi allowed`. + **The CP link under GNSS traffic, G3-L1's first step answered, and a correction.** With GNSS running for minutes on the normal boot, the hang of 10-29 came back once (CLUSTER0_NONCPU_WDTRESET about 260 s into the boot, From 7d3779e98a989d1605a6e003c5a009cf8711f20f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 12:17:10 -0647 Subject: [PATCH 15/30] MODEM-PLAN: the Location install steps need a command line that masks none of the GNSS units --- device/tegu/MODEM-PLAN.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index b7a2eff89..6c1619a02 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1077,6 +1077,8 @@ default: it is the only setting that moves data. `HOLD=2` (answer the CP on ap2cp_wakeup) moved none and is kept only as a diagnostic, and `HOLD=0` lets the link cycle, for as long as the CP link lasts. +**Precondition: no `systemd.mask=` for these units on the command line.** `systemctl unmask` can't lift a mask the kernel command line sets, so check `tr ' ' '\n' < /proc/cmdline | grep -E 'mask=omamobile-gnss'` prints nothing first: the daily bootargs mask none of `omamobile-gnss.service`, `omamobile-gnss-nmea.service` or the socket, but the older bring-up overlays (`public-native-root`, `public-phone-local`) mask `omamobile-gnss.service`. + **Attended only, and not for the daily boot.** With these drop-ins in place any GeoClue client can start a session, and a session can still hang the SoC with the modem up (about 170 s after ONLINE while the link cycles), so From b32af195eec92c5d03a3bae25bc5b2d29684e7b8 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 17:40:21 -0647 Subject: [PATCH 16/30] MODEM-PLAN: G3-L1, the SoC hangs in cpif's pci_save_state(), and after skipping it in the power-on path Traced cpif shows the hang between pci_clear_master() and the end of pci_save_state(), a config read after the CP asked for the power-off. Skipping the config access moved the hang to after a completed power-off. --- device/tegu/MODEM-PLAN.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 6c1619a02..1d6a93232 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -997,6 +997,22 @@ does swapping in gnss_spi (`word32=2`, commit 734f5f8c8 on errors, on a boot without the swap-mode property. The palmtop runs the software swap. +**G3-L1, where in the power-down the SoC hangs (2026-10-31, evening, daily kernel).** +A copy of the palmtop's own cpif (the K4 build, `5a10811b940d51ff`) with +eight trace lines around `s51xx_pcie_save_state()` and +`exynos_pcie_poweroff()`, nothing else changed, and one GNSS session with the +kernel log streamed: the hang came about 13 minutes in, and the last line +before it was "master cleared" with no "config saved" after it, so the SoC +hangs inside `pci_save_state()`. cpif reads the endpoint's config space +after the CP has asked for the power-off (it is going to sleep), and an +unanswered config read on this controller hangs the SoC. A second build +keeps probe's saved config and skips every config access in that path +("kept the saved config"): that boot hung too, about 90 s after ONLINE, +after its third completed power-off ("link off") and before the next +power-on, so the next trace goes on the power-on path +(`s51xx_pcie_restore_state()` and the link-up). The save-once change alone +does not fix the hang. + **G3-L1, the L1 substates on for real (2026-10-31, one boot, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** The controller module's v8 bring-up build (sha256 `dbbb6f5f335f7640…`) logs each step of its L1SS path behind `trace=1` and with `l1ss=2` enables From f62a788bbe3a7e5bb4e720f2de9dba382b27bc2f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 17:40:34 -0647 Subject: [PATCH 17/30] MODEM-PLAN: the first traced hang came about 11 minutes in --- device/tegu/MODEM-PLAN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 1d6a93232..9cb823f55 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1001,7 +1001,7 @@ software swap. A copy of the palmtop's own cpif (the K4 build, `5a10811b940d51ff`) with eight trace lines around `s51xx_pcie_save_state()` and `exynos_pcie_poweroff()`, nothing else changed, and one GNSS session with the -kernel log streamed: the hang came about 13 minutes in, and the last line +kernel log streamed: the hang came about 11 minutes in, and the last line before it was "master cleared" with no "config saved" after it, so the SoC hangs inside `pci_save_state()`. cpif reads the endpoint's config space after the CP has asked for the power-off (it is going to sleep), and an From c1e0568030c0efc490715178e2903f3d7ba6291f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 17:55:10 -0647 Subject: [PATCH 18/30] MODEM-PLAN: G3-L1, the power-on trace: the next hang is the link-ack doorbell read-back The save-once build ran 53 link cycles, then hung in the doorbell after a complete power-on. Both hangs are non-posted reads to the endpoint, yet the root port's completion timeout is enabled, which points at the controller's clocks or PHY rather than the endpoint. --- device/tegu/MODEM-PLAN.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 9cb823f55..a03ff7465 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1013,6 +1013,23 @@ power-on, so the next trace goes on the power-on path (`s51xx_pcie_restore_state()` and the link-up). The save-once change alone does not fix the hang. +**G3-L1, the power-on trace (2026-11-01, daily kernel).** With the +save-once build plus trace lines through `s5100_poweron_pcie()`, the session +went through 53 power-off/power-on cycles (the previous build 3) and then +hung; the last line was "link ack doorbell", printed after a complete +power-on (link on, config restored, MSI set, RX queues kicked), so the SoC +hung in the link-ack doorbell: the controller's `gs201_pcie_cp_doorbell()` +writes the BAR register under `cfg_lock` and reads it back. Both hangs are +non-posted reads to the endpoint (a config read, a BAR read-back). The root +port's completion timeout is enabled (DEVCAP2 `0x00010c1f`, DEVCTL2 +`0x0405`: range B, 16-55 ms, not disabled), so an unanswered read should +end in an error, not a hang; a silent hang there points at the access +reaching the controller with its clocks or PHY already off (a fabric-level +hang below PCIe) rather than at the endpoint. Next: read the controller's +clock and isolation state at the doorbell (in the controller, under the +same lock), and check whether `cp_link_down()` can run from the +controller's own link-down path without `pcie_onoff_lock`. + **G3-L1, the L1 substates on for real (2026-10-31, one boot, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** The controller module's v8 bring-up build (sha256 `dbbb6f5f335f7640…`) logs each step of its L1SS path behind `trace=1` and with `l1ss=2` enables From 9d8d73b003c66611cdb16f1ec58007c824d89ce4 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 18:48:39 -0647 Subject: [PATCH 19/30] MODEM-PLAN: G3-L1, save-once plus a write-only doorbell still hangs, at a third point 37 link cycles, then a reset after a power-off. The controller's interrupt paths are guarded, so the next suspect is cpif's own BAR accesses racing a power-off. --- device/tegu/MODEM-PLAN.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index a03ff7465..14068cde8 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1013,6 +1013,23 @@ power-on, so the next trace goes on the power-on path (`s51xx_pcie_restore_state()` and the link-up). The save-once change alone does not fix the hang. +**G3-L1, save-once plus a write-only doorbell (2026-11-01, daily kernel).** +Both changes together (cpif and the controller from the build tree of the +v8/v9 traces, which drives the PHY from `tegu-pcie0-seq.h`; the tree that +expects a separate PHY driver fails with "no PHY" and then "no PCIe +endpoint for the ROM boot"): the CP came up ONLINE, the session ran 37 +power-off cycles, and the palmtop reset again, the last line right after a +power-off ("kept the saved config"). So the hang has now landed at three +different points (in `pci_save_state()`, at the doorbell after a power-on, +after a power-off). The controller's own interrupt paths are guarded (the +control interrupt is disabled synchronously and its handler checks +`cfg_root_ok` under `cfg_lock`; the MSI queue interrupts are disabled before +isolation), so the remaining suspect is an access by cpif itself to the +modem's BAR window (shared memory, doorbell or MSI registers) racing a +power-off from another path, which the controller cannot guard. Next: +instrument cpif's BAR accesses with the link state at the time of the +access. + **G3-L1, the power-on trace (2026-11-01, daily kernel).** With the save-once build plus trace lines through `s5100_poweron_pcie()`, the session went through 53 power-off/power-on cycles (the previous build 3) and then From 612abdb67442499fd0693b64083a5b62844bdb99 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 19:15:32 -0647 Subject: [PATCH 20/30] MODEM-PLAN: G3-L1, 299 link cycles, and the hang lands just after the link settles With the controller's steps traced, the session ran 299 power cycles and hung after cycle 292's power-up trained, before the controller's next access to its own registers. The point keeps moving, which suggests something outside the two drivers racing them. --- device/tegu/MODEM-PLAN.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 14068cde8..87f8f5770 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1013,6 +1013,24 @@ power-on, so the next trace goes on the power-on path (`s51xx_pcie_restore_state()` and the link-up). The save-once change alone does not fix the hang. +**G3-L1, the controller's own steps traced (2026-11-01, daily kernel).** +The same pair with a trace line after each step of the controller's +`cp_link_down()` and `cp_link_try()`, the modem started after the boot's +bring-up had finished: 299 power-off cycles before the reset (the runs +before stopped after 8 to 53). The last lines: cycle 292's power-down ran +every step (interrupts off, LTSSM off, soft reset, PHY off, isolated), its +power-up trained ("L0", "settled"), and nothing after it, not even the +"link up: GenN" line, which the controller prints after one PCS write and +two DBI reads of its own registers. So the hang point moves from run to +run (inside cpif's config save, the doorbell, the start of +`cp_link_down()`, and now just after the link settles), and at least once +it is an access to the controller's own registers with the PHY powered and +the link trained. That points at something outside these two drivers +racing them, not at one bad access in their order: candidates are the +Wi-Fi bring-up module on the same boot (PCIe channel 1, its own PMU +isolation register and HSI2 parts), or a PMU or clock change from another +path. Next: one session with Wi-Fi left down for the whole boot. + **G3-L1, save-once plus a write-only doorbell (2026-11-01, daily kernel).** Both changes together (cpif and the controller from the build tree of the v8/v9 traces, which drives the PHY from `tegu-pcie0-seq.h`; the tree that From 704d01fd0196b2e83c89c327683a64a41ebd89ad Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 19:56:40 -0647 Subject: [PATCH 21/30] MODEM-PLAN: G3-L1, the hang is not the Wi-Fi bring-up, and lands on a DBI read of LNKSTA With Wi-Fi down for the boot the session still hung at the same line. Finer traces put the hang on the controller's own LNKSTA read right after a good link-up. --- device/tegu/MODEM-PLAN.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 87f8f5770..ef414c721 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1013,6 +1013,20 @@ power-on, so the next trace goes on the power-on path (`s51xx_pcie_restore_state()` and the link-up). The save-once change alone does not fix the hang. +**G3-L1, two more runs (2026-11-01, daily kernel).** With Wi-Fi left down +for the whole boot (the BCM4383 firmware moved aside, PCIe channel 1 +unbound, no `wl*` interface) the session still hung, after 65 cycles, at +the same line as before ("settled"), so the Wi-Fi bring-up is not the +racer. With a trace line on each step after "settled": cycle 232's +power-up trained, the PCS PLL/bias write went through, the capability +walk over DBI returned 0x70, and the next access, the 16-bit DBI read of +LNKSTA at 0x82, never returned. So the SoC can hang on a read of the +controller's own register right after a good link-up, with no link-down +interrupt logged before it. Next: compare the controller's error-response +setup with Google's (`pcie-exynos-gs`: AXI slave error response, the ELBI +error enables), since a stalled access instead of an error response would +explain hangs at whatever access comes next. + **G3-L1, the controller's own steps traced (2026-11-01, daily kernel).** The same pair with a trace line after each step of the controller's `cp_link_down()` and `cp_link_try()`, the modem started after the boot's From 8d45717fd7fda44e09519499c9c13dd0af751e96 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 20:59:00 -0647 Subject: [PATCH 22/30] MODEM-PLAN: G3-L1, the reset starts at the CP's wake with the link down; not CPU sleep, not the PHY isolation The pstore console log shows the SoC stalling piece by piece after the CP's wake interrupt with no controller access after it. Holding the link up crashes the CP, and neither disabling CPU sleep nor keeping the PHY in bypass as stock does stops the resets. --- device/tegu/MODEM-PLAN.md | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index ef414c721..433562d46 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1027,6 +1027,50 @@ setup with Google's (`pcie-exynos-gs`: AXI slave error response, the ELBI error enables), since a stalled access instead of an error response would explain hangs at whatever access comes next. +**G3-L1, a hang with nothing touching the link, and the link held up (2026-11-01, daily kernel).** +With the controller holding `APP_XFER_PENDING` until the end of each +power-up, the session ran 147 power-offs and the palmtop reset. The kernel +log streamed over SSH and the console log that systemd-pstore keeps from +ramoops (`/var/lib/systemd/pstore/`) end on the same line: cycle 140's +power-down finished every step ("down: isolated") and nothing followed, +not cpif's return from the power-off nor the next cycle's "up: begin". So +the SoC hung while neither driver was touching the controller or the +endpoint. With cpif's `keep_link_up` set once the CP was ONLINE (the link +never powered off on the CP's request), the CP crashed about 80 s into the +session (`cp_active` dropped, ONLINE to CRASH_EXIT), after four refused +power-offs, and the palmtop did not reset. The CP needs its power-offs, so +holding the link is not a fix. With the CPU sleep idle state (PSCI core +power-down) disabled on all eight CPUs, the session ran 1070 cycles and +the palmtop reset, so core power-down is not the trigger. This time the +pstore console log kept what followed: cycle 1070's power-down finished +("down: isolated"), 360 ms later the CP's wake interrupt fired (cpif's +`cp2ap_wakeup` handler toggling irq 96's wake) and the power-up never +started (no "up: begin"). Then the SoC stalled piece by piece, not at +once: a Wi-Fi firmware query timed out at +5.5 s, ACPM's thermal channel +(9) timed out from +8.5 s ("Timeout! ch:9", "RX front can not keep up with +TX front"), and at +22 s RCU reported CPUs 0-3 and 7 stalled (detected by +CPU 5), before the watchdog reset. CPUs stuck one by one, with the APM +unanswering, is a stalled interconnect target, not one stuck access by +these drivers. One difference from stock stands out: stock's zumapro node +has no `use-phy-isol-en`, so Google's driver puts the PHY in bypass once +and never isolates it again (and sets PMU bit 10 at each power-on but +never clears it), while ours isolates the PHY and clears bit 10 at every +power-down, about twice a second. A controller that keeps the PHY in +bypass and bit 10 set between cycles (`isolate=0`, no PMU isolation write +in the whole session) still reset the palmtop, after 191 cycles; the +pstore log ends on cpif's "kept the saved config" with nothing after it, +the hang this time at once, in the power-off's PME_Turn_Off on the +controller's ELBI. So the runtime isolation is not the cause either. Next: +the RCU stall timeout at its 3 s minimum, so that a stall that spreads, as +in the CPU-sleep run, is reported with the stuck CPUs' tasks before the +10 s runtime watchdog resets the palmtop. That run reset after 47 cycles +with no stall report at all, and the pstore log ends as the CPU-sleep +run's did: cycle 47 "down: isolated", the CP's wake interrupt 373 ms +later, and no "up: begin". Two resets in a row now start at the CP's wake +with the link down and nothing after it in the log. Next: trace lines +through cpif's wake work and `s5100_poweron_pcie()` up to its call into +the controller. + **G3-L1, the controller's own steps traced (2026-11-01, daily kernel).** The same pair with a trace line after each step of the controller's `cp_link_down()` and `cp_link_try()`, the modem started after the boot's From ba55498db3f65467196607a485f30f99f7a33aec Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:09:03 -0647 Subject: [PATCH 23/30] MODEM-PLAN: G3-L1 found, the PERIC0 GPIO clock gate hung the SoC The modem's AP2CP lines are on PERIC0, whose GPIO bus clock was gated around every pin access. Kept on (linux-omarchy-mobile #172), four 600 s GNSS sessions ran over 1300 link cycles each with no reset. --- device/tegu/MODEM-PLAN.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 433562d46..b2ee1943a 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1071,6 +1071,27 @@ with the link down and nothing after it in the log. Next: trace lines through cpif's wake work and `s5100_poweron_pcie()` up to its call into the controller. +**G3-L1 found: the PERIC0 GPIO clock gate (2026-11-01, night).** With +those trace lines the next reset stopped inside +`mif_gpio_set_value(AP2CP_WAKEUP, 1, 5)`, and with cpif's `trace_lines` +on the one after logged the GPIO write itself as the last line. The AP2CP +lines are on PERIC0 (gpp8, gpp12, gpp16), and `CLK_GOUT_GPIO_PERIC0` is +the one writable GPIO gate in `clk-zumapro.c` (the APM and PERIC1 GPIO +gates are read-only). It runs in manual mode (`CLK_CON_GAT` 0x20b8 reads +`0x100000` between accesses), and the Samsung pin controller enables and +disables its pclk around every register access, so cpif's GPIO writes +switch the gate on and off about twice a second each way. With the clock +held on by a bring-up module (`tegu-gpio-pclk-hold.ko`), two 600 s +sessions ran 1325 and 1326 link cycles with no reset (550 of 557 and 558 +of 564 fixed). Then the same change in the kernel +(: the gate +marked `CLK_IS_CRITICAL`, built into the daily kernel's tree, Image +`7f3674d21e92d758`, the release unchanged) with the palmtop's own daily +modem modules and nothing held by hand: two more 600 s sessions, 1335 and +1333 link cycles, no reset, 568 of 570 and 558 of 567 fixed. Every session +before reset the palmtop. That kernel is the daily kernel from now on +(the kit's Image pin in `logs/tegu-review-20261029/runners/lib.sh`). + **G3-L1, the controller's own steps traced (2026-11-01, daily kernel).** The same pair with a trace line after each step of the controller's `cp_link_down()` and `cp_link_try()`, the modem started after the boot's From 9758ee554f9440cb624da8df6d4801ea08f2b5c0 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:09:21 -0647 Subject: [PATCH 24/30] AGENTS: the 9a's PERIC0 GPIO clock gate hung the SoC A writable, manual-mode GPIO bus clock gate is switched off after every pin access, which hung the palmtop under the modem's GPIO traffic; GPIO gates stay critical or read-only on such a CMU. --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 56bb5a2b0..16caa6c39 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -156,6 +156,7 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link - **spi-s3c64xx with automatic chip select dropped bits between transfers before linux-omarchy-mobile#150 (merged 2026-10-31):** its FIFO flush cleared the packet count before turning the channels off, so the controller clocked a few bits with the slave still selected. A slave that restarts per chip-select cycle (touch) doesn't notice; one that streams across cycles (the 9a's GNSS core, CHPP) loses 2-6 bits per transfer, and every read lands at a different bit offset. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, GNSS gets a fix" - **A node without pinctrl runs on the bootloader's pins, and a pin change tested next to another fix proves nothing on its own.** The 9a's GNSS SPI has no pin group and runs at the bootloader's drive 0; raising the drive looked like it cleaned the data, but it was tested together with the SPI flush fix, and with the flush fix alone at drive 0 the data was just as clean (linux-omarchy-mobile#151 closed). Read the bank's CON/PUD/DRV in `/sys/kernel/debug/pinctrl//pins` (one controller at a time, as the gs101 note above says) before changing anything, then change one thing per boot, and check whose pins they are in the vendor tree before claiming them (gpp22 is the eSE's). [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "G3, GNSS gets a fix" - **Samsung pinctrl takes pin groups only at its own probe:** groups added later by a runtime overlay are refused ("invalid function … in map table"), so a driver's pin states belong in the base DT even when its node comes from an overlay. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) M2.0 +- **On the 9a, a writable GPIO bus clock gate hung the SoC:** the Samsung pin controller turns its pclk off after every register access, and `CLK_GOUT_GPIO_PERIC0` was a real, manual-mode gate, so the modem's AP2CP writes on PERIC0 (twice a second under GNSS) hung the palmtop within minutes, at random points and with nothing in the log. Keep GPIO gates critical or read-only on a CMU without automatic clock gating ([linux-omarchy-mobile#172](https://github.com/derekross/linux-omarchy-mobile/pull/172)). [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) G3-L1 - **On tegu, ABL leaves every GPA5 pin pulled down, and that hides the modem's cp2ap lines:** with the pull-down nothing rose for 10 s after power-on; with stock's pulls (wakeup up, phone-active and ps-hold floating, in the base DT) they rise within 0.5 s. Check a line's pull before blaming the device that drives it. [tegu FAR-ALIVE-PLAN](device/tegu/FAR-ALIVE-PLAN.md) - **brcmfmac on BCM4389 needs control-ring D3 messages:** this firmware ignores the TCM mailbox, so early suspend tests ran with Wi-Fi unloaded. The D3 series on `omamobile-int` sends the D3 inform as a control message, and Wi-Fi now stays connected across s2idle (S5b-3; S5c, 31 of 31 freezes, 2026-10-19). The sleep hook (`omamobile-sleep` in device-cheetah) keeps Wi-Fi loaded when `/etc/omamobile/wifi-keep-across-sleep` exists (set on the reference phone since S5c), and otherwise unloads it; after a failed D3 handshake it falls back to unloading for the rest of the boot. Wi-Fi can't wake the phone (no host-wake consumer). [SUSPEND-PLAN](device/cheetah/SUSPEND-PLAN.md) S5 From 7212ee6152b40946b57d72887e41e070439e47d0 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:43:00 -0647 Subject: [PATCH 25/30] MODEM-PLAN: G3-L1, a 30-minute GNSS session on the fixed kernel 3759 link power cycles with no reset and 1763 of 1765 sentences fixed, on the daily kernel with the PERIC0 GPIO clock kept on. --- device/tegu/MODEM-PLAN.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index b2ee1943a..93b90e998 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1089,7 +1089,8 @@ marked `CLK_IS_CRITICAL`, built into the daily kernel's tree, Image `7f3674d21e92d758`, the release unchanged) with the palmtop's own daily modem modules and nothing held by hand: two more 600 s sessions, 1335 and 1333 link cycles, no reset, 568 of 570 and 558 of 567 fixed. Every session -before reset the palmtop. That kernel is the daily kernel from now on +before reset the palmtop. A 30-minute session on that kernel followed: 3759 link +cycles, no reset, 1763 of 1765 fixed. That kernel is the daily kernel from now on (the kit's Image pin in `logs/tegu-review-20261029/runners/lib.sh`). **G3-L1, the controller's own steps traced (2026-11-01, daily kernel).** From 93c3f68deeb41f33ea2a0c3e9bd95ccef2587226 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 23:13:13 -0647 Subject: [PATCH 26/30] MODEM-PLAN: the status line, the GNSS hang is fixed The open item at the top was the SoC hang under GNSS traffic; it now says what fixed it and points at the kernel pull request. --- device/tegu/MODEM-PLAN.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 93b90e998..b2d58cac2 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -12,14 +12,14 @@ The CHPP link lost bits because spi-s3c64xx's flush cleared the packet count before turning the channels off (derekross/linux-omarchy-mobile#150). That fix alone does it: a pin drive change (linux-omarchy-mobile#151) was credited at first and withdrawn on 10-31, see cause 2. -Open: the CP link under GNSS traffic. The link powers down and up about -twice a second, as on stock: cpif powers it off each time the CP says it -sleeps. One of those cycles hangs the SoC, 170-630 s after ONLINE; holding -the link instead crashes the CP (103-108 s after ONLINE with the wake line -high, no GNSS data with it answered). A session lasts one to ten minutes. -The L1 substates, enabled on the real capability offset (0x160, both ends), -take effect but don't stop the cycling (G3-L1, 10-31). Section -"G3, GNSS gets a fix" below, and G3-L1. +Fixed (2026-11-01): the SoC hang under GNSS traffic. The CP link powers +down and up about twice a second, as on stock, and cpif writes the AP2CP +lines on PERIC0 each time; the PERIC0 GPIO bus clock was a manual gate +that the pin controller switched off after every access, and that hung the +SoC within minutes. Kept on +(), five +sessions ran with no reset, the longest 30 minutes and 3759 link cycles +(G3-L1). Left: the GNSS and CPIF drivers aren't in the published kernel, and GNSS still starts by hand. Next: the SIM. The staged plan (sections F, K, U and runbooks M0.2-M6, G1-G4) is below, From d94d4acffa0c380c6e47f4f83ba168a5312d813c Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 23:14:23 -0647 Subject: [PATCH 27/30] MODEM-PLAN: P, how the 9a's modem link goes into the published kernel The 9a's link driver began as a copy of the gs201 controller in kernel #144, so it goes in as a second compatible stacked on that; the section lists what zumapro adds. --- device/tegu/MODEM-PLAN.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index b2d58cac2..946731ea3 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1659,6 +1659,43 @@ HDOP recorded, gnssd stopped when Location is off (the CP stays on). Constellations, SGEE/assistance over the network (gnssd uses libcurl), power: as cheetah's GNSS-PLAN section 7, adapted to gps.cfg's keys. +### P: publishing the 9a's modem link (offline; risk: none until a boot) + +GNSS and the modem run only on the owner's kernel: the link driver +(`tegu-pcie0-cp.ko`) and cpif are out-of-tree modules built against it. +The gs201 versions of both are in review as + (the 7 Pro's +curated modem stack, `pcie-gs201-cp.c` and `drivers/soc/google/cpif`), and +the 9a's link driver began as a copy of that controller, so the 9a goes in +as a second compatible of the same driver, stacked on #144, not as a new +driver. What `google,zumapro-pcie-cp` has to add, from a diff of the two +(2026-11-01): + +- **PHY:** no PHY driver on zumapro: channel 0's sequences run from tables + (power-down clear, configuration, power-down; `tegu-pcie0-seq.h`, from + Google's GPL zuma CAL), plus the host's channel 0 extras: SOC_CTRL + 0x4000 = 0x15, PMU PHY control bit 10 set at power-on, UDBG 0xC800 bits + 6:5 cleared, PMA 0x32C = 0, PCS 0x150 = 0x300d5 after training. +- **iATU:** no secure-ATU SMC: the host writes the unrolled outbound iATU + (DBI + 0x300000): region 0 CFG0 to bus 1 at the config window, region 1 + the first 2 MiB of the memory window. +- **APP_XFER_PENDING** (ELBI 0x74) raised before training and dropped at + the end of link-up; two lanes set in the port logic. +- **No clocks:** stock describes none, and a read of CMU_HSI1's PCIe gate + hung the SoC (M0.4). +- **PHY isolation:** set bypass once and keep it, as stock (no + `use-phy-isol-en` on zumapro); the experiments ran both ways (G3-L1). +- **The doorbell** as a posted write under `cfg_lock` with no read-back + (G3-L1), which suits gs201 too. +- Left out: the L1 substates parameters and the cycle trace, bring-up + only. + +The device tree: HSI1 GEN3A_0 and the modem node from +`device/tegu/overlays/tegu-modem-link.dtso` and `tegu-modem-cpif.dtso` +into `zumapro.dtsi` and `zumapro-tegu.dts`, and the binding extended. +The PERIC0 clock fix (#172) goes in first. Test: a published-style kernel +from #144 plus this, cpif built in-tree, then the G3 session runbook. + ### SIM test (M-SIM), 2026-11-03 (gated runbook, written 2026-10-29) **The runbook to follow when the SIM arrives:** a prepaid physical nano-SIM From c2be8cadfa6c6ada81a928f0dadb64e7cf81d49f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sun, 1 Nov 2026 00:20:23 -0647 Subject: [PATCH 28/30] MODEM-PLAN: P, the 9a's modem link drafted as kernel #173 The zumapro compatible of the gs201 modem link driver and its binding, stacked on kernel #144; the DT nodes follow once that stack is on omamobile. --- device/tegu/MODEM-PLAN.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 946731ea3..68eaa219d 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1695,6 +1695,10 @@ The device tree: HSI1 GEN3A_0 and the modem node from into `zumapro.dtsi` and `zumapro-tegu.dts`, and the binding extended. The PERIC0 clock fix (#172) goes in first. Test: a published-style kernel from #144 plus this, cpif built in-tree, then the G3 session runbook. +The driver and binding are drafted as + (stacked on +#144, `W=1` and checkpatch clean, not booted yet); the DT nodes follow once +#144 is on `omamobile`, whose zumapro board DT the stack's base lacks. ### SIM test (M-SIM), 2026-11-03 (gated runbook, written 2026-10-29) From 95ebe5652d19e80671faf5a761c018d5d6b3a6e4 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sun, 1 Nov 2026 01:22:21 -0647 Subject: [PATCH 29/30] MODEM-PLAN: the review of 11-01: the Location paragraph matches the daily boot, G3-L1 oldest first, the release for each run The daily boot masks none of the GNSS units, so the safety nets are the removal step and omamobile-gnss 0.2.5's hang marker. The G3-L1 runs are in date order, the Wi-Fi candidate is marked superseded, and each run names its kernel release. --- device/tegu/MODEM-PLAN.md | 169 ++++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 82 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 68eaa219d..074cec27d 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -997,7 +997,26 @@ does swapping in gnss_spi (`word32=2`, commit 734f5f8c8 on errors, on a boot without the swap-mode property. The palmtop runs the software swap. -**G3-L1, where in the power-down the SoC hangs (2026-10-31, evening, daily kernel).** +**G3-L1, the L1 substates on for real (2026-10-31, one boot, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** +The controller module's v8 bring-up build (sha256 `dbbb6f5f335f7640…`) +logs each step of its L1SS path behind `trace=1` and with `l1ss=2` enables +the substates at every link-up. The trace answered why the earlier runs +showed nothing: with `l1ss` at its default 0 the requests were dropped. With +`l1ss=2` both ends read back enabled at every link-up (root CTL1 +`0x40a3200f`, endpoint `0x40a3000f`, capability at 0x160 on both). The +cycling did not stop, and that is by design: cpif's `cp2ap_suspend` +handler, the CP saying it sleeps, disables the substates in +`s51xx_pcie_save_state()` and calls `s5100_poweroff_pcie()` about 90 ms +after each enable, so the link powers down and up about twice a second as +on stock. So the substates are not what the cycling lacks. With them on, +one 240 s Location session gave 87 of 155 fixed and the palmtop survived +the session, `omamobile-gnss off`, and minutes of idle cycling, then hung +about 630 s after ONLINE (cycle 1083, last line `up: dbi allowed`, nothing +in pstore). Earlier hangs came about 170 s after ONLINE. One boot each way, +so the substates may delay the hang; they do not prevent it. The next step +is the hang inside one cycle: what follows `up: dbi allowed`. + +**G3-L1, where in the power-down the SoC hangs (2026-10-31, evening, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** A copy of the palmtop's own cpif (the K4 build, `5a10811b940d51ff`) with eight trace lines around `s51xx_pcie_save_state()` and `exynos_pcie_poweroff()`, nothing else changed, and one GNSS session with the @@ -1013,7 +1032,61 @@ power-on, so the next trace goes on the power-on path (`s51xx_pcie_restore_state()` and the link-up). The save-once change alone does not fix the hang. -**G3-L1, two more runs (2026-11-01, daily kernel).** With Wi-Fi left down +**G3-L1, the power-on trace (2026-11-01, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** With the +save-once build plus trace lines through `s5100_poweron_pcie()`, the session +went through 53 power-off/power-on cycles (the previous build 3) and then +hung; the last line was "link ack doorbell", printed after a complete +power-on (link on, config restored, MSI set, RX queues kicked), so the SoC +hung in the link-ack doorbell: the controller's `gs201_pcie_cp_doorbell()` +writes the BAR register under `cfg_lock` and reads it back. Both hangs are +non-posted reads to the endpoint (a config read, a BAR read-back). The root +port's completion timeout is enabled (DEVCAP2 `0x00010c1f`, DEVCTL2 +`0x0405`: range B, 16-55 ms, not disabled), so an unanswered read should +end in an error, not a hang; a silent hang there points at the access +reaching the controller with its clocks or PHY already off (a fabric-level +hang below PCIe) rather than at the endpoint. Next: read the controller's +clock and isolation state at the doorbell (in the controller, under the +same lock), and check whether `cp_link_down()` can run from the +controller's own link-down path without `pcie_onoff_lock`. + +**G3-L1, save-once plus a write-only doorbell (2026-11-01, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** +Both changes together (cpif and the controller from the build tree of the +v8/v9 traces, which drives the PHY from `tegu-pcie0-seq.h`; the tree that +expects a separate PHY driver fails with "no PHY" and then "no PCIe +endpoint for the ROM boot"): the CP came up ONLINE, the session ran 37 +power-off cycles, and the palmtop reset again, the last line right after a +power-off ("kept the saved config"). So the hang has now landed at three +different points (in `pci_save_state()`, at the doorbell after a power-on, +after a power-off). The controller's own interrupt paths are guarded (the +control interrupt is disabled synchronously and its handler checks +`cfg_root_ok` under `cfg_lock`; the MSI queue interrupts are disabled before +isolation), so the remaining suspect is an access by cpif itself to the +modem's BAR window (shared memory, doorbell or MSI registers) racing a +power-off from another path, which the controller cannot guard. Next: +instrument cpif's BAR accesses with the link state at the time of the +access. + +**G3-L1, the controller's own steps traced (2026-11-01, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** +The same pair with a trace line after each step of the controller's +`cp_link_down()` and `cp_link_try()`, the modem started after the boot's +bring-up had finished: 299 power-off cycles before the reset (the runs +before stopped after 8 to 53). The last lines: cycle 292's power-down ran +every step (interrupts off, LTSSM off, soft reset, PHY off, isolated), its +power-up trained ("L0", "settled"), and nothing after it, not even the +"link up: GenN" line, which the controller prints after one PCS write and +two DBI reads of its own registers. So the hang point moves from run to +run (inside cpif's config save, the doorbell, the start of +`cp_link_down()`, and now just after the link settles), and at least once +it is an access to the controller's own registers with the PHY powered and +the link trained. That points at something outside these two drivers +racing them, not at one bad access in their order: candidates are the +Wi-Fi bring-up module on the same boot (PCIe channel 1, its own PMU +isolation register and HSI2 parts), or a PMU or clock change from another +path. Next: one session with Wi-Fi left down for the whole boot. +(Superseded: the next run, with Wi-Fi down, still hung, and the racer +turned out to be the PERIC0 GPIO clock gate, below.) + +**G3-L1, two more runs (2026-11-01, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** With Wi-Fi left down for the whole boot (the BCM4383 firmware moved aside, PCIe channel 1 unbound, no `wl*` interface) the session still hung, after 65 cycles, at the same line as before ("settled"), so the Wi-Fi bring-up is not the @@ -1027,7 +1100,7 @@ setup with Google's (`pcie-exynos-gs`: AXI slave error response, the ELBI error enables), since a stalled access instead of an error response would explain hangs at whatever access comes next. -**G3-L1, a hang with nothing touching the link, and the link held up (2026-11-01, daily kernel).** +**G3-L1, a hang with nothing touching the link, and the link held up (2026-11-01, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** With the controller holding `APP_XFER_PENDING` until the end of each power-up, the session ran 147 power-offs and the palmtop reset. The kernel log streamed over SSH and the console log that systemd-pstore keeps from @@ -1071,7 +1144,7 @@ with the link down and nothing after it in the log. Next: trace lines through cpif's wake work and `s5100_poweron_pcie()` up to its call into the controller. -**G3-L1 found: the PERIC0 GPIO clock gate (2026-11-01, night).** With +**G3-L1 found: the PERIC0 GPIO clock gate (2026-11-01, night, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** With those trace lines the next reset stopped inside `mif_gpio_set_value(AP2CP_WAKEUP, 1, 5)`, and with cpif's `trace_lines` on the one after logged the GPIO write itself as the last line. The AP2CP @@ -1093,77 +1166,6 @@ before reset the palmtop. A 30-minute session on that kernel followed: 3759 link cycles, no reset, 1763 of 1765 fixed. That kernel is the daily kernel from now on (the kit's Image pin in `logs/tegu-review-20261029/runners/lib.sh`). -**G3-L1, the controller's own steps traced (2026-11-01, daily kernel).** -The same pair with a trace line after each step of the controller's -`cp_link_down()` and `cp_link_try()`, the modem started after the boot's -bring-up had finished: 299 power-off cycles before the reset (the runs -before stopped after 8 to 53). The last lines: cycle 292's power-down ran -every step (interrupts off, LTSSM off, soft reset, PHY off, isolated), its -power-up trained ("L0", "settled"), and nothing after it, not even the -"link up: GenN" line, which the controller prints after one PCS write and -two DBI reads of its own registers. So the hang point moves from run to -run (inside cpif's config save, the doorbell, the start of -`cp_link_down()`, and now just after the link settles), and at least once -it is an access to the controller's own registers with the PHY powered and -the link trained. That points at something outside these two drivers -racing them, not at one bad access in their order: candidates are the -Wi-Fi bring-up module on the same boot (PCIe channel 1, its own PMU -isolation register and HSI2 parts), or a PMU or clock change from another -path. Next: one session with Wi-Fi left down for the whole boot. - -**G3-L1, save-once plus a write-only doorbell (2026-11-01, daily kernel).** -Both changes together (cpif and the controller from the build tree of the -v8/v9 traces, which drives the PHY from `tegu-pcie0-seq.h`; the tree that -expects a separate PHY driver fails with "no PHY" and then "no PCIe -endpoint for the ROM boot"): the CP came up ONLINE, the session ran 37 -power-off cycles, and the palmtop reset again, the last line right after a -power-off ("kept the saved config"). So the hang has now landed at three -different points (in `pci_save_state()`, at the doorbell after a power-on, -after a power-off). The controller's own interrupt paths are guarded (the -control interrupt is disabled synchronously and its handler checks -`cfg_root_ok` under `cfg_lock`; the MSI queue interrupts are disabled before -isolation), so the remaining suspect is an access by cpif itself to the -modem's BAR window (shared memory, doorbell or MSI registers) racing a -power-off from another path, which the controller cannot guard. Next: -instrument cpif's BAR accesses with the link state at the time of the -access. - -**G3-L1, the power-on trace (2026-11-01, daily kernel).** With the -save-once build plus trace lines through `s5100_poweron_pcie()`, the session -went through 53 power-off/power-on cycles (the previous build 3) and then -hung; the last line was "link ack doorbell", printed after a complete -power-on (link on, config restored, MSI set, RX queues kicked), so the SoC -hung in the link-ack doorbell: the controller's `gs201_pcie_cp_doorbell()` -writes the BAR register under `cfg_lock` and reads it back. Both hangs are -non-posted reads to the endpoint (a config read, a BAR read-back). The root -port's completion timeout is enabled (DEVCAP2 `0x00010c1f`, DEVCTL2 -`0x0405`: range B, 16-55 ms, not disabled), so an unanswered read should -end in an error, not a hang; a silent hang there points at the access -reaching the controller with its clocks or PHY already off (a fabric-level -hang below PCIe) rather than at the endpoint. Next: read the controller's -clock and isolation state at the doorbell (in the controller, under the -same lock), and check whether `cp_link_down()` can run from the -controller's own link-down path without `pcie_onoff_lock`. - -**G3-L1, the L1 substates on for real (2026-10-31, one boot, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`).** -The controller module's v8 bring-up build (sha256 `dbbb6f5f335f7640…`) -logs each step of its L1SS path behind `trace=1` and with `l1ss=2` enables -the substates at every link-up. The trace answered why the earlier runs -showed nothing: with `l1ss` at its default 0 the requests were dropped. With -`l1ss=2` both ends read back enabled at every link-up (root CTL1 -`0x40a3200f`, endpoint `0x40a3000f`, capability at 0x160 on both). The -cycling did not stop, and that is by design: cpif's `cp2ap_suspend` -handler, the CP saying it sleeps, disables the substates in -`s51xx_pcie_save_state()` and calls `s5100_poweroff_pcie()` about 90 ms -after each enable, so the link powers down and up about twice a second as -on stock. So the substates are not what the cycling lacks. With them on, -one 240 s Location session gave 87 of 155 fixed and the palmtop survived -the session, `omamobile-gnss off`, and minutes of idle cycling, then hung -about 630 s after ONLINE (cycle 1083, last line `up: dbi allowed`, nothing -in pstore). Earlier hangs came about 170 s after ONLINE. One boot each way, -so the substates may delay the hang; they do not prevent it. The next step -is the hang inside one cycle: what follows `up: dbi allowed`. - **The CP link under GNSS traffic, G3-L1's first step answered, and a correction.** With GNSS running for minutes on the normal boot, the hang of 10-29 came back once (CLUSTER0_NONCPU_WDTRESET about 260 s into the boot, @@ -1228,12 +1230,15 @@ lets the link cycle, for as long as the CP link lasts. **Precondition: no `systemd.mask=` for these units on the command line.** `systemctl unmask` can't lift a mask the kernel command line sets, so check `tr ' ' '\n' < /proc/cmdline | grep -E 'mask=omamobile-gnss'` prints nothing first: the daily bootargs mask none of `omamobile-gnss.service`, `omamobile-gnss-nmea.service` or the socket, but the older bring-up overlays (`public-native-root`, `public-phone-local`) mask `omamobile-gnss.service`. **Attended only, and not for the daily boot.** With these drop-ins in place -any GeoClue client can start a session, and a session can still hang the -SoC with the modem up (about 170 s after ONLINE while the link cycles), so -a hang could repeat at every boot. The package's own units are masked on -the 9a by the boot command line (`systemd.mask=omamobile-gnss.service` in -the kit's `package-startup.dtso`); keep that mask until the CPIF link fix -lands, and install the drop-ins only for an attended session: +any GeoClue client can start a session. Before the PERIC0 clock fix +(G3-L1, linux-omarchy-mobile#172) a session with the modem up hung the SoC +170 s to about 26 minutes after ONLINE while the link cycled, so a hang +could repeat at every boot; with the fix, a 30-minute session ran clean, +but the fix isn't merged yet. The daily boot doesn't mask these units, so +the safety nets are the removal step below and omamobile-gnss 0.2.5's hang +marker (), which +skips the start at the next boot after a start that never finished. +Install the drop-ins only for an attended session: ```sh # install (attended, charger in, modem not started this boot) @@ -1242,7 +1247,7 @@ tools/phone-ssh 'cat > /usr/local/sbin/tegu-gnss-start' < device/tegu/bringup/lo tools/phone-ssh 'cat > /etc/systemd/system/omamobile-gnss.service.d/tegu.conf' < device/tegu/bringup/location/omamobile-gnss.service.d-tegu.conf tools/phone-ssh 'cat > /etc/systemd/system/omamobile-gnss-nmea.service.d/tegu.conf' < device/tegu/bringup/location/omamobile-gnss-nmea.service.d-tegu.conf tools/phone-ssh 'chmod 755 /usr/local/sbin/tegu-gnss-start; systemctl daemon-reload; systemctl unmask omamobile-gnss.service omamobile-gnss-nmea.service omamobile-gnss-nmea.socket; systemctl start omamobile-gnss-nmea.socket' -# the boot mask still applies at the next boot, which is intended +# the drop-ins stay until removed: remove them after the session # remove (after the session; a reboot ends the modem anyway) tools/phone-ssh 'systemctl stop omamobile-gnss-nmea.socket omamobile-gnss-nmea.service omamobile-gnss.service; rm -rf /etc/systemd/system/omamobile-gnss.service.d /etc/systemd/system/omamobile-gnss-nmea.service.d /usr/local/sbin/tegu-gnss-start; systemctl daemon-reload' ``` From b674922ca08d22079c4723c4169d89d121abd909 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sun, 1 Nov 2026 14:04:49 -0647 Subject: [PATCH 30/30] device/tegu MODEM-PLAN, NOTES: the fixed-kernel sessions cycled the link; HOLD=0 is the Location default The three sessions on the clock-fix kernel went through the Location switch with omamobile-gnss 0.2.5's start, which never writes keep_link_up, so the link cycled. With linux-omarchy-mobile#172 that is the working setting, so tegu-gnss-start now defaults to HOLD=0 and keeps 1 and 2 as diagnostics; holding the link would crash the CP after about 105 s. The plan names the path, the clock file's blob in the tested Image next to #172's, and drops the private kit path. --- device/tegu/MODEM-PLAN.md | 51 +++++++++++++++----- device/tegu/NOTES.md | 4 +- device/tegu/bringup/location/tegu-gnss-start | 23 +++++---- 3 files changed, 55 insertions(+), 23 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 074cec27d..ab01de2b9 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1164,7 +1164,28 @@ modem modules and nothing held by hand: two more 600 s sessions, 1335 and 1333 link cycles, no reset, 568 of 570 and 558 of 567 fixed. Every session before reset the palmtop. A 30-minute session on that kernel followed: 3759 link cycles, no reset, 1763 of 1765 fixed. That kernel is the daily kernel from now on -(the kit's Image pin in `logs/tegu-review-20261029/runners/lib.sh`). +(the owner's kit pins that Image). + +All three sessions on that kernel took the Location path, with the link +left to cycle: the modem started by hand (`omamobile-tegu-modem-up +--gnss`), Location turned on (`omamobile-gnss on`) and a client connected +for 600 or 1800 s, so `omamobile-gnss-nmea.socket` started +`omamobile-gnss.service` from omamobile-gnss 0.2.5 +(), whose 9a branch +runs the gnss-slsi profile and never writes cpif's `keep_link_up`. That is +`HOLD=0` in the bring-up scripts' terms; neither `tegu-gnss-session` nor +the hand units in `bringup/location/` were on the palmtop then. The clock +file built into Image `7f3674d21e92d758` has blob +`6a23897406017ab7aab70baf27ffa0c28be9accd`: the integration tree's +`clk-zumapro.c` with only the gate's flag changed from `CLK_IGNORE_UNUSED` +to `CLK_IS_CRITICAL`. The tree's copy was put back after the build, so +this was checked by rebuilding the object from that source: it matches the +Image's `clk-zumapro.o` byte for byte with debug info stripped, and the +unchanged file does not. At linux-omarchy-mobile#172's head (c36e4f49d) +the file's blob is `a2811b7fd001a50f0aabf86221326fae44dfe857`. The blobs +differ because the tested tree is the older integration tree; against each +base the change is the same flag on the same gate, and #172 adds a comment +above the table. **The CP link under GNSS traffic, G3-L1's first step answered, and a correction.** With GNSS running for minutes on the normal boot, the hang of @@ -1207,13 +1228,17 @@ lands after isolation), so that the link may cycle as the CP asks. **Left for GNSS:** the GNSS link driver (gnssif) and CPIF aren't in the published kernel, so this runs on the owner's kernel only; linux-omarchy-mobile#150 merged on -2026-10-31 and linux-omarchy-mobile#151 is closed as unnecessary; the CP link under GNSS traffic is unsolved: the hold crashes the CP, -the cycling hangs the SoC; the L1 substates take effect on the real -capability offset but don't stop it (G3-L1, 10-31), and the last trace puts -the hang in cpif's power-down path. A session lasts one to ten minutes. GNSS still starts by hand +2026-10-31 and linux-omarchy-mobile#151 is closed as unnecessary. The SoC +hang under GNSS traffic is fixed by linux-omarchy-mobile#172 (in review, +G3-L1 found): with it the CP link cycles as the CP asks, and sessions of +10 and 30 minutes ran clean; without it the cycling link hangs the SoC 170 s +to about 26 minutes after ONLINE, and holding the link crashes the CP. GNSS +still starts by hand ([`bringup/tegu-gnss-session`](bringup/tegu-gnss-session), which starts the -modem, holds the link after ONLINE for the diagnostic and runs the HAL for a -set time; once per boot), or through Omarchy's Location switch with the hand +modem and runs the HAL for a set time, the link cycling unless `HOLD=1`; +once per boot), or through Omarchy's Location switch: omamobile-gnss 0.2.5 +() with the modem +started by hand first, as in the fixed-kernel sessions, or the hand units in [`bringup/location/`](bringup/location): two drop-ins that make `omamobile-gnss.service` run the 9a's stack instead of the 7 Pro's chip driver, and `tegu-gnss-start`, which brings the modem up with GNSS and runs @@ -1222,10 +1247,14 @@ Tested on 2026-10-30: `omamobile-gnss-nmea.socket` enabled, a client's connect starts the stack, the HAL serves NMEA to `/run/omamobile-gnss/nmea.sock` and the fixes arrive (first fix about 80 s after the connect, 46 of 52 GGA sentences fixed in the first run, with the link held and the wake line left -high, `HOLD=1`). An attended session uses `HOLD=1`, now the script's -default: it is the only setting that moves data. `HOLD=2` (answer the CP -on ap2cp_wakeup) moved none and is kept only as a diagnostic, and `HOLD=0` -lets the link cycle, for as long as the CP link lasts. +high, `HOLD=1`). With linux-omarchy-mobile#172 the cycling link is the +working setting, and `HOLD=0` is the script's default: an attended session +uses it. Without #172 the cycling link hangs the SoC, so don't run these +units on a kernel without it. `HOLD=1` (the link held with the wake line +high: the CP crashes 103-108 s after ONLINE) and `HOLD=2` (the link held +and the CP answered on ap2cp_wakeup: no data) are diagnostics only. The +fixed-kernel sessions went through the package's start, not this script, +so `tegu-gnss-start` with `HOLD=0` still needs its own run on that kernel. **Precondition: no `systemd.mask=` for these units on the command line.** `systemctl unmask` can't lift a mask the kernel command line sets, so check `tr ' ' '\n' < /proc/cmdline | grep -E 'mask=omamobile-gnss'` prints nothing first: the daily bootargs mask none of `omamobile-gnss.service`, `omamobile-gnss-nmea.service` or the socket, but the older bring-up overlays (`public-native-root`, `public-phone-local`) mask `omamobile-gnss.service`. diff --git a/device/tegu/NOTES.md b/device/tegu/NOTES.md index 83385b49f..edce17fc7 100644 --- a/device/tegu/NOTES.md +++ b/device/tegu/NOTES.md @@ -26,8 +26,8 @@ offset 0 with a valid CRC. What ends the fix is the CP link under GNSS traffic: held up it crashes the CP 103-108 s after ONLINE (six boots of six), left to cycle it hung the SoC 170 s to about 26 minutes after ONLINE. That hang was the PERIC0 GPIO bus clock gate (found -2026-11-01, linux-omarchy-mobile#172); with the gate kept on, a 30-minute -session ran clean. Details, the configuration and the sweep in +2026-11-01, linux-omarchy-mobile#172); with the gate kept on and the link +left to cycle, a 30-minute session through the Location switch ran clean. Details, the configuration and the sweep in [MODEM-PLAN](MODEM-PLAN.md) "G3, GNSS gets a fix" and G3-L1. ## 2026-10-30: the hands-on morning (fingerprint, card, USB-C host, GNSS) diff --git a/device/tegu/bringup/location/tegu-gnss-start b/device/tegu/bringup/location/tegu-gnss-start index f2c38ba22..91b2514e7 100755 --- a/device/tegu/bringup/location/tegu-gnss-start +++ b/device/tegu/bringup/location/tegu-gnss-start @@ -9,13 +9,16 @@ # gnss-slsi profile with its NMEA on the FIFO omamobile-gnss-nmea reads. # # Two bring-up limits, both in the plan: the modem starts once per boot (a -# second start needs a reboot), and the CP's PCIe link under GNSS traffic is -# unsolved, so a session lasts a minute or two. HOLD picks which way it fails: -# 1 (default, the one an attended session uses: the only setting that moves -# data) holds it with the line high (the CP then crashes 103-108 s after -# ONLINE), 2 holds the link and answers the CP on ap2cp_wakeup (moves no -# data; a diagnostic), 0 lets the link cycle (the SoC hangs some minutes -# after ONLINE). +# second start needs a reboot), and the CP's PCIe link cycles about twice a +# second under GNSS traffic. With linux-omarchy-mobile#172 (the PERIC0 GPIO +# bus clock kept on) the cycling link is the working setting: 10- and +# 30-minute sessions ran clean with it (MODEM-PLAN G3-L1 found). Without +# #172 the SoC hangs 170 s to about 26 minutes after ONLINE, so don't run +# this on a kernel without it. HOLD sets cpif's keep_link_up: +# 0 (default, the one an attended session uses) lets the link cycle as the +# CP asks; 1 holds it with the wake line high (the CP crashes 103-108 s +# after ONLINE) and 2 holds it and answers the CP on ap2cp_wakeup (moves no +# data). 1 and 2 are diagnostics only. # # Install: /usr/local/sbin, with the two drop-ins beside this file. set -euo pipefail @@ -28,9 +31,9 @@ if ! systemctl is-active -q omamobile-tegu-modem; then fi /usr/local/bin/omamobile-tegu-modem-up --gnss fi -# The CP's link: see HOLD in the header. Nothing here fixes it; this only -# chooses which failure the session gets. -echo "${HOLD:-1}" > /sys/module/cpif/parameters/keep_link_up 2>/dev/null && +# The CP's link: see HOLD in the header. 0 leaves it to cpif; 1 and 2 are +# diagnostics. +echo "${HOLD:-0}" > /sys/module/cpif/parameters/keep_link_up 2>/dev/null && say "CP link: keep_link_up=$(cat /sys/module/cpif/parameters/keep_link_up)" for _ in $(seq 1 120); do grep -q "@GNSSND" /proc/net/unix && break; sleep 0.25; done grep -q "@GNSSND" /proc/net/unix || { say "gnssd is not listening (the modem profile ran without GNSS?)"; exit 1; }