From 115fd8f396c168e7646e87ad02d8d4fb89fb1a4c Mon Sep 17 00:00:00 2001 From: Lef Date: Sun, 15 Nov 2026 15:03:18 +0200 Subject: [PATCH] omamobile-device-husky 0.1.14: one sleep state, so a refused sleep isn't tried twice (#619) The Pixel 8 Pro's part of #619, as #654 did for the Pixel 9a: SuspendState=freeze in the sleep.conf drop-in. systemd's default is "mem standby freeze", written to /sys/power/state in turn until one is accepted. With mem_sleep at s2idle the second write is the same sleep again, so a sleep a driver refuses is tried twice. "freeze" and not "mem", because it stays suspend-to-idle whatever mem_sleep says. It applies to the 8 Pro: on my phone (omamobile-device-husky 0.1.9, 7.3.0-rc6-omamobile-push1-g596d44e5bd5e, mem_sleep_default=s2idle on the command line) /sys/power/mem_sleep reads "[s2idle] deep" and systemd-analyze cat-config systemd/sleep.conf shows MemorySleepMode=s2idle and no SuspendState line. A refused sleep has not been seen on the 8 Pro, and on the 9a one state alone did not save Wi-Fi, so this only removes the second try. test/all compared the settings with the Pixel 7 Pro's copy, which doesn't have the line yet. It now checks the file's own five settings, the way #654 changed the 9a's test. README row updated. Version 0.1.14, one above main's 0.1.13. Tested on the desktop only: packages/omamobile-device-husky/test/all, tests/packages for the husky, akita, tegu and cheetah device packages, and tools/pr-check origin/main pass. Not run yet: the test #619 asks for, one systemctl suspend on the phone with suspend_stats success up by one, fail unchanged and cat-config showing the line. --- packages/omamobile-device-husky/README.md | 2 +- packages/omamobile-device-husky/test/all | 15 ++++++++++----- .../vendor/systemd/sleep.conf.d/10-omamobile.conf | 9 +++++++++ packages/omamobile-device-husky/version | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/omamobile-device-husky/README.md b/packages/omamobile-device-husky/README.md index 0f8c81840..3ae031103 100644 --- a/packages/omamobile-device-husky/README.md +++ b/packages/omamobile-device-husky/README.md @@ -8,7 +8,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 8 Pro (codename hu | `vendor/systemd/network/20-usb-gadget.network` | `/usr/lib/systemd/network` | Sets usb0 to 172.16.42.1/24 after handover. A replug needs the USB rescue below: without it the link stays dead until a reboot | | `vendor/systemd/logind.conf.d/10-omamobile-power-key.conf` | `/usr/lib/systemd/logind.conf.d` | A short power press does not power the phone off. Same drop-in as the Pixel 7 Pro. On husky the forced reset is Power + Volume Up held 15-30 s ([BRINGUP-M1](../../device/husky/BRINGUP-M1.md) test 23) | | `vendor/NetworkManager/conf.d/10-omamobile-usb.conf` | `/usr/lib/NetworkManager/conf.d` | Keeps NetworkManager off that link | -| `vendor/systemd/sleep.conf.d/10-omamobile.conf` | `/usr/lib/systemd/sleep.conf.d` | Suspend means suspend-to-idle. The kernel's default on the 8 Pro is `deep` (`/sys/power/mem_sleep` reads `s2idle [deep]`), which Linux can't wake from on zuma yet. No hibernation: there is no swap. The settings are the Pixel 7 Pro's; the test checks. Suspend itself is still untested on the 8 Pro ([ROADMAP](../../device/husky/ROADMAP.md), [UFS-PLAN](../../device/husky/UFS-PLAN.md) U5 and U6), so this only keeps a tap on Suspend from choosing `deep` | +| `vendor/systemd/sleep.conf.d/10-omamobile.conf` | `/usr/lib/systemd/sleep.conf.d` | Suspend means suspend-to-idle. The kernel's default on the 8 Pro is `deep` (`/sys/power/mem_sleep` reads `s2idle [deep]`), which Linux can't wake from on zuma yet. It is written to the kernel as one state (`SuspendState=freeze`), so a sleep a driver refused isn't tried a second time (#619). No hibernation: there is no swap. The test checks the five settings. Suspend itself is still untested on the 8 Pro ([ROADMAP](../../device/husky/ROADMAP.md), [UFS-PLAN](../../device/husky/UFS-PLAN.md) U5 and U6), so this only keeps a tap on Suspend from choosing `deep` | | `bin/omamobile-husky-display-start` + `vendor/systemd/system/omamobile-husky-display.service` + `display-manager.service.d/10-omamobile-husky.conf` | `/usr/bin`, `/usr/lib/systemd/system` | Loads gs-decon (kernel display PR) before the display manager, hang-safe: a synced marker that a start which never returns leaves behind keeps it off on the next boot, until `--retry`. First it allows the panel's DSI commands (`gs_dsim_cmd.allow_tx=1`, for brightness and 120 Hz), but only when the bootloader names the `google-hk3` panel on the command line, as the Pixel 9a's graphics start does for its panel. Then it sends the brightness systemd restored at boot again, which the panel could only take once `allow_tx` is on. On a kernel without the display PR (derekross/linux-omarchy-mobile#160) the DTB has no DECON0, so the unit is skipped by its condition and the screen stays on simple-framebuffer. With another panel name, `allow_tx` stays off and gs-decon runs read-only at 60 Hz | | `vendor/modprobe.d/omamobile-husky-display.conf` | `/usr/lib/modprobe.d` | Blacklists gs_decon's autoload, so the display start loads it after `allow_tx`: gs-decon decides on 120 Hz at probe. Sets `screen_off=2`, as cheetah and tegu do: on DPMS off DECON stops its frames and the panel goes to sleep, and DPMS on wakes it | | `vendor/modprobe.d/omamobile-husky-clk-acpm.conf` | `/usr/lib/modprobe.d` | Lets the GPU's ACPM clock move up to 890 MHz, stock's top (`zuma_gpu_max_khz`, kernel #157). The GPU thermal zone throttles it from 85 C. Without it the GPU stays at the bootloader's 150 MHz | diff --git a/packages/omamobile-device-husky/test/all b/packages/omamobile-device-husky/test/all index 6266fb212..859497ef5 100755 --- a/packages/omamobile-device-husky/test/all +++ b/packages/omamobile-device-husky/test/all @@ -40,12 +40,17 @@ if [[ -f ../omamobile-device-cheetah/src/reboot-to.c ]]; then ../omamobile-device-cheetah/omamobile-device-cheetah.install \ || fail "the pacman install script drifted from the cheetah package" pass "the pacman install script matches the cheetah package" - # Its comment names zuma, cheetah's gs201: the settings are what must match - sleep=vendor/systemd/sleep.conf.d/10-omamobile.conf - [[ $(grep -v '^#' "$sleep") == "$(grep -v '^#' "../omamobile-device-cheetah/$sleep")" ]] \ - || fail "the sleep drop-in's settings drifted from the cheetah package" - pass "the sleep drop-in's settings match the cheetah package" fi +# The sleep drop-in: suspend-to-idle only, one state so a refused sleep isn't +# tried a second time (#619), and nothing that hibernates. Checked by its +# settings, as the 9a's package does: the 7 Pro's copy gets SuspendState in a +# change of its own. +sleepconf=vendor/systemd/sleep.conf.d/10-omamobile.conf +[[ $(grep -v '^#' "$sleepconf" | grep -c .) -eq 6 && $(grep -v '^#' "$sleepconf" | head -1) == "[Sleep]" ]] || fail "the sleep drop-in has other lines than its five settings" +for line in SuspendState=freeze MemorySleepMode=s2idle AllowHibernation=no AllowHybridSleep=no AllowSuspendThenHibernate=no; do + grep -qx "$line" "$sleepconf" || fail "the sleep drop-in lacks $line" +done +pass "the sleep drop-in: one sleep state (freeze), s2idle, no hibernation" grep -q 'omamobile-keyring' PKGBUILD || fail "pacman needs omamobile-keyring" grep -q '^install=omamobile-device-husky.install$' PKGBUILD \ || fail "the pacman install script is not named" diff --git a/packages/omamobile-device-husky/vendor/systemd/sleep.conf.d/10-omamobile.conf b/packages/omamobile-device-husky/vendor/systemd/sleep.conf.d/10-omamobile.conf index 0674e3091..b0816a00e 100644 --- a/packages/omamobile-device-husky/vendor/systemd/sleep.conf.d/10-omamobile.conf +++ b/packages/omamobile-device-husky/vendor/systemd/sleep.conf.d/10-omamobile.conf @@ -5,7 +5,16 @@ # zuma SoC sleep sequence yet, so entering it would not wake, as on the # Pixel 7 Pro (device/cheetah/SUSPEND-PLAN.md, sections 1 and 5). Suspend # means suspend-to-idle until one exists. There is no swap to hibernate to. +# +# SuspendState: systemd's default is "mem standby freeze", written to +# /sys/power/state one after the other until a write succeeds. With +# mem_sleep at s2idle a second write is the same sleep again, so a sleep a +# driver refuses is tried twice, about half a second apart. On the Pixel 9a +# the second try's failure (brcmfmac, -5) cost Wi-Fi (#619); a refused sleep +# has not been seen on the 8 Pro. One state, one try. "freeze" rather than +# "mem": it is suspend-to-idle whatever mem_sleep says. [Sleep] +SuspendState=freeze MemorySleepMode=s2idle AllowHibernation=no AllowHybridSleep=no diff --git a/packages/omamobile-device-husky/version b/packages/omamobile-device-husky/version index 7ac4e5e38..71d6a66ed 100644 --- a/packages/omamobile-device-husky/version +++ b/packages/omamobile-device-husky/version @@ -1 +1 @@ -0.1.13 +0.1.14