From 53c898ccde709c0fb737438e20d619bc8462c23f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 28 Oct 2026 19:10:45 -0647 Subject: [PATCH 1/5] AGENTS: on the 9a, stopping NFC polling keeps the palmtop up but not NFC After an s2idle wake the ST54L has lost its NCI state until neard powers the adapter off and on (#132), so the sleep hook should power it off rather than only stop polling. The first test of that hook didn't wake, so it stays attended. --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 7f76d22ce..ab5cb8489 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -171,7 +171,7 @@ 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. 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. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" +- **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. 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. Stopping the poll keeps the palmtop alive but not NFC: after a wake the ST54L has lost its NCI state (the first I2C send gets no ACK, `Error -6`, and every NCI request then times out) until neard powers the adapter off and on, which runs a fresh NCI init ([#132](https://github.com/derekross/omarchy-mobile/issues/132)). So the hook should power the adapter off before the sleep and on after it. That version is on the palmtop but not proven: in its first RTC test (2026-10-28) the palmtop didn't wake, cause unknown, so test it attended. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" - **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 - **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 From 5f2ae680eecc2c09874ee608ce2a6925d9eb03c8 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 28 Oct 2026 20:02:22 -0647 Subject: [PATCH 2/5] AGENTS, tegu MODEM-PLAN: keep the stop-poll hook until the power-off one wakes Review: the gotcha now says what was observed (no I2C ACK after the wake), keeps the stop-poll hook, and describes the power-off hook as the candidate under test that must stop polling and check Powered first. MODEM-PLAN's suspend section records the 10-28 results with the kernel release. --- AGENTS.md | 2 +- device/tegu/MODEM-PLAN.md | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index ab5cb8489..b7080f697 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -171,7 +171,7 @@ 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. 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. Stopping the poll keeps the palmtop alive but not NFC: after a wake the ST54L has lost its NCI state (the first I2C send gets no ACK, `Error -6`, and every NCI request then times out) until neard powers the adapter off and on, which runs a fresh NCI init ([#132](https://github.com/derekross/omarchy-mobile/issues/132)). So the hook should power the adapter off before the sleep and on after it. That version is on the palmtop but not proven: in its first RTC test (2026-10-28) the palmtop didn't wake, cause unknown, so test it attended. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" +- **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. 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. Stopping the poll keeps the palmtop up but not NFC: after a wake the ST54L doesn't answer on I2C (`Error -6 on I2C send`, also after the driver's retry) and every NCI request then times out, until neard powers the adapter off and on, which runs a fresh NCI init ([#132](https://github.com/derekross/omarchy-mobile/issues/132)). A hook that powers the adapter off before the sleep and on after it is being tested, but it isn't proven: in its first RTC test (2026-10-28, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`) the palmtop didn't wake, cause unknown. Until it wakes in attended runs, keep the stop-poll hook. neard's `Powered = false` is a device-down that the kernel refuses (`EBUSY`) while the adapter polls, so such a hook stops the poll loop first and checks that `Powered` reads false before the sleep. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" - **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 - **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 diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 191187207..954e26f7f 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -560,6 +560,19 @@ startNmea 25; callbacks location 4, NMEA 5). unknown: suspend with the modem on is still unqualified on the 9a (AGENTS.md, "Suspend and modem"). +NFC across s2idle (2026-10-28, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`): +with polling stopped by the sleep hook, the palmtop wakes, but NFC doesn't +work afterwards. The first send after the wake gets no I2C ACK (`nxp-nci_i2c +25-0008: NFC: Error -6 on I2C send`, also after the driver's 110 ms retry), +and every NCI request then times out. Powering the adapter off and on +through neard (a fresh NCI init) brings it back (#132). A hook that stops +the poll loop and powers the adapter off before the sleep, and on after it, +was tried once that day with an RTC wake: the palmtop didn't wake and +needed the power key. Whether the power-off took effect isn't known: the +hook discarded neard's errors, and none of the journals kept from that day +shows that sleep. The stop-poll hook stays until a power-off hook that checks +`Powered` wakes in attended runs. + ### M2: the link only (modem link driver, `allow_hw=1`; risk: medium) One step per run, the CPIF overlay not applied, the link overlay applied From 8a00ea824cf8ce27a5db6a3dcb2cbd6fb2bf8688 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 28 Oct 2026 23:10:02 -0647 Subject: [PATCH 3/5] AGENTS: the ST54L's NFC mode, not a power-off hook The NACK after a wake was the controller idling without its NFC mode on; linux-omarchy-mobile#131 turns it on, and NFC then polls after a wake with the stop-poll hook alone. --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index b7080f697..71ca3c5fe 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -171,7 +171,7 @@ 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. 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. Stopping the poll keeps the palmtop up but not NFC: after a wake the ST54L doesn't answer on I2C (`Error -6 on I2C send`, also after the driver's retry) and every NCI request then times out, until neard powers the adapter off and on, which runs a fresh NCI init ([#132](https://github.com/derekross/omarchy-mobile/issues/132)). A hook that powers the adapter off before the sleep and on after it is being tested, but it isn't proven: in its first RTC test (2026-10-28, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`) the palmtop didn't wake, cause unknown. Until it wakes in attended runs, keep the stop-poll hook. neard's `Powered = false` is a device-down that the kernel refuses (`EBUSY`) while the adapter polls, so such a hook stops the poll loop first and checks that `Powered` reads false before the sleep. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" +- **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. 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 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 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, NFC polls again after a wake with the stop-poll hook alone (2026-10-29, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`), so no power-off hook is needed. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" - **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 - **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 From 47180f57240f63a3dbe564791654c04a4a51fc9c Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Thu, 29 Oct 2026 10:03:03 -0647 Subject: [PATCH 4/5] device/tegu MODEM-PLAN, AGENTS: the 10-29 NFC results, the tested build, #131 as a link The plan's NFC paragraph still ended with the 10-28 rule (keep the stop-poll hook until a power-off hook wakes) while AGENTS.md said no power-off hook is needed. The 10-28 paragraph stays as that day's record, and a dated 10-29 paragraph follows it: the hook reworked to check Powered woke 1 of 1 but NFC had already failed before the sleep; the no-sleep A/B/C table from #132 (NACK from about 3 s of idle, with and without the set-config, with and without quick retries); the cause (the ST54L's NFC mode never turned on) and its fix, linux-omarchy-mobile#131; what passed with it (3 s to 3 minutes of idle, two RTC-woken s2idle cycles); and what was ruled out, including how the clock pad was forced on (a test module through the kernel's PMU regmap, not userspace). The release is the same for the runs with and without the fix, so both files name the tested core.c by its blob id, 77fc35b61da5, the head of #131. The AGENTS line now gives the count behind "polls after a wake with the stop-poll hook alone": one RTC-woken cycle without the power-off hook, for which it isn't recorded whether polling was stopped, so it needs a re-run with the hook's log; the stop-poll rule itself still rests on the 35 of 35 of 10-27. linux-omarchy-mobile#131 is written as a full link wherever it appears, since a bare cross-repository reference doesn't become one in a file. --- AGENTS.md | 2 +- device/tegu/MODEM-PLAN.md | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 71ca3c5fe..aecb176f1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -171,7 +171,7 @@ 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. 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 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 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, NFC polls again after a wake with the stop-poll hook alone (2026-10-29, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`), so no power-off hook is needed. [tegu MODEM-PLAN](device/tegu/MODEM-PLAN.md) "Suspend with the modem on" +- **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. 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 (`core.c` blob `77fc35b61da5`; the release, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`, is the same as without it), 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 "polls 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" - **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 - **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 diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 954e26f7f..a8a28c274 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -573,6 +573,56 @@ hook discarded neard's errors, and none of the journals kept from that day shows that sleep. The stop-poll hook stays until a power-off hook that checks `Powered` wakes in attended runs. +NFC's silence is idle, not s2idle (2026-10-29, the same release +`7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty` as the day before, +so the release doesn't tell the builds apart: the 10-28 runs had the earlier +modules, the set-config from linux-omarchy-mobile#100 and no NFC mode; the +runs with the fix below had `drivers/nfc/nxp-nci/core.c` blob +`77fc35b61da5`, the head of +[linux-omarchy-mobile#131](https://github.com/derekross/linux-omarchy-mobile/pull/131)). +First the power-off hook, reworked to stop the poll loop, power the adapter +off, check `Powered` and log each step, woke 1 of 1 (unattended, RTC +60 s, +the modem not started; the log read `polling=false powered=false` before the +sleep and `powered=true` after, the palmtop back after 65 s). But in that +boot NFC had already failed before any sleep (`Error -6 on I2C send` at 76 s +and 95 s, the suspend at 100 s), and it failed the same way after a plain +power off and on with no sleep: init got as far as the ST54L's proprietary +`ntf 0x107`, then the first command about 2 s later got no ACK and the poll +start timed out. The one-variable comparison, with no sleep at all +([#132](https://github.com/derekross/omarchy-mobile/issues/132)): each driver +variant powered the adapter on through neard and started polling after a set +delay. + +| Driver | 1 s | 3 s | 10 s | 30 s | +| --- | --- | --- | --- | --- | +| the boot's modules | polls | NACK, no poll | NACK, no poll | NACK, no poll | +| A: no ST54L set-config | polls | NACK | NACK | NACK | +| B: 5 quick retries, 2 ms apart | polls | NACK (retries end in -6) | NACK | NACK | +| C: candidate [linux-omarchy-mobile#128](https://github.com/derekross/linux-omarchy-mobile/pull/128) | polls | no poll | NACK | no poll | + +So from about 3 s of idle the first command gets no ACK, with and without the +set-config and with and without quick retries (B logged "5 quick retries, +result -6" on almost every failure). The cause: ST's HAL turns the ST54L's +NFC mode on after CORE_INIT (PROP_NFC_MODE_SET, `2f 02 02 02 01`) and then +initializes it again, and nxp-nci never did. Without that step the +controller goes silent on I2C about 2-3 s after init whenever it isn't +discovering; with discovery running it never gets there, which is why it read +cards on 10-27 and 10-28 and why it looked sleep-related. The fix is +[linux-omarchy-mobile#131](https://github.com/derekross/linux-omarchy-mobile/pull/131) +(now the palmtop's boot NFC driver). With it the palmtop polls after 3 s to +3 minutes of idle, and polled after two RTC-woken s2idle cycles, one with the +power-off hook and one without it, all with no NACK. Whether the poll loop +was stopped for the cycle without the hook isn't recorded, so that cycle +says nothing about the stop-poll rule yet (the 35 of 35 of 10-27 stand) and +must be re-run with the hook's log. Ruled out on the way: the set-config +(A), quick retries (B; C, #128, closed), the clock pad forced on (a test +module through the kernel's SMC-backed PMU regmap, one register, 0x3e84 bit 0 +set and bit 16 cleared: the NACKs went on, read back as before when it was +put back; `logs/tegu-nfc-sleep-20261029/tegu-nfc-clkpad2.c`), runtime PM and +the interrupt. So no power-off hook is needed for NFC to come back after a +wake; the stop-poll hook stays, for the reset of 10-27, which this doesn't +explain. + ### M2: the link only (modem link driver, `allow_hw=1`; risk: medium) One step per run, the CPIF overlay not applied, the link overlay applied From fab2290c5a8d7614dcee7ad5bfb9cbe3d39a481c Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Thu, 29 Oct 2026 12:23:51 -0647 Subject: [PATCH 5/5] device/tegu MODEM-PLAN, AGENTS: which #131 the NFC results are from The idle and s2idle results of 10-29 ran on linux-omarchy-mobile#131's first version (core.c blob 77fc35b61da5, a fixed 200 ms wait after the reset). The version that merges waits for the controller's CORE_RESET_NTF instead (c96704ddd480) and was re-run the same day for six power-ons and polling at 3 s and 30 s after power-on, with no NACK. Both files now say which build each result is from, so nobody reads the s2idle cycles as tested on the merged code. The AGENTS line also quoted a phrase that the previous push removed, so the quotation pointed at nothing. It now says plainly that 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. --- AGENTS.md | 2 +- device/tegu/MODEM-PLAN.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index aecb176f1..66d6a27fe 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -171,7 +171,7 @@ 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. 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 (`core.c` blob `77fc35b61da5`; the release, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`, is the same as without it), 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 "polls 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, 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. 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" - **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 - **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 diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index a8a28c274..9495d433d 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -614,7 +614,12 @@ cards on 10-27 and 10-28 and why it looked sleep-related. The fix is power-off hook and one without it, all with no NACK. Whether the poll loop was stopped for the cycle without the hook isn't recorded, so that cycle says nothing about the stop-poll rule yet (the 35 of 35 of 10-27 stand) and -must be re-run with the hook's log. Ruled out on the way: the set-config +must be re-run with the hook's log. Those results are from #131's first +version (`core.c` blob `77fc35b61da5`, a fixed 200 ms wait after the reset); +the merged version waits for the controller's CORE_RESET_NTF instead +(`c96704ddd480`) and was re-run the same day for six power-ons (55-60 ms +each, one 160 ms, no NACK, no timeout) and polling at 3 s and at 30 s after +power-on, no NACK. Ruled out on the way: the set-config (A), quick retries (B; C, #128, closed), the clock pad forced on (a test module through the kernel's SMC-backed PMU regmap, one register, 0x3e84 bit 0 set and bit 16 cleared: the NACKs went on, read back as before when it was