Skip to content

device/husky: a suspend runbook before the first attended test - #724

Merged
derekross merged 3 commits into
derekross:mainfrom
gitColinX:husky-suspend-plan
Nov 15, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
gitColinX:husky-suspend-plan

Conversation

@gitColinX

@gitColinX gitColinX commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

@derekross, this is the short runbook you asked for on #656 before anyone runs an attended suspend test on an 8 Pro. It is documentation only, and nothing in its stages has run on my unit yet.

What's in it

device/husky/SUSPEND-PLAN.md, on the model of cheetah's and raven's plans:

  • Your three points, with what my unit shows (read only, G1MNW, -g755b5d1c5532, device-husky 0.1.10):
    • Wi-Fi: there is no husky sleep hook (only Omarchy's unmount-fuse in system-sleep/), and whether brcmfmac's D3 handshake works on zuma is unknown. So every stage unloads brcmfmac_wcc brcmfmac pcie_gs201 first and reloads after, as raven's second battery run did.
    • UFS: spm_lvl 5 at boot, rpm_lvl 3; checked again before every stage.
    • NFC: no driver bound and no /sys/class/nfc; checked before every stage, and a bound driver stops the test.
  • The rest of what cheetah and raven needed: s2idle only (freeze, never mem); no cpuidle on husky (current_driver none), so these stages test sleeping and waking, not battery life.
  • Wake sources and state: pmic-1 and its RTC, gpio-keys, the gauge, the Wi-Fi function and the Bluetooth serdev are wakeup-enabled; no interrupt storm at idle; suspend-off is set, so the unit has never slept on its own.
  • Recovery and stop conditions, with husky's buttons (Power + Volume Up for a freeze, as UFS-PLAN U5) and slot B's retries.
  • Four stages: H1 pm_test freezer/devices/platform; H2 one rtcwake -m freeze -s 30; H3 systemctl suspend woken by Power (Lef's omamobile-sleepd: notice a resume when logind says so, not at the next poll #642 path); H4 ten cycles. Each is attended, on the cable, and one per go-ahead.
  • Left for later, on purpose: battery numbers, a husky omamobile-sleep hook (raven's, in unload mode first), auto sleep, NFC with its driver bound, the modem, the AoC, SYS_SLEEP.

The ROADMAP Suspend row and UFS-PLAN U6 now point to it. U6 said its runbook would come after U5; I wrote it before, since Lef's systemctl suspend runs (#640, #642) already took UFS through system suspend at spm_lvl 5. If you'd rather keep U5 first, I'll put that order back.

Questions before I run H1

  1. Is unloading Wi-Fi and the PCIe host before each stage the way you want it on husky, until a hook exists?
  2. My everyday kernel is Brett's husky-test-20261109-t1 tag plus the RTC commits (AGENTS: a plugin's link in ~/.config/omarchy/plugins outranks the package #243), because plain omamobile doesn't have the GPU and DVFS series yet (tools/power-ab: a systemd suspend mode, and a gauge without charge_counter #157, tools/extract-vendor-firmware: the Pixel 9a's firmware #158). Is that kernel fine for these stages, or do you want them on omamobile itself?

@Somnius, your #640 and #642 runs are credited at the top as the first s2idle on an 8 Pro. If you have the kernel you ran them on, I'd add it to the Results section.

Checks

  • tools/pr-check origin/main: all ok.
  • The commands in section 3 haven't run yet. H0's read-only survey ran on 2026-11-12.

@gitColinX

Copy link
Copy Markdown
Contributor Author

@derekross, one more 8 Pro question while you're here, separate from the runbook: should a husky install take today's Omarchy 4.5 update yet?

My unit is showing "Omarchy 4.5.0-3 is ready" (stable channel; it has omarchy 4.0.6 and omamobile-device-husky 0.1.10). I've held off for two reasons:

  1. /etc/omamobile/boot-update.conf says AUTO_WRITE=yes (written by install-phone). If the update brings a husky kernel through omamobile-boot-update, slot B would get omamobile's kernel, which doesn't have the GPU and DVFS series (tools/power-ab: a systemd suspend mode, and a gauge without charge_counter #157, tools/extract-vendor-firmware: the Pixel 9a's firmware #158) that my everyday kernel carries. I couldn't tell from the release notes whether a husky install gets a kernel package at all.
  2. Cap swap on zram at half the RAM before the image moves past Omarchy 4.0.6 #528: 4.5 turns on zram at the size of RAM, and the husky kernel has the zram module (drivers/block/zram/zram.ko). That's the setting that hung the 9a, and Cap swap on zram at half the RAM before the image moves past Omarchy 4.0.6 #528 is still open.

Is it fine to update a husky phone now, or should I set AUTO_WRITE=no first, or wait? Happy to run the update attended and report back if that's useful.

@derekross

Copy link
Copy Markdown
Owner

Thank you, Colin. This is the runbook I asked for, and more: the three points with what your unit actually shows, the rest of what the 7 Pro and the 6 Pro needed, the wake sources and inhibitors, and a clear line on what it leaves for later. I checked the facts I could against the trees: mem_sleep_default=s2idle is in the published zuma-husky.dts since kernel #244, which your H0 kernel predates and which fits the s2idle [deep] you read; #243 is merged; and Somnius's #640 and #642 are where the first 8 Pro suspends are.

I'd like to hold this plan to the rule we keep for the Pixel 9a's sleep tests, since zuma and zumapro are close and the 9a's history is the only warning we have. A few changes before I merge it:

  1. Sleep through systemd, not through a direct freeze. H2 and H4 use echo freeze > /sys/power/state and rtcwake -m freeze. On the 9a both direct rtcwake -m freeze runs never woke, and that path also skips logind and the system-sleep hooks, so it isn't what users run. Please arm the alarm through sysfs and sleep with systemctl suspend instead: echo 0 > /sys/class/rtc/rtc0/wakealarm; echo +30 > /sys/class/rtc/rtc0/wakealarm; systemctl suspend (your 0.1.10 drop-in makes that s2idle). H1's pm_test can go the same way (echo freezer > /sys/power/pm_test, then systemctl suspend), so every stage takes one path. The pass lines then read suspend_stats and the journal's PM: suspend entry/exit lines rather than rc=.
  2. H4 attended for the whole run. "Unattended between presses" is the part the rule doesn't allow for a first series: please write it as attended for all ten cycles, and leave anything unattended for a later plan.
  3. Prove the Wi-Fi unload on its own first. modprobe -r … pcie_gs201 and the reload haven't run on this kernel as far as the plan says, and the pre helper prints the lsmod count but carries on whatever it is. Please make pre stop when the count isn't 0, and add a short step before H1 that unloads, reloads and checks Wi-Fi and dmesg with no sleep, so H1 changes only one thing.
  4. Two recovery details.
    • If a wake leaves UFS dead, the 9a showed a dark phone that ignored Power while SSH still answered, and a restart from the menu did nothing. Please name the way out: echo b > /proc/sysrq-trigger over SSH if it answers, otherwise the buttons, and then check the next boot's ext4 recovery in the journal.
    • Slot B's retries: the plan says two were left on 11-12. With Pixel 8 Pro: systemctl poweroff restarts the phone, so every shutdown spends a slot B retry #578 every shutdown spends one too, and on another 8 Pro a fallback to slot A wiped userdata. Please refill to 3 with fastboot -s <serial> set_active b (the practice in your BATTERY-NOTES) before H1 and before any stage with fewer than two left, and say what slot A holds on your unit and what a fallback there would do.

Small ones: H3's journalctl -M colin@ can be <user>@; §1's "alarm interrupt firing on rtcwake, checked 2026-11-11": which mode was that, since the unit hasn't slept yet? And please give the Results section the kernel's exact commit and where it can be fetched.

Your questions:

  1. Yes, unload Wi-Fi and the PCIe host before each stage until husky has a hook, once the unload step above has passed.
  2. Your test kernel is fine for these stages, since they need the display and the published branch doesn't have the 8 Pro's GPU series yet, as long as the plan records its exact commit and it is public.
  3. On the Omarchy 4.5 update: please hold it for now. With AUTO_WRITE=yes, a linux-omamobile update would put the published kernel on slot B, which doesn't have the series your phone runs, and the zram question (Cap swap on zram at half the RAM before the image moves past Omarchy 4.0.6 #528) is still open. I'll answer on the update question separately.

With those changes in, I'll merge the plan, and H1 can run when you're at the phone.

@Somnius

Somnius commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@derekross, @gitColinX, the kernel and the first suspend runs on an 8 Pro, since the record needs them, and one correction to how they were described on #642.

The kernel is 7.3.0-rc6-omamobile-push1-ga291900124c4, a local build that isn't published. It is omamobile as it was around 2026-11-04, with a stack of my own TEST ONLY commits on top: the AoC sound work, the ST54L/clkout node, the S2MPG15 sub-PMIC, the GNSS node (disabled), the zuma power domains and C2 idle states (both off by default), and a PS_HOLD poweroff test for #578. The poweroff patch adds the PMU's 0x3e9c offset to the zuma regmap and a syscon-poweroff node, so it is about poweroff, not suspend; a rebase of it alone (untested) is at https://github.com/Somnius/linux-omarchy-mobile/tree/husky-poweroff-test-1109. The kernel predates #243 and #244: on that boot /sys/class/rtc was empty and mem_sleep_default was not set.

s2idle was selected once per boot by hand, echo s2idle > /sys/power/mem_sleep (the default was deep, and my phone's device package has no sleep drop-in). I never unloaded Wi-Fi.

The runs, all on 2026-11-10 in one boot (suspend_stats went from 0 to 8 successes, 0 failures):

  • pm_test freezer, then devices, then platform, each started with echo freeze > /sys/power/state: rc=0 each time.
  • Three real s2idle sleeps by the same direct echo freeze: 28 s, 10 s and 58 s, each woken by the power key (IRQ 100, gpa4), devices back in 69 to 76 ms, rc=0. The 58 s one was a direct freeze, not systemctl suspend as it reads on omamobile-sleepd: notice a resume when logind says so, not at the next poll #642.
  • Two sleeps through systemctl suspend, so logind and PrepareForSleep were involved: 756 s and 619 s, both woken by the power key.

Not tried: an RTC wake (there was no RTC device) and deep. A tap on the dark screen did not wake it in the 10 s run, which fits the touch having no wakeup source.

What the five kernel logs I saved (the devices and platform runs and the three direct sleeps) show at each resume: brcmfmac does a "hot resume" and prints brcmf_msgbuf_process_flow_ring_create_response: Flowring creation failed, code 65535 a few times, and UFS prints one dme-set: attr-id 0x4021 val 0x1 failed 0 retries line; spm_lvl was 5 and rpm_lvl 3 before the runs. In the 58 s run, the only one where I kept the user-space journal, wpa_supplicant lost the link at the suspend and started joining again after the wake, and one join failed with firmware error -14. I didn't keep that for the others, and I didn't check the Wi-Fi after every run. The grep you asked for (link startup failed|Host init failed|I/O error) finds nothing in any of those saved logs. For the two systemctl suspend runs I only kept the timing lines, so I can't say that for them. The saved logs are tails of journalctl -k.

I didn't record the NFC state during these runs.

Nothing on that phone sleeps by itself (the omamobile-sleep toggle is off), and I never used deep. You asked on #642 for these in a husky notes PR; I'll write it once this plan has merged, so it doesn't collide with the ROADMAP Suspend row it edits, unless you'd rather have it now.

@Somnius

Somnius commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@derekross, @gitColinX, one more result for the recovery details, from an 8 Pro on omamobile-device-husky 0.1.9, so without the sleep drop-in from #656 (the kernel was 7.3.0-rc6-omamobile-push1-ga291900124c4, which predates #244).

The last lines of that boot's journal, on 2026-11-12 after about 22 hours of uptime:

05:44:56 systemd-logind[753]: suspend requested from client PID 1648 ('upowerd') (unit upower.service)...
05:44:57 systemd-sleep[1614594]: Performing sleep operation 'suspend'...
05:44:57 kernel: PM: suspend entry (deep)

Nothing came after that. I don't know why upowerd asked: its policy on this phone acts at 2 %, but I don't have the battery level for that moment. It is the kind of case you described on #244 as a battery-critical suspend that went to deep and needed a restart.

The phone showed nothing at all afterwards, no charging animation, no heat, and Power + Volume Down did nothing. What got it out was a forced restart: Power + Volume Up for 30 s (the combination tools/husky-deadman gives for this phone), then Power + Volume Down for the bootloader. Its battery read 91 % after that, so it was not flat.

Two details for the runbook. In the bootloader slot B's retry count was 0 and the current slot had already switched to A (I posted the readings on #252), so read the count before the first boot after a recovery like this. And I have put #656's MemorySleepMode=s2idle into /etc/systemd/sleep.conf.d/ on that phone by hand, plus a tmpfiles line that writes s2idle to /sys/power/mem_sleep at boot, applied and read back as [s2idle] deep: the kernel still boots with deep selected, and this phone has to run on that kernel for now.

gitColinX added a commit to gitColinX/omarchy-mobile that referenced this pull request Nov 13, 2026
- Every stage sleeps through systemctl suspend, with the RTC armed
  through /sys/class/rtc/rtc0/wakealarm; H1's pm_test too. Pass lines
  read suspend_stats and the journal's PM: suspend entry/exit.
- H4 is attended for all ten cycles; nothing in the plan is unattended.
- New H0b: unload and reload Wi-Fi and its PCIe host with no sleep. The
  pre helper stops unless the modules are gone.
- Recovery: sysrq b over SSH for a dark phone that still answers, the
  buttons otherwise, then the next boot's ext4 recovery; refill slot B
  to 3 before H0b and below two retries; what slot A holds and what a
  fallback there does.
- The RTC check was rtcwake -m on (awake); <user>@ in H3.
- H0b to H4 run on the published omamobile at 82f31d3a7.
- Results: Lef's runs and kernel as he reported them on derekross#724, and this
  unit's unplanned critical-battery suspend of 2026-11-13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gitColinX

gitColinX commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

@derekross, thank you for the careful review. All of it is in the new commit:

  1. Through systemd. Every stage now sleeps with systemctl suspend, the RTC armed through /sys/class/rtc/rtc0/wakealarm first. H1's pm_test levels go the same way. The pass lines read suspend_stats and the journal's PM: suspend entry/exit, not rc=.
  2. H4 attended for all ten cycles, each started only after the previous one reads clean. Anything unattended is left to a later plan.
  3. H0b, before H1: unload and reload Wi-Fi and its PCIe host with no sleep, then check the link and dmesg. pre now stops unless UFS is at 5, NFC is absent and the modules are gone.
  4. Recovery: echo b > /proc/sysrq-trigger over SSH for a dark phone that still answers, the buttons otherwise, then the next boot's ext4 recovery in the journal. Slot B refilled to 3 before H0b and before any stage with fewer than two left. Slot A holds stock (CP3A.261005.005); a fallback there can't read userdata and offers a factory reset, which must be declined.

The small ones: H3 uses <user>@. The RTC check of 11-11 was rtcwake -m on -s 12, awake, so the plan says no sleep was involved.

Kernel: Brett's #157 and #158 merged, so H0b to H4 now run on the published omamobile at 82f31d3a7 (7.3.0-rc6-omamobile-push1-g82f31d3a7a35), unchanged. I flashed it today: GPU at 150-890 MHz through panthor, the three cpufreq policies on schedutil, [s2idle] deep, spm_lvl 5, no NFC, Wi-Fi, Bluetooth and haptics all up, 0 failed units. Slot B was down to 1 retry before that flash.

Results now has @Somnius's runs and kernel as he reported them here, with his correction to #642. It also has one unplanned event on my unit: off the charger overnight, at 04:25 UPower's critical-battery action suspended the phone (PM: suspend entry (s2idle), no exit line). It was next seen at 4 % when plugged in, 8.5 h later. That doesn't tell whether it slept until empty or hung, but it does show that UPower's action reaches s2idle on husky with suspend-off set. I've listed "should UPower suspend at all on husky before H4" under what the plan leaves for later.

@derekross

Copy link
Copy Markdown
Owner

Thank you, Colin, and thank you for answering everything in one push. I went through it point by point: every stage now sleeps through systemctl suspend with the alarm armed in sysfs, H1 included; H4 is attended throughout; H0b proves the unload and reload on their own and pre stops when anything is off; the recovery has the sysrq path, the ext4 check and the retry refill with -s; and moving H0b to H4 onto the published omamobile at 82f31d3a7 settles the kernel question better than my answer did. The record of Somnius's runs and of your unit's critical-battery suspend is clear about what it can and can't tell.

One thing before I merge:

  1. H4 needs pre before every cycle. It runs pre once and then after between cycles, and after ends with modprobe pcie_gs201 && modprobe brcmfmac, so cycles 2 to 10 would sleep with Wi-Fi and the PCIe host loaded, against your own rule in section 2, and with the zuma D3 handshake that H1 to H3 never tested. Running tools/phone-ssh "$pre" before each sleep_cmd h4-<n> 20 fixes it.

Smaller ones, none blocking:

  • Somnius's 21:17Z report crossed your push by four minutes: an 8 Pro on device-husky 0.1.9 whose UPower suspend went to deep and needed Power + Volume Up for 30 s, with slot B at 0 retries afterwards. It would sit well in section 4 next to his 11-10 runs.
  • The ROADMAP Suspend row still says "never run on husky" and "unassigned", while your section 4 records eight successes on Lef's phone and the plan has an owner.
  • UFS-PLAN U6 now says both that system suspend "has run on neither Tensor G3 nor G4" and that Lef's runs took UFS through it at spm_lvl 5; the first sentence can go.

One merge note: #741 changes the ROADMAP row right below your Suspend row, so whichever of the two lands second gets a conflict there. Keeping both rows as each pull request has them is the whole resolution; if #741 goes in first, a rebase with that is all it needs.

On UPower: both 8 Pros have now had a critical-battery suspend that didn't come back. I'll think about whether husky should power off at a critical battery, as the 7 Pro does since device-cheetah 0.1.55, before H4 rather than after; that doesn't hold this plan up.

With H4 fixed, I'll merge it, and H0b can run when you're at the phone.

gitColinX and others added 3 commits November 14, 2026 23:25
Derek asked on derekross#656 for a short runbook in device/husky before an
attended suspend test on an 8 Pro: Wi-Fi across sleep, UFS spm_lvl 5,
NFC not polling. SUSPEND-PLAN.md has husky's read-only state for each
(no sleep hook, so every stage unloads Wi-Fi and the PCIe host;
spm_lvl 5 at boot; no NFC driver bound), the rest of what cheetah and
raven needed (s2idle only, no cpuidle on husky), recovery, and four
stages: pm_test dry runs, one RTC-woken s2idle, systemctl suspend woken
by Power, ten cycles. Nothing in it has run on this unit yet. The
ROADMAP Suspend row and UFS-PLAN U6 point to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every stage sleeps through systemctl suspend, with the RTC armed
  through /sys/class/rtc/rtc0/wakealarm; H1's pm_test too. Pass lines
  read suspend_stats and the journal's PM: suspend entry/exit.
- H4 is attended for all ten cycles; nothing in the plan is unattended.
- New H0b: unload and reload Wi-Fi and its PCIe host with no sleep. The
  pre helper stops unless the modules are gone.
- Recovery: sysrq b over SSH for a dark phone that still answers, the
  buttons otherwise, then the next boot's ext4 recovery; refill slot B
  to 3 before H0b and below two retries; what slot A holds and what a
  fallback there does.
- The RTC check was rtcwake -m on (awake); <user>@ in H3.
- H0b to H4 run on the published omamobile at 82f31d3a7.
- Results: Lef's runs and kernel as he reported them on derekross#724, and this
  unit's unplanned critical-battery suspend of 2026-11-13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the second review on derekross#724:

- H4 runs pre before each of its ten cycles: after reloads Wi-Fi and the
  PCIe host, so cycles 2 to 10 would otherwise sleep with them loaded.
- Section 4 has Lef's 2026-11-12 critical-battery suspend into deep on
  device-husky 0.1.9 (91 % afterwards, slot B at 0 and the slot on A).
- The ROADMAP Suspend row says testing, with Lef's runs and the two
  suspends that didn't come back, and names an owner.
- UFS-PLAN U6 no longer says system suspend has run on neither Tensor G3
  nor G4, next to the line that says Lef's runs took UFS through it.
- SUSPEND-PLAN.md loses an executable bit it had picked up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gitColinX

gitColinX commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@derekross, thank you. All of it is in the new commit at the top of the branch, now on today's main:

  1. H4 runs pre before every cycle, each round being pre, sleep_cmd h4-<n> 20, then after, with a line saying why: after reloads Wi-Fi and the PCIe host.
  2. Section 4 has @Somnius's 11-12 report next to his 11-10 runs: the critical-battery suspend into deep on device-husky 0.1.9, 91 % afterwards, and slot B at 0 with the slot switched to A. It also has his advice to read the retry count before the first boot after a recovery like that.
  3. The ROADMAP Suspend row now says testing, with Lef's eight successes and the two suspends that didn't come back, and names me as the owner of the runbook, with Lef's first runs credited.
  4. UFS-PLAN U6 loses the "has run on neither Tensor G3 nor G4" sentence.

The rebase over #741 conflicted only on the ROADMAP row below Suspend, and I kept both rows as you said. I also dropped an executable bit the plan had picked up on its way from Windows.

On UPower at a critical battery: my unit has run flat twice more since, unplugged overnight (about 97 % to 4 % by morning, still with no sleep). So I'd welcome husky powering off at 3 % as the 7 Pro does, once power off itself is fixed (#578). I'm happy to do that device-package change when you decide.

@derekross

Copy link
Copy Markdown
Owner

Thank you, Colin. That's everything: H4 now runs pre before each of its ten cycles, Somnius's 11-12 report sits in section 4 with the advice to read the retry count after a recovery like that, the ROADMAP row has an owner and the real state, and U6 no longer contradicts itself. I also checked it against the 8 Pro's sleep drop-in change in #806 (SuspendState=freeze): H1's pm_test levels are exactly the three the kernel honours for suspend-to-idle, so the plan reads the same either way.

One small thing for later, not for this PR: the ROADMAP row says "testing" while the matrix in DEVICES.md still says "no" for the 8 Pro's suspend, and Lef's eight runs were on a local kernel. A "(on a local kernel)" in the row would make that clear; the matrix can move once H0b to H4 have run on the published one.

On UPower at a critical battery: thank you for the offer. I'll come back to it once power-off works (#578).

I'm merging this now. H0b can run whenever you're at the phone.

@derekross
derekross merged commit 6219415 into derekross:main Nov 15, 2026
2 checks passed
gitColinX added a commit to gitColinX/omarchy-mobile that referenced this pull request Nov 16, 2026
From the review on derekross#802: the NOTES entry says the 11-13 critical-battery
suspend didn't come back, and names /sys/power/mem_sleep for
"[s2idle] deep", since older notes quote "s2idle [deep]". From the
review on derekross#724: the ROADMAP Suspend row says Lef's runs were on a local
kernel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants