Repository navigation
omamobile-device-tegu: keep the cores out of C2 through a sleep (the 9a's silent no-wake) - #591
Conversation
With every core in the core power-down state (C2) entered through s2idle's own path the Pixel 9a sometimes never woke, after 6 to 135 sleeps; with C2 off for the sleep 300 of 300 RTC-woken sleeps came back. A systemd-sleep hook disables every idle state deeper than state0 before the sleep and enables the ones it disabled after the wake, so the cores still power down while awake. It does nothing on a kernel without deeper states (the published device tree has none yet) or while /etc/omamobile/cpuidle-keep-across-sleep exists, and a sleep written straight to /sys/power/state skips it, as it skips the NFC hook.
|
Thank you, @W4HO-ham. This is the hook I had in mind, and the three-row table I ran the checks and the sleep-hooks test on a merge with today's main; all
Smaller, not blocking: I'll set the version at merge (0.2.11 is free today). |
…'s states before a new sleep A pre pass whose post pass never ran left its note behind, and the next pre deleted it, took the states it had disabled itself for hand-disabled ones, and the post then restored nothing: C2 stayed off for the rest of the boot with no log line. The pre pass now enables a leftover note's states first, which also keeps the keep flag honest, and both passes log a write that fails. The test runs pre, pre, post, the keep flag after a leftover, and a state that can't be written.
|
Both points are in. 1. A second 2. The series through the hook (2026-11-09, 19:32 to 20:17 MST,
On the wording: agreed on "keeps C2 out of the sleep" rather than "the fix". The published-tree no-wake hasn't come back in 73 sleeps there (kernel #224), but it isn't explained either. |
|
Thank you, @W4HO-ham. Both points are in, and your fix for the leftover note The series is what I asked for: 40 of 40 through the hook with nothing set by I ran the checks and the sleep-hooks test on a merge with today's main; all |
Main took 0.1.17 (derekross#568) and 0.3.33 (derekross#569) for other changes and omamobile-device-tegu 0.2.11 (derekross#591), so this branch's packages move to the next numbers and the README names the modem package version the stop command comes with.
… failures and the sleep series scripts (#409) The Pixel 9a's sleep record through 2026-11-10: dead storage after a wake traced to the UFS pads coming back as inputs (kernel #224, in review), the silent no-wake with C2 entered through s2idle (the hook of #591), and an open no-wake on the published kernel (one in 22, then one in 213 with a console that shows one core not answering). Adds the series, loop and check scripts under device/tegu/bringup/. AGENTS.md and the Suspend cell in DEVICES carry the open no-wake and the rule that the first run of any new kernel, module or script is attended.
derekross#591) A sleep hook for the Pixel 9a keeps the cores out of the C2 idle state through a systemd sleep and gives it back afterwards. Measured by the contributor on the 9a: 19.9 to 57.1 s of state1 per core through a sleep without the hook, 0.7 to 2.3 s with it, and 40 of 40 sleeps woke through the hook. It keeps C2 out of the sleep; it is not a fix for the sleeps that never woke. A repeated "pre" no longer loses the saved state.
… failures and the sleep series scripts (derekross#409) The Pixel 9a's sleep record through 2026-11-10: dead storage after a wake traced to the UFS pads coming back as inputs (kernel derekross#224, in review), the silent no-wake with C2 entered through s2idle (the hook of derekross#591), and an open no-wake on the published kernel (one in 22, then one in 213 with a console that shows one core not answering). Adds the series, loop and check scripts under device/tegu/bringup/. AGENTS.md and the Suspend cell in DEVICES carry the open no-wake and the rule that the first run of any new kernel, module or script is attended.
The fix for the second of the Pixel 9a's two suspend failures (device/tegu SLEEP-PLAN S1, #409): the silent no-wake. With every core in the core power-down state (C2) entered through s2idle's own path, the palmtop sometimes never woke, not from the RTC alarm and not from the power key, after 6 to 135 sleeps. With C2 off for the sleep, 300 of 300 RTC-woken sleeps came back. This is the sleep hook the review of kernel #224 suggested in place of that PR's
google,no-s2idleproperty./usr/lib/systemd/system-sleep/omamobile-tegu-cpuidle: before a sleep it disables every idle state deeper than state0 that is enabled, on every CPU, and notes which; after the wake it enables the noted ones again, so the cores still power down while the palmtop is awake. A state disabled by hand stays disabled. On a kernel without deeper states (the published zumapro device tree has none yet) it does nothing, and it only logs while/etc/omamobile/cpuidle-keep-across-sleepexists, for testing C2 in the sleep on purpose. Like the NFC hook, it covers a systemd sleep only.This hook has been here before. #255 proposed the same hook under the same name on 11-01 and I withdrew it the same day: its reason then, sleeps that ended after a second, was my measurement error (dmesg deltas across a suspend). The reason now is a different and measured one, the no-wake above, with the 300 of 300 behind it. What #255's closing note said about cost still holds: with WFI only, the s2idle loop doesn't freeze the tick, so the sleep is shallower than C2 would make it. On this kernel that costs nothing measurable yet (the drain asleep is about 300 mA either way, because nothing below the CPUs sleeps), and a sleep that always wakes comes first; when C2's wake path is understood (the PMU handshake the review of kernel #224 points at), the hook goes away or turns into the keep flag's default.
On the palmtop (2026-11-09)
The owner's integration kernel,
7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirtybuild #100, whose C2 states carry the oldgoogle,no-s2idleproperty. Each row is one 60 s RTC-wokensystemctl suspendwith every CPU'scpuidle/state0andstate1usageandtimeread just before and just after (device/tegu/bringup/sleep-cpuidle-check.shon #409's branch; the maintainer's read-only check):state1/disableset by hand for the sleepThe hook's log for the third:
pre: 8 deeper idle states disabled for the sleep,post: 8 idle states enabled again;state1/disableread 0 on all eight CPUs before and after. The first row is also the answer to the review's question on kernel #224: withenter_s2idlecleared, the cores did spend the sleep in C2 through the ordinary idle path.What this rests on from before: the 300 of 300 with state1 disabled for the whole run (#96, 2026-11-07/08), and the no-wakes with C2 through s2idle's own path (18, 6 and up to 135 sleeps). A long series with the hook itself, in place of the by-hand disable, hasn't run yet; it is the same sysfs write, and I'll run one and add it here.
Tests
test/sleep-hooks(a scratch/syswith two CPUs and two deeper states: disabled before, the hook's own enabled again after, a hand-disabled one left alone, no note left; the keep flag; a kernel without deeper states),test/all(staged and executable),tools/pr-check origin/main,shellcheck -S warning.The version is yours at merge; I used 0.2.11, which #372 and #590 also pass.