Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link
### Suspend and modem

- **On the 9a, NFC must not poll through s2idle.** A suspend with neard polling reset the palmtop (2026-10-27); with polling stopped, 35 s2idle cycles with RTC wakes that day all woke (`7.3.0-rc6-omamobile-tegu-s2mpg15-m1`). The cause isn't known: nxp-nci has no PM callbacks, but neither does the 7 Pro's st-nci, so the controller's interrupt or the I2C bus during the freeze are the next suspects. A sleep hook on the palmtop, `omamobile-tegu-nfc` (not in the repository yet; it comes with tegu's device package), stops neard's poll loop before a systemd sleep and restarts it after; a sleep written straight to `/sys/power/state` (`rtcwake -m mem`) skips the hook, so stop polling by hand first. Without [linux-omarchy-mobile#131](https://github.com/derekross/linux-omarchy-mobile/pull/131) the ST54L also doesn't answer on I2C after a wake (`Error -6 on I2C send`, also after the driver's retry), or after about 2-3 s of idle at any time, until neard powers it off and on ([#132](https://github.com/derekross/omarchy-mobile/issues/132)): nxp-nci never turned its NFC mode on, as ST's HAL does after init. With #131 (the results below on `core.c` blob `77fc35b61da5`, #131's first version; the merged version, `c96704ddd480`, re-run for six power-ons and polling at 3 s and 30 s; the release, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`, is the same as without the fix), NFC polls after 3 s to 3 minutes of idle and polled again after two RTC-woken s2idle cycles (2026-10-29): one with a hook that stops polling and powers the adapter off, and one without that hook, for which it isn't recorded whether polling was stopped, so whether NFC comes back after a wake with the stop-poll hook alone rests on that one cycle and needs a re-run with the hook's log. No power-off hook is needed for NFC; the stop-poll rule above stands on its 35 of 35. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on"
- **On the 9a, sleep tests are attended, and the direct freeze path is still not used.** Four sleeps have never woken (not from the RTC alarm, not from the power key; Power + Volume Up to reset, nothing in pstore): two direct `rtcwake -m freeze` runs (2026-10-28, 2026-10-29), one 30-minute `systemctl suspend` with `tegu-mif-sleep` loaded (2026-10-30, cable out) and the sixth 30 s `systemctl suspend` cycle on 2026-10-30 (the daily boot, no module; it left the USB bus); 35 short and seven longer systemd sleeps woke (two 30-minute and four 240 s ones on 2026-10-29, a cable-in 30-minute one with the module on 2026-10-30; the afternoon's cable-out run with the module makes eight). No single factor explains it, so keep sleep tests attended, keep `power-ab` on `--suspend systemd` (the sleep hooks run that way), and don't load `tegu-mif-sleep` at boot until the hang is understood. The shell's auto-sleep (the `omamobile-sleep` toggle, systemd path, no module) woke every time while it was on, including seven sleeps of 11 s to 22 minutes in a day of use on 2026-11-01 (lengths from the RTC); the package ships it off, and the owner turned it back on on the palmtop that day, so keeping it on is the owner's call. [tegu SLEEP-PLAN](device/tegu/SLEEP-PLAN.md) S1
- **On the 9a, a new sleep test runs attended first, and the direct freeze path is still not used.** Unattended sleep series are allowed since 2026-11-05 (#409) on the contributor's conditions and three of the maintainer's. The contributor's: on the charger with the cable in; the modem off for the boot; the script stops itself on any UFS error line or oops; a wake with dead storage (SSH still answers) gets `echo b > /proc/sysrq-trigger` remotely, and only a silent hang waits for the owner's buttons; the owner says yes before each run. (Their "slot B marked" condition is not part of it: marking B on the 9a stays on hold, see the boot chain notes above, so a series that resets the palmtop spends ABL tries and stays short.) The maintainer's: nothing new (a kernel, a module or a script) runs unattended before one attended run of it; the automatic sysrq recovery is capped per night, and the next boot's ext4 recovery is checked and recorded; and the recovery script is in the tree (`device/tegu/bringup/`, where the series scripts already are) before it runs unattended. The plan says which rule each step runs under, and the counts below are the early ones; [tegu SLEEP-PLAN](device/tegu/SLEEP-PLAN.md) keeps the current tally. Four sleeps have never woken (not from the RTC alarm, not from the power key; Power + Volume Up to reset, nothing in pstore): two direct `rtcwake -m freeze` runs (2026-10-28, 2026-10-29), one 30-minute `systemctl suspend` with `tegu-mif-sleep` loaded (2026-10-30, cable out) and the sixth 30 s `systemctl suspend` cycle on 2026-10-30 (the daily boot, no module; it left the USB bus); 35 short and seven longer systemd sleeps woke (two 30-minute and four 240 s ones on 2026-10-29, a cable-in 30-minute one with the module on 2026-10-30; the afternoon's cable-out run with the module makes eight). No single factor explains it, so keep `power-ab` on `--suspend systemd` (the sleep hooks run that way), and don't load `tegu-mif-sleep` at boot until the hang is understood. The shell's auto-sleep (the `omamobile-sleep` toggle, systemd path, no module) woke every time while it was on, including seven sleeps of 11 s to 22 minutes in a day of use on 2026-11-01 (lengths from the RTC); the package ships it off, and the owner turned it back on on the palmtop that day, so keeping it on is the owner's call. [tegu SLEEP-PLAN](device/tegu/SLEEP-PLAN.md) S1
- **On the 9a, a sleep can end badly in two ways: UFS fails to come back and the root filesystem goes read-only, or the SoC hangs and leaves the USB bus.** The first seen once on 2026-10-30 (`link startup failed 1`, `Host init failed 1` x5, `ufshcd_wl_resume failed`, then `I/O error, dev sda` and ext4 `emergency_ro`; `spm_lvl` 5). The palmtop woke on its alarm but nothing on disk could be read: `systemctl suspend`/`reboot` did nothing, the power key could not light the screen, SSH kept answering from memory. A dark palmtop that ignores the power key may therefore be awake with dead storage, not asleep. After every s2idle, `dmesg | grep -E "link startup failed|Host init failed|I/O error"` first; if it matches, `echo b > /proc/sysrq-trigger` (binaries won't load), then check the ext4 recovery on the next boot. [tegu SLEEP-PLAN](device/tegu/SLEEP-PLAN.md) S1
- **UFS must be at `spm_lvl` 5 in system suspend.** At the core default 3, UFS failed its first hibern8 exit on resume and needed a host reset (it recovered, no I/O errors); at 5 the first real s2idle freeze resumed clean. gs201 now defaults to 5 in the kernel (S3a, `a7e5e1d95`), so a suspend test only checks that `spm_lvl` reads 5; on a kernel without that commit, `echo 5` first. [SUSPEND-PLAN](device/cheetah/SUSPEND-PLAN.md) S1-S3
- **UFS must be at `spm_lvl` 5 in system suspend.** At the core default 3, UFS failed its first hibern8 exit on resume and needed a host reset (it recovered, no I/O errors); at 5 the first real s2idle freeze resumed clean. gs201 defaults to 5 in the kernel (S3a, `d0c08c464ef8` on `omamobile`), and gs101 too since linux-omarchy-mobile#188 (2026-11-04), so a suspend test only checks that `spm_lvl` reads 5; on a kernel without those commits, `echo 5` first. [SUSPEND-PLAN](device/cheetah/SUSPEND-PLAN.md) S1-S3
- **Only s2idle, never `deep`.** The firmware advertises PSCI SYSTEM_SUSPEND, so mainline offers `deep`, but Linux has no gs201 SoC sleep sequence (SYS_SLEEP), and the phone wouldn't wake. `mem_sleep_default=s2idle` in the bootargs and device-cheetah's `sleep.conf` drop-in keep it on s2idle. [SUSPEND-PLAN](device/cheetah/SUSPEND-PLAN.md) §1, §5
- **Some unattended RTC cycles wake early on the PMIC interrupt** (2 of 20 in S4, 4 of 31 in S5c, at 13-16 s instead of 30 s). Which PMIC event it is hasn't been read yet; count it, don't treat it as a failed cycle. [SUSPEND-PLAN](device/cheetah/SUSPEND-PLAN.md) S4, S5c
- **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.
Expand Down