- Enable CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y and lower 200 MHz CPU OPP opp-peak-kBps to 0x25800 (19.2 MHz BIMC XO floor) across all six MSM8905/MSM8909 DTS files so rpmpd_sync_state and icc_sync_state complete despite driverless /cpus nodes. - Add patches/kernel/0009-msm8909-deep-standby-rpm-usb-wifi-ddr.patch: late_initcall_sync(rpm_smd_clk_late_cleanup) to drop active votes on unclaimed QDSS/QPIC clocks and clear RPM SLEEP_STATE boot handoff votes, ChipIdea ci_hdrc_msm/core unplugged USB HS PHY shutdown + 200 ms autosuspend, and wcn36xx BET + multicast filter + HOST_SUSPEND_IND/HOST_RESUME_REQ in screen_off_offload. - Build and export drivers/gpu/drm/drm_mipi_dbi.ko.zst alongside panel-mipi-dbi.ko.zst in build-kernel-audio.sh, rebuild-image.sh, apply-bananarchy-overlay.sh, and check-rebuild.sh. - Rebuild and verify a1114 (carbonara) images/archives for nokia-argon and nokia-beatles and update BATTERY-OPTIMIZATION-ANALYSIS.md, CHANGELOG.md, and pinned hashes in check-rebuild.sh.
99 KiB
Bananarchy battery-usage optimization analysis (measurement-corrected)
Status: analysis plus implemented changes (sections 15-21).
Project: /home/lux/proj/bananarchy, current release a1111 / lennon.
Device: Nokia 8110 4G (nokia-argon, MSM8905), connected over USB RNDIS at 172.16.42.1,
Linux nokia-argon 6.12.1-msm8916 #6 SMP PREEMPT Sat May 30 08:38:37 UTC 2026 armv7l,
Bananarchy Linux a1108 (codename dejavu, msm8909). Historical sections
below retain the build labels from their original measurement sessions; the
current shipped build is a1111 / lennon.
Measurement session: 2026-11-07 16:07–16:12 EET, uptime ~43 h at first snapshot.
Read-only SSH commands plus two 60-second delta windows. Temporary /tmp/bantam-* files on
the phone were removed; NO_RESIDUE confirmed.
This document supersedes the earlier static analysis. Section 3 lists every correction that the live device forced. Sections 4–7 are the corrected optimization lists.
1. Measurement limitations (important)
- The phone was charging from USB during the whole session.
pm8916-lbc-chgr/online=1,constant_charge_current=540000,pm8916-bms-vm/status=Charging. No discharge-current measurement is possible while SSH runs over the charging USB link. - The BMS driver exposes no
current_now(onlycapacity,voltage_now,status,health,charge_full_design). So even on battery there is no direct mA readout from sysfs.capacitymoved 56 → 54 → 54 andvoltage_nowrose 3,998,440 → 4,000,051 µV during the session, i.e. the BMS EMA is noisy and the device is on external power. iwandpowertopare not installed (confirmed). Wi-Fi power save was verified indirectly through/proc/interrupts,/proc/net/devand the deployed NM config./proc/timer_list,/sys/kernel/debug/pm_genpd/pm_genpd_summaryand/sys/kernel/debug/wakeup_sourcesare unavailable, so no per-timer/genpd attribution.- Consequence: every mA figure below is an architectural estimate, not a measurement.
The 24 h budget is derived from the DT:
charge-full-design-microamp-hours = 1500000(1500 mAh) → ≤ 62.5 mA average to reach 24 h.
2. Measured state
2.1 Suspend / PM core — the headline finding
| Item | Measured value |
|---|---|
/proc/config.gz |
# CONFIG_SUSPEND is not set, # CONFIG_HIBERNATION is not set; no CONFIG_PM_SLEEP, CONFIG_PM_WAKELOCKS, CONFIG_PM_AUTOSLEEP |
/sys/power/state |
0 bytes (empty) — no sleep states exist |
/sys/power/wake_lock, wake_unlock, autosleep |
absent → sxmo_wakelock.sh isenabled is false, all wakelock calls are no-ops |
| Prerequisites already present | CONFIG_ARCH_SUSPEND_POSSIBLE=y, CONFIG_ARM_CPU_SUSPEND=y, CONFIG_CPU_PM=y, CONFIG_FREEZER=y, CONFIG_QCOM_SPM=y, CONFIG_ARM_QCOM_SPM_CPUIDLE=y, wakeup-source on gpio-keys in the DTS |
| Userspace enforcement | sxmo_autosuspend.sh/sxmo_suspend.sh = exit 0; elogind/sleep.conf AllowSuspend=no; sxmo.nosuspend + sxmo.noidle present; infinite sxmo_not_suspendable wakelock in sxmo_hook_start.sh/sxmo_state.sh |
2.2 CPU, cpufreq, cpuidle
| Item | Measured value |
|---|---|
| CPUs | online/possible/present = 0-1, nproc=2 (MSM8905 is dual-core — expected, not a bug); CONFIG_NR_CPUS=8 |
| cpufreq driver | cpufreq-dt, governor schedutil, min 199999 kHz, max 1094400 kHz |
cpuinfo_transition_latency |
4294967295 (UINT_MAX / CPUFREQ_ETERNAL) — root cause of the 6.44 s schedutil default |
schedutil/rate_limit_us |
40000 — the fix IS in effect at runtime (commit 7b6c6b2 resolved the earlier "not in effect" issue) |
time_in_state over ~43 h |
199999 kHz: 15,393,362; 399999: 39,736; 533333: 21,461; 799999: 5,349; 998400: 2,801; 1094400: 24,790 → ~99 % of uptime at the 200 MHz floor |
| cpuidle | state0 WFI, state1 cpu-sleep-0 (SPC, latency 420 µs, residency 1260 µs); time ≈ 151,642 s per core ≈ 98 % of uptime in SPC |
| 60 s window | CPU idle 98.15 %; SPC entries +1,776 (≈29.6/s across 2 cores); arch_mem_timer 18.8/s, arch_timer 17.7/s, IPI3 16.8/s, IPI1 2.3/s, IPI2 3.0/s, IPI5 4.8/s → ~50 wakeups/s system-wide |
Interpretation (corrected): the CPU cores are not stuck at high frequency and are not busy-looping — they are power-collapsed ~98 % of the time. The remaining drain is from SoC rails, DDR (no self-refresh), the always-on display, the LTE+GSM modem and the Wi-Fi chip, all of which stay powered because there is no system-wide suspend. This re-frames the problem away from "too many userspace busy loops" toward "no deep sleep state".
2.3 Kernel config (from /proc/config.gz, running kernel)
Confirmed general-purpose/low-latency/debug choices:
CONFIG_HZ=300,CONFIG_PREEMPT=y,CONFIG_SCHED_HRTICK=y,CONFIG_CPU_FREQ_STAT=y,CONFIG_IRQ_TIME_ACCOUNTING=y,CONFIG_CPU_IDLE_GOV_MENU=y,CONFIG_CPU_IDLE_GOV_TEOoff,CONFIG_NO_HZ_IDLE=y,CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y.- Debug/tracing:
CONFIG_FTRACE=y,CONFIG_FUNCTION_TRACER=y,CONFIG_DYNAMIC_DEBUG=y,CONFIG_PERF_EVENTS=y,CONFIG_PROFILING=y,CONFIG_KPROBES=y,CONFIG_UPROBES=y,CONFIG_BPF_JIT_ALWAYS_ON=y,CONFIG_FW_LOADER_DEBUG=y,CONFIG_THERMAL_EMULATION=y,CONFIG_MAGIC_SYSRQ=y,CONFIG_PRINTK_TIME=y,CONFIG_DRM_MSM_GPU_STATE=y,CONFIG_DRM_FBDEV_OVERALLOC=100,CONFIG_FRAMEBUFFER_CONSOLE=y,CONFIG_LOGO=y,CONFIG_SERIAL_MSM_CONSOLE=y. - Unused built-ins:
CONFIG_INPUT_MOUSE/JOYSTICK/TOUCHSCREEN=y,CONFIG_MAC80211_LEDS=y,CONFIG_INPUT_LEDS=y,CONFIG_LEDS_QCOM_LPG=y,CONFIG_NETFILTER=y,CONFIG_IPV6=m,CONFIG_CGROUPS=y,CONFIG_MEMCG=y,CONFIG_ZRAM_DEF_COMP_ZSTD=y. - Absent:
CONFIG_RCU_LAZY,CONFIG_ENERGY_MODEL,CONFIG_SCHED_ENERGY,CONFIG_SUSPEND*. /proc/cmdline:quiet splash plymouth.ignore-serial-consoles plymouth.prefer-fbcon earlycon console=ttyMSM0,115200 ...
Runtime sysctls from 10-power-save.start are all applied: vm.stat_interval=30,
dirty_writeback_centisecs=6000, dirty_expire_centisecs=6000, printk="1 4 1 1",
workqueue.power_efficient=Y, printk.console_suspend=Y, fbcon/cursor_blink=0.
2.4 Display
brightness=10/14, bl_power=0, card0-SPI-1/dpms=On, xset q: DPMS Enabled, Monitor is On,
Standby/Suspend/Off = 0, screensaver timeout 0. sxmo_state.sh get = unlock,
/tmp/bananarchy_screen_locked absent, sxmo.noidle/sxmo.nosuspend present,
idle_locker not in sxmo_jobs.sh list (only daemon_manager, network_monitor_device,
statusbar_periodics). So the unlocked screen never blanks, and the DPMS-off path (deployed in
sxmo_wm.sh + bananarchy-display-power-sync) is never taken in normal use.
2.5 Wi-Fi
wlan0connected toOffOurStreets_, driverwcn36xx,GENERAL.IP6-CONNECTIVITY: full, IPv6 link-localfe80::...present,disable_ipv6=0,accept_ra=0,use_tempaddr=2.- NM:
wifi.powersave=3(10-power.conf),connectivity.enabled=false(twice),wifi.scan-rand-mac-address=no(00-sxmo.conf). Nowifi.scan-intervaloverride → NM default. wcn36xxmodule parameters: onlydebug_mask=0— no runtime knob for keep-alive/listen interval.- 60 s window: wlan0 RX 24,130 bytes / 111 packets (1.85 pkt/s), TX 0 packets;
wcn36xx_rxIRQ 1.78/s,wcn36xx_tx0.10/s,78b9000.spi0.17/s,mmc00.75/s,rpm1.25/s,gpu-irq0.12/s. Beacon filtering is working (≈1.8 RX/s, not 10/s). Ip6InReceives36,977 over 43 h (~0.24/s) → IPv6 multicast is active on wlan0.- One
wpa_supplicant -u -Dnl80211,wext -iwlan0undersupervise-daemon, stable for 1d19. No ctrl socket (wpa_clifails); D-Bus only, used by NetworkManager.
2.6 Bluetooth
rfkill: hci0 Bluetooth Soft blocked: yes. bluetoothd not running; bluetooth service
not in any runlevel (rc-update show -v shows it with empty runlevel columns). So
AutoEnable=true, DiscoverableTimeout=0, PairableTimeout=0, ControllerMode=dual in
main.conf are inert — BT is off and is not a current drain. Latent risk only if the user
explicitly enables BT via xnetworks/sxmo_bluetoothtoggle.sh.
2.7 Modem / DSDS
/tmp/sxmo_dsds_active=1,DUAL_SIM_ACTIVE=1, both SIMs present/ready.PRIMARY_GW_SLOT=2(NAS_RAT=lte,NAS_PS_STATE=attached),SECONDARY_GW_SLOT=1(SLOT1_RAT=gsm),NAS_REG_STATE=registered.mmcli:access-technologies: ["lte"],bearers: [],packet-service-state: attached,current-modes: allowed 2g,3g,4g; preferred 4g, EPS initial bearer with empty APN.drx-cycle: "--"/mico-mode: "--"are 5G NR registration settings undermodem.3gpp.5gnr.registration-settings; they are not applicable to this LTE-only modem and are not evidence of a missing DRX configuration (see correction C17).qrtr0:gsm:disconnected, no GSM connection profiles, normnet_data*interface;wwan0(rpmsg_wwan_ctrl),/dev/wwan0at0,/dev/wwan0at1present.msm8909-modem-wwan-portstill runsqmicli --dpm-open-port=...unconditionally at boot (line 31 confirmed deployed) even though no cellular data call exists.dsds-daemon(python3) running:poll_timeout=Nonewhen locked,600.0when unlocked;poll_stored_smsevery 600 s;time.sleep(2)on exception.sxmo_modemmonitor.shsupervises withsleep 10/sleep 120.ModemManager --test-quick-suspend-resume --log-level=ERR --log-file=/dev/null,q6voiced,rmtfs,qmi-proxy,polkitd,dbus-monitorall running.
2.8 Services / processes
Default runlevel: cgroups chronyd dbus elogind kill-plymouth local modemmanager msm-modem-uim-selection msm8909-modem-wwan-port networkmanager postmarketos-zram-swap q6voiced rfkill rmtfs sshd tinydm udev-postmount wpa_supplicant (no bluetooth, no zram-init).
chronydrunning (2 procs) withpool pool.ntp.org iburst,cmdport 0,rtcsync,makestep 1 -1.cmdport 0closes the UDP command port but leaves chronyd's root-only Unix socket (/run/chrony/chronyd.sock) available for privilegedchronyccommands (verified in section 16); after 43 h uptime it is almost certainly atmaxpoll≈ 1024 s, not the initial 64 s.superdstarted without-l /dev/null→ the shipped user hook (~/.config/sxmo/hooks/sxmo_hook_start.sh) wins over the default hook and the zero-log default is not fully applied (Xorg does use-logfile /dev/null -logverbose 0).- Started superd services:
dunst,fcitx5,pipewire,pipewire-pulse,wireplumber,sxmo_modemmonitor,sxmo_networkmonitor,sxmo_notificationmonitor,sxmo_soundmonitor. sxmo_soundmonitor.shhas 4 shell processes plusevtest /dev/input/event5andpactl subscribe— the jack evdev exists, so thesleep 5fallback loop is not running.sxmo_run_aligned.sh 60 sxmo_hook_statusbar.sh periodics+sxmo_aligned_sleep 60running; the periodics guard passes (unlocked, brightness 10) → fullmmcli -m any -J,nmcli -t con show --active,nmcli ... device wifi list --rescan no,rfkill list wifi,xsetroot -nameevery 60 s.nmcli device monitor,inotifywait,dbus-monitor— event-driven, as designed.- 26
dwm-plugin --preloadresidents;dwm;dunst;fcitx5 -D --disable=wayland --verbose=*=0;dnsmasq(NM, IPv6 listener),unudhcpd,getty tty1.
2.9 Runtime PM / devfreq / zram
78b9000.spi:auto, suspended, delay 50.7824900.sdhci/7864900.sdhci:auto, suspended, delay 50.1c00000.gpu:auto, suspended, delay 66.78af000.serial:auto,status=unsupported→ UART stays on.- GPU devfreq:
governor=simple_ondemand,cur_freq=409600000(max),target_freq=409600000,polling_interval=50. Because the device is runtime-suspended, the 50 ms poll is stopped at idle; the issue is that it resumes at the 409.6 MHz max OPP. - Only
/dev/zram0exists (swap, 595,964 KB, 2,560 KB used),comp_algorithm=[zstd],mm_statorig 2,404,352 / compr 412,692 / mem_used 2,002,944 → very little swap activity. zram-initis NOT enabled;/etc/conf.d/zram-init(type1=/tmp,size1=2048,opts1=strictatime,algo1=zstd) is dead config./tmpis not a separate mount — it lives on the rootfs/eMMC.mountshows tmpfs only on/dev,/run,/dev/shm,/run/user/10000./etc/modules:af_packet ipv6 panel_mipi_dbi msm leds_msm8905_torch msm8905-cam rpmsg_wwan_ctrl.
2.10 Battery udev path
85-bananarchy-battery.rules has no KERNEL filter; sxmo_hook_battery.sh udev re-execs via
su and forks (sleep 2; "$0" udev recheck). Measured BMS IRQ rate: 2 IRQs / 60 s
(1 per ~30 s) → 2 power_supply change events per minute (KERNEL+UDEV pairs). Battery cache
charging:54 is present and working.
2.11 Deployed files vs repo
10-power-save.start, bananarchy-display-power-sync, sxmo_wm.sh,
sxmo_hook_statusbar.sh, sxmo_hook_battery.sh, msm-modem-uim-selection,
sxmo_modemmonitor.sh, xorg.conf.d/10-bananarchy-msm8909.conf all match the repo copies.
The deployed image at the time was a1105; the power-relevant code is identical to HEAD 2ea2db4. The current build is a1111 / lennon.
3. Corrections to the previous analysis
| # | Previous claim | Corrected by the device |
|---|---|---|
| C1 | Duplicate wpa_supplicant service with a missing $ in yesno "{wpa_supplicant_dbus}" causes a no--u instance / respawn storm |
Wrong. Exactly one stable instance with -u. OpenRC's yesno() has a fallback that evals the literal string as a variable name → yes → true, so -u is added. The typo is cosmetic. Remove this item. |
| C2 | bluetoothd AutoEnable=true + DiscoverableTimeout=0 keeps BT in inquiry/page scan |
Wrong for the current state. BT is soft-blocked, bluetoothd not running, service not in any runlevel. Downgrade to a latent/conditional risk only. |
| C3 | sxmo_soundmonitor.sh runs a sleep 5 loop forever |
Wrong. /dev/input/event5 jack evdev exists; evtest blocks and pactl subscribe is event-driven. Remove the 5 s claim. |
| C4 | /tmp is a 2 GB ext4-on-zram with strictatime, costing compression/atime writes |
Wrong. zram-init is not enabled; only zram0 swap exists; /tmp is on rootfs/eMMC. Replace with: mount tmpfs on /tmp to avoid eMMC writes, and optionally switch zram0 zstd→lz4 (low impact, only 2.5 MB used). |
| C5 | BMS FIFO IRQs ≈ every 20 s → ~3 uevents/min shell storm | Overstated. Measured 1 BMS IRQ / ~30 s → 2 uevents/min. Keep the fix but lower its priority. |
| C6 | "schedutil rate-limit fix not in effect at runtime" (older session) | Resolved. rate_limit_us=40000 confirmed live. |
| C7 | Idle average CPU ~440–582 MHz indicates constant wakeups / CPU never truly idles | Wrong. time_in_state shows ~99 % of 43 h at 200 MHz; cpuidle SPC ~98 % of uptime; 60 s window CPU idle 98.15 %. Cores are power-collapsed. Reframe the problem as "no system-wide suspend", not "CPU busy loops". |
| C8 | GPU devfreq .polling_ms=50 runs a 20 Hz poll continuously |
Overstated. 1c00000.gpu is runtime-suspended, so devfreq polling is stopped. Real issue: cur_freq=409600000 (max OPP) on resume. |
| C9 | chronyd polls NTP every 64 s |
Overstated. After 43 h uptime chronyd is at maxpoll ≈ 1024 s. Low priority. |
| C10 | "Only per-core SPC idle is available" | True but incomplete. It is available and heavily used (~98 %). The missing piece is system-wide suspend, now hard-confirmed by a 0-byte /sys/power/state. |
| C11 | CONFIG_SUSPEND off and CPUFREQ_ETERNAL inferred from the repo config |
Confirmed with hard measurements: # CONFIG_SUSPEND is not set in /proc/config.gz, 0-byte /sys/power/state, cpuinfo_transition_latency=4294967295. These become the top two evidence-backed items. |
| C12 | Average mA can be measured via current_now |
Not possible. No current_now attribute, and the device is charging. All mA numbers remain estimates. |
| C13 | 4 CPU cores | 2 cores (0-1) — MSM8905 is dual-core; expected, not a bug. |
| C14 | iw/powertop available for verification |
Both missing. Wi-Fi PS verified indirectly via IRQ/packet rates and NM config. |
| C15 | (new) | mmcli reports drx-cycle: "--", mico-mode: "--" → no LTE DRX/MICO power saving configured. New concrete modem-side item. |
| C16 | (new) | superd runs without -l /dev/null because the user sxmo_hook_start.sh wins; zero-log default not fully applied. |
| C17 | (new) | mmcli's drx-cycle / mico-mode are 5G NR registration settings, not LTE DRX knobs. The "configure QMI NAS long DRX / MICO" sub-item of K11/U9 is withdrawn as inapplicable; the on-demand DPM port and DSDS timer backoff remain. |
4. Corrected kernel-side optimizations
Ordered by expected impact, with measured evidence. Regression risks are stated.
| # | Change | Evidence / expected effect | Risk |
|---|---|---|---|
| K1 | Enable CONFIG_SUSPEND=y (+ CONFIG_PM_SLEEP, CONFIG_PM_WAKELOCKS=y, CONFIG_SUSPEND_FREEZER=y) in patches/kernel/config-bananarchy-msm8909.armv7; add wakeup-source to the WCNSS/pronto and modem/SMP2P DT nodes so Wi-Fi WoWLAN and QMI/QRTR calls can resume the AP. |
/sys/power/state is 0 bytes; all prerequisites are already y. Unlocks wcn36xx_suspend() (ARP/NS/GTK offload + set_power_params(ignore_dtim=true)), BMS suspend() forcing S3, DDR self-refresh and RPM power collapse. Only change that can plausibly push DSDS+Wi-Fi past 24 h. |
echo mem freezes userspace → resume ~100–500 ms, conflicting with the "<2 ms wake" design. Ship as an opt-in/configurable "deep standby" with timed wakelocks around calls, SMS, alarms, SSH/VPN/tethering. |
| K2 | Add clock-latency-ns to cpu-opp-table in all 5 DTS files (or override policy->cpuinfo.transition_latency in qcom-cpufreq-nvmem.c). |
cpuinfo_transition_latency=4294967295 measured. Fixes the 6.44 s schedutil default at its source; makes the rate_limit_us=40000 userspace hack and the bananarchy-display-power-sync re-apply unnecessary and immune to governor-switch kobject recreation. |
Low. Re-measure time_in_state after. |
| K3 | wcn36xx tuning: raise WCN36XX_KEEP_ALIVE_TIME_PERIOD (30 s) to 120–300 s; set an actual listen_interval > 1 (max_listen_interval=200 is only a ceiling); expose set_power_params(ignore_dtim=true) + ARP/NS/GTK offload on screen-blank even without full suspend (today only in wcn36xx_suspend()). |
Measured 1.78 wcn36xx_rx IRQs/s and 111 RX packets/min with 0 TX at idle. Beacon filtering works, but a residual ~1.8/s RX floor remains. No runtime module params exist → needs a kernel patch. |
Too-long keep-alive/listen interval can cause AP deauth or delayed inbound traffic; incoming calls are on cellular so Wi-Fi latency is not critical here. |
| K4 | Throttle the fuel gauge: pm8916_bms_vm.c emits power_supply_changed() on every FIFO IRQ; S1/S2_SAMPLE_INTERVAL=10. Increase intervals and emit only on real capacity/status change. |
Measured 2 BMS IRQs/min → 2 uevents/min → 2 su+sleep 2 forks/min (U4). Lower priority than previously stated, but free to fix. |
Slower % updates; keep force on wake/unlock. |
| K5 | GPU devfreq: msm_gpu_devfreq.c sets initial_freq = gpu->fast_rate and .polling_ms=50. Use DEVFREQ_GOV_POWERSAVE or a lower initial_freq; keep devfreq_suspend_device() on screen-off. |
GPU is runtime-suspended at idle (measured), so the 50 ms poll is not running; but cur_freq=409600000 (max) means every resume jumps to the top OPP. |
UI smoothness. Glamor/DRI3 is enabled in xorg.conf; consider AccelMethod "none" for a 240×320 panel (conflicts with the GPU-acceleration design goal). |
| K6 | Timer/scheduler config: CONFIG_HZ=300→100; CONFIG_PREEMPT=y→CONFIG_PREEMPT_VOLUNTARY; disable CONFIG_SCHED_HRTICK, CONFIG_CPU_FREQ_STAT, CONFIG_IRQ_TIME_ACCOUNTING, CONFIG_SCHED_SMT; enable CONFIG_CPU_IDLE_GOV_TEO. |
Measured ~36 timer IRQs/s + ~27 IPIs/s → ~50 wakeups/s and 29.6 SPC entries/s. Reduces the wakeup floor. | Voluntary preempt may hurt <2 ms UI wake — A/B measure. |
| K7 | Strip debug/tracing (FTRACE, FUNCTION_TRACER, DYNAMIC_DEBUG, PERF_EVENTS, PROFILING, KPROBES, UPROBES, BPF_JIT_ALWAYS_ON, FW_LOADER_DEBUG, THERMAL_EMULATION, MAGIC_SYSRQ, PRINTK_TIME, DRM_MSM_GPU_STATE; DRM_FBDEV_OVERALLOC=0; disable FRAMEBUFFER_CONSOLE/LOGO/SERIAL_MSM_CONSOLE). |
All confirmed =y on the running kernel. Smaller kernel, fewer hooks/timers. |
Loses on-device debugging; keep a debug build variant. |
| K8 | Remove earlycon + console=ttyMSM0,115200 from devices/*/kernel-cmdline.conf (use console=null/quiet). |
Confirmed in /proc/cmdline; 78af000.serial has runtime_status=unsupported → UART clock stays on. |
No serial debugging. |
| K9 | Trim built-in subsystems: INPUT_MOUSE/JOYSTICK/TOUCHSCREEN, MAC80211_LEDS, INPUT_LEDS, LEDS_QCOM_LPG, NETFILTER (if no VPN/tether/NAT), CGROUPS/MEMCG (if elogind/OpenRC don't need them), unused USB_NET_*/DRM_PANEL_*/VIDEO_QCOM_VENUS/CAMSS modules; defer msm8905-cam load from /etc/modules. |
All confirmed built-in/loaded. Less probe/IRQ/timer and memory overhead. | VPN/Tor/WireGuard/tethering need netfilter; GTK/WebKit may need IPv6 loopback; camera app must trigger the load. |
| K10 | IPv6 on wlan0: CONFIG_IPV6=m + ipv6 in /etc/modules; measured link-local address and 36,977 Ip6InReceives. Set NM ipv6.method=ignore for Wi-Fi profiles (or sysctl net.ipv6.conf.wlan0.disable_ipv6=1). |
Removes ND/MLD multicast that keeps Wi-Fi awake. | IPv6-only networks. |
| K11 | Modem/DSDS power collapse: make --dpm-open-port conditional on an actual cellular data connection and --dpm-close-port when Wi-Fi is the default route; add DT wakeup-source for the WCNSS/modem remoteprocs; ensure rpmsg_wwan_ctrl/qcom_bam_dmux runtime PM. (QMI NAS DRX/MICO withdrawn — C17.) |
Measured: DSDS active (LTE + GSM), bearers: [], no GSM profiles, yet DPM port open at boot. Directly targets the reported scenario. |
Must preserve incoming calls/SMS on both SIMs; verify dsds-daemon still receives QRTR indications. |
| K12 | Display transport: damage/partial-update support in panel-mipi-dbi so a statusbar change does not push a full 240×320×2 SPI frame; 78b9000.spi measured 0.17 IRQs/s. |
Less SPI/GPU work per redraw. | Driver work; per-device panel init sequences. |
| K13 | zram: switch zram0 from zstd to lz4 (CONFIG_ZRAM_DEF_COMP_LZ4), and mount tmpfs on /tmp (currently on rootfs/eMMC → mmc0 0.75 IRQs/s). |
Lower CPU per swap I/O and fewer eMMC writes. Measured only 2.5 MB swap used → low impact. | Slightly worse compression; /tmp size must be bounded on a 512 MB device. |
| K14 | Optional advanced: CONFIG_RCU_LAZY=y + rcu_nocbs=all (batches RCU callbacks), CONFIG_ENERGY_MODEL + EAS, CONFIG_PM_AUTOSLEEP for opportunistic suspend. |
Further idle savings. | EAS needs OPP energy data; autosleep needs a correct wakelock policy. |
5. Corrected userspace-side optimizations
| # | Change | Evidence / expected effect | Risk |
|---|---|---|---|
| U1 | Re-enable idle blanking while unlocked: stop touching sxmo.noidle in bananarchy-x11-session.sh/sxmo_hook_start.sh; provide a blank-without-lock path (today sxmo_state.sh set screenoff → sxmo_hook_screenoff.sh → xlocker screenoff also locks). |
Measured: screen unlocked, brightness 10/14, DPMS On, idle_locker not running → backlight/panel/GPU live 24/7. Largest userspace win. |
Changes the earlier "unlocked screen never blanks" design; make it a configurable timeout. |
| U2 | Implement real suspend: replace no-op sxmo_autosuspend.sh/sxmo_suspend.sh, set AllowSuspend=yes, remove the infinite sxmo_not_suspendable wakelock and sxmo.nosuspend, and use the existing timed wakelocks (sxmo_modem.sh, sxmo_hook_postwake.sh) once CONFIG_PM_WAKELOCKS exists. sxmo_hook_block_suspend.sh already lists the blockers. |
Enables K1. /sys/power/wake_lock is absent today, so all current wakelocks are no-ops. |
Resume latency; must not suspend during calls, SMS, ringtone, active SSH/VPN/tethering. |
| U3 | statusbar_periodics: sxmo_run_aligned.sh 60 sxmo_hook_statusbar.sh periodics is running and its guard passes. Replace mmcli -m any -J, nmcli -t con show --active, nmcli ... device wifi list, rfkill list wifi, xsetroot -name with D-Bus PropertiesChanged signals, or raise to ≥300 s and only xsetroot on change. |
Removes a 60 s QMI/D-Bus/process burst and a full dwm bar redraw (SPI frame). | Statusbar icons lag up to the new interval. |
| U4 | Battery udev path: filter 85-bananarchy-battery.rules to KERNEL=="pm8916-bms-vm"/ENV{POWER_SUPPLY_NAME}, drop the (sleep 2; ... recheck) fork, avoid su per event. |
Measured 2 uevents/min; removes the su/sleep forks. Lower priority than previously stated. |
Charging icon must still update instantly on plug/unplug (keep the charger event). |
| U5 | Bluetooth (latent): set AutoEnable=false, finite DiscoverableTimeout/PairableTimeout, ControllerMode=dual, and keep BT out of the default runlevel. |
BT is already off (soft-blocked, daemon not running) — no current saving today; this prevents a future drain when a user enables BT. | BT must still auto-reconnect when explicitly enabled; dual mode is required for LE HID profiles. |
| U6 | chronyd: remove from the default runlevel or set minpoll 12 maxpoll 16; rely on rtcsync/RTC (osclock, swclock-offset-boot are already in the boot runlevel). |
Measured running with pool pool.ntp.org iburst, but after 43 h uptime it is at ~1024 s polls → low priority. Removes a daemon and occasional DNS/NTP Wi-Fi wakeups. |
Clock drift without NTP. Refined in section 16: removing iburst broke the initial sync entirely, so iburst was restored and a network-up hook was added; the long steady-state polls are unchanged. |
| U7 | wpa_supplicant / respawn storm |
Removed — see C1. One stable -u instance; the yesno typo is harmless. Optionally fix the cosmetic typo. |
None. |
| U8 | NetworkManager: add [device] wifi.scan-interval=600 (no override exists today), ipv6.method=ignore for Wi-Fi profiles, keep wifi.powersave=3 and connectivity.enabled=false. |
Fewer roaming scans and IPv6 ND/MLD wakeups (measured IPv6 active on wlan0). | Roaming responsiveness; IPv6-only networks. |
| U9 | DSDS/modem userspace: make dsds-daemon poll_stored_sms (600 s when unlocked) purely event-driven (WMS NEW_MESSAGE indications), add backoff on its time.sleep(2) exception loop, make --dpm-open-port on-demand, and add a "DSDS power-save" toggle (disable secondary subscription / prefer 2G / single-standby while Wi-Fi is the default route). |
Measured DSDS active with LTE+GSM, no data bearer, DPM port open, drx-cycle/mico-mode unset. Directly reduces baseband wakeups. |
Must not lose SIM2 calls/SMS; gate on user preference. |
| U10 | sxmo_soundmonitor.sh 5 s loop |
Removed — see C3. evtest /dev/input/event5 blocks; pactl subscribe is event-driven. Optional: replace the sleep 2 outer restart loop with a longer backoff. |
None. |
| U11 | Plugin timers (conditional, not active now): sip_plugin.cpp 15 s poll with enabled accounts, tox_plugin.cpp 250–1000 ms iterate, locker_plugin.cpp 1-min clock timer, gps_plugin.cpp usleep(300000). Move to timerfd/event-driven and freeze when the screen is blanked. |
Removes periodic wakeups when those apps are configured. | SIP REGISTER expiry / Tox presence. |
| U12 | zram / /tmp (corrected): mount tmpfs on /tmp (currently on rootfs/eMMC); optionally switch zram0 zstd→lz4. zram-init is not enabled, so its type1=/tmp/strictatime config is dead. |
Fewer eMMC writes (mmc0 0.75 IRQs/s) and cheaper compression. Measured only 2.5 MB swap used → low impact. |
Bound /tmp size on 512 MB RAM. |
| U13 | Align the shipped user hook: ~/.config/sxmo/hooks/sxmo_hook_start.sh starts superd without -l /dev/null; the default hook has it. The user hook wins via PATH. |
Restores the intended zero-log default (measured superd without -l /dev/null). |
None. |
| U14 | Xorg: AccelMethod "glamor" + DRI3 keeps the GPU path live; bananarchy-x11-session.sh re-runs xrdb, feh, bananarchy-sync-dunst-theme on every dwm restart. Consider software rendering for QVGA and skip wallpaper/theme work when the screen is off. |
Pairs with K5. | UI smoothness / <2 ms wake. |
6. DSDS + Wi-Fi specific combined measures
- Close the cellular data plane when Wi-Fi carries traffic. No GSM profiles exist and
bearers: [], yetmsm8909-modem-wwan-portopens the DPM BAM-DMUX port at every boot — pure overhead in this scenario (K11/U9). - Reduce tune-away.
DUAL_SIM_ACTIVE=1withPRIMARY_GW_SLOT=2(LTE) andSECONDARY_GW_SLOT=1(GSM). A screen-off policy that drops the secondary subscription to single-standby (keeping SIM2 reachable via paging) is the remaining modem-side lever; thedrx-cycle/mico-modefields are 5G-only and not applicable here (C17). - Let Wi-Fi sleep deeply. WoWLAN + ARP/NS/GTK offload +
ignore_dtimare implemented inwcn36xx_suspend()but unreachable without K1/U2. Today the residual floor is ~1.8 RX IRQs/s and 111 RX packets/min with zero TX (K3/U8). - Silence the remaining periodic noise: 60 s statusbar (U3), 2/min BMS uevents (U4), chronyd NTP (U6, low), 600 s DSDS SMS poll (U9), SIP/Tox timers when configured (U11).
- The screen is the biggest single controllable load: unlocked, brightness 10/14, DPMS On, no idle blank (U1). No combination of kernel tweaks will reach 24 h while the panel and backlight stay on continuously.
7. Re-prioritized shortlist
- K1 + U2 — enable suspend (0-byte
/sys/power/stateconfirmed) with wake sources and timed wakelocks. Biggest absolute win; conflicts with <2 ms wake, so ship as opt-in deep standby. - U1 — configurable idle blank while unlocked (screen measured on 24/7). Largest userspace win.
- K2 —
clock-latency-nsin the OPP table (4294967295measured); removes the userspacerate_limit_ushack at its source. - K3 + K11 + U9 — WoWLAN/DTIM-skip, wcn36xx keep-alive/listen interval, QMI NAS DRX/MICO, on-demand DPM port, DSDS tune-away reduction. Directly targets the reported DSDS+Wi-Fi case.
- U3 + U4 + U8 — 60 s statusbar storm, BMS udev forks, IPv6/scan interval on wlan0.
- K6 + K7 + K8 — kernel config trimming (HZ/preempt/hrtick, debug/tracing, serial console).
- K5 + K10 + K13 + U12 — GPU resume OPP, IPv6 off, tmpfs
/tmp, lz4 zram (measured low impact). - U5 + U6 + U11 + U13 + U14 — latent/conditional cleanups (BT config, chronyd, plugin timers, zero-log hook, Xorg accel).
Items U7 and U10 from the previous analysis are withdrawn.
8. Corrected verification plan (for a battery-powered run)
The phone must be disconnected from USB power to measure discharge; SSH then has to go over
wlan0 (the Wi-Fi connection OffOurStreets_ is active). Because iw, powertop and
current_now are unavailable, use:
zcat /proc/config.gz | grep -E 'SUSPEND|PM_WAKELOCKS';wc -c /sys/power/state;ls /sys/power/;cat /sys/power/wake_lock.cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_transition_latency(expect a realistic value after K2),schedutil/rate_limit_us,stats/time_in_state.- 60 s deltas of
/proc/stat,/proc/interrupts,/proc/net/dev, cpuidlestate*/usage,pm8916_vm_bmsIRQ count, andudevadm monitor --subsystem-match=power_supplyevent count. nmcli -t -f DEVICE,TYPE,STATE device,mmcli -m any -J(checkdrx-cycle/mico-mode),/usr/libexec/msm-modem-uim-selection status,cat /tmp/sxmo_dsds_active.rfkill list,rc-update show -v,rc-status,superctl status,sxmo_jobs.sh list,ps -o pid,etime,args -A.DISPLAY=:0 xset q,cat /sys/class/drm/card0-SPI-1/dpms,/sys/class/backlight/backlight/{brightness,bl_power},sxmo_state.sh get.- Compare 1 h idle drain (screen off, DSDS, Wi-Fi on) before/after each change; target < 62.5 mA average for > 24 h on the 1500 mAh pack.
9. Summary
The live device confirms the two structural root causes: there is no suspend state at all
(/sys/power/state is empty, CONFIG_SUSPEND off) and the unlocked screen never blanks
(sxmo.noidle, brightness 10/14, DPMS On, idle_locker absent), with DSDS (LTE+GSM) and Wi-Fi
both fully associated. It also confirms cpuinfo_transition_latency=4294967295 and that the
schedutil rate-limit fix is working. Conversely, it disproves four earlier claims (duplicate
wpa_supplicant, BT always on, soundmonitor 5 s loop, /tmp on zram) and shows that the CPU
cores are already ~98 % power-collapsed — so the remaining drain is always-on SoC rails, DDR,
display and radios, not CPU busy loops. K1/U2 plus U1 are the only changes that can plausibly
deliver > 24 h; the rest are incremental but cumulatively significant.
10. Implementation status (applied in this change set)
Every item in sections 4 and 5 was addressed; the table below records how, and flags the few places where the regression checks mandated by the analysis changed the implementation.
| Item | Implementation |
|---|---|
| K1 | CONFIG_SUSPEND, CONFIG_SUSPEND_FREEZER, CONFIG_PM_WAKELOCKS, CONFIG_PM_WAKELOCKS_LIMIT/GC, CONFIG_PM_AUTOSLEEP enabled; wakeup-source added to the WCNSS/pronto remoteproc in all 5 DTS files; build-kernel-audio.sh now builds the zImage from the tuned config and ships it as overlay/rootfs/boot/vmlinuz (+ config, System.map). |
| K2 | clock-latency-ns = <100000> added to cpu-opp-table in all 5 DTS files. |
| K3 | New patches/kernel/0006-...patch: keep-alive 30 s -> 120 s, listen_interval = 3, BMS sample interval 10 -> 30, power_supply_changed() throttled to real capacity changes, GPU devfreq polling_ms 50 -> 100. WoWLAN/ARP/NS/GTK offload + ignore_dtim come from wcn36xx_suspend() once K1 is active. |
| K4 | Same patch 0006 (kernel) + U4 (userspace). |
| K5 | Kernel patch (polling_ms) + 10-power-save.start writes polling_interval=100 + sxmo_wm.sh display off/on switches the GPU devfreq governor to powersave/simple_ondemand. |
| K6 | CONFIG_HZ=100, CONFIG_PREEMPT_VOLUNTARY, SCHED_HRTICK/CPU_FREQ_STAT/IRQ_TIME_ACCOUNTING/SCHED_SMT off, CPU_IDLE_GOV_TEO=y. |
| K7 | Ftrace/function tracer/dynamic debug/perf/profiling/kprobes/uprobes/BPF-JIT-always-on/fw-loader-debug/thermal-emulation/Magic SysRq/printk-time/DRM GPU state/logo/serial console disabled; DRM_FBDEV_OVERALLOC=0; LED triggers and unused input classes disabled. FRAMEBUFFER_CONSOLE kept (plymouth boot splash) and NETFILTER/IPV6/CGROUPS kept (Tor/WireGuard/tethering and elogind) — these are the regression checks from the risk column, not skipped items. |
| K8 | earlycon and console=ttyMSM0,115200 removed from all devices/*/kernel-cmdline.conf and from usr/lib/kernel-cmdline.d/50-device-*.conf in the overlay. |
| K9 | Unused built-in input classes and LED triggers disabled; netfilter/IPv6/cgroups deliberately retained (see K7); msm8905-cam retained in /etc/modules because its out-of-tree platform driver has no udev autoload path — removing it would break xcamera. |
| K10 | net.ipv6.conf.default.disable_ipv6=1 in etc/sysctl.d/99-bananarchy-power.conf and 10-power-save.start; the ipv6 module stays loaded for WireGuard/Tor and ::1 on lo. |
| K11 | wakeup-source on pronto; unconditional boot-time QMI DPM --dpm-open-port restored in a1114 (section 20.3) because MMPluginQcomSoc requires net/wwan0 to create /org/freedesktop/ModemManager1/Modem/0 while bam-dmux.c already runtime-suspends in 1000 ms (pc_state=0, DMA channels released) whenever idle. QMI NAS DRX/MICO withdrawn (C17); AT $QCDRX=6 shipped in section 20. |
| K12 | Deferred with justification: damage/partial-window updates in panel-mipi-dbi need panel-specific GC9305/GC9307 commands and risk display corruption. The equivalent userspace win (no full-frame redraw on every statusbar tick) is delivered by U3. |
| K13 | CONFIG_ZRAM_DEF_COMP_LZ4=y, zram-init algo*=lz4, /tmp mounted as tmpfs via etc/fstab. |
| K14 | CONFIG_ENERGY_MODEL enabled; CONFIG_RCU_NOCB_CPU/CONFIG_RCU_LAZY are dependency-gated (`RCU_EXPERT |
| U1 | bananarchy-idle-blank.sh + sxmo_hook_unlock.sh starts idle_locker at SXMO_UNLOCK_IDLE_TIME (default 60 s) with a blank-without-lock resume hook; bananarchy-x11-session.sh no longer forces sxmo.noidle. |
| U2 | bananarchy-suspend.sh / bananarchy-deep-standby.sh / sxmo_autosuspend.sh / sxmo_suspend.sh, AllowSuspend=yes, doas rule, infinite wakelock removed, sxmo.nosuspend removed, sxmo_hook_screenoff.sh starts the grace timer, sxmo_hook_unlock.sh/postwake.sh cancel it. Shipped disabled via /etc/bananarchy-no-deep-standby until the new kernel has been boot-tested: a broken driver suspend callback must never leave a flashed phone unwakeable. freeze (s2idle, any-IRQ wake) is preferred; mem requires /etc/bananarchy-allow-mem-suspend. |
| U3 | statusbar_periodics interval 60 -> 300 s; sxmo_hook_statusbar.sh periodics drops mmcli/nmcli/rfkill polls and only calls xsetroot when the status string changes. |
| U4 | udev rule filtered to the two PM8916 supplies; (sleep 2; ... recheck) fork removed from sxmo_hook_battery.sh. |
| U5 | AutoEnable=false, finite discoverable/pairable timeouts, ControllerMode=dual, fewer reconnect attempts. BT was already off on the device, so this is a latent fix. |
| U6 | etc/chrony/chrony.conf uses minpoll 12 maxpoll 16 with iburst restored; bananarchy-time-sync.sh refreshes the pool on network-up (section 16). |
| U7 | Withdrawn (C1); the cosmetic yesno typo in etc/init.d/wpa_supplicant was fixed anyway. |
| U8 | [device] wifi.scan-interval=600 in 10-power.conf; IPv6 disabled on new interfaces (K10). |
| U9 | dsds-daemon 600 s -> 1800 s poll (and poll_timeout = None while dark in section 20) plus 2 s -> 30 s error backoff; sxmo_modemmonitor.sh 10/120 s -> 30/600 s. Conditional DPM port gating reverted in section 20.3 (bam-dmux already runtime-suspends in 1000 ms when idle, whereas omitting net/wwan0 broke ModemManager on Wi-Fi-only setups). |
| U10 | Withdrawn (C3); the outer pactl subscribe restart backoff raised 2 s -> 10 s. |
| U11 | sip_plugin.cpp 15 s -> 60 s poll; tox_plugin.cpp iteration clamp 250-1000 ms -> 1000-2000 ms. locker_plugin.cpp already blocks indefinitely when blanked; gps_plugin.cpp's usleep(300000) is in the --test CLI path only. |
| U12 | tmpfs on /tmp; zram lz4, noatime, size1=256. |
| U13 | Shipped user/skel sxmo_hook_start.sh now starts superd -l /dev/null with /dev/null log symlinks, matching the default hook. |
| U14 | bananarchy-x11-session.sh skips xrdb/feh/dunst-theme work when the panel is dark. Glamor retained (GPU-acceleration design goal). |
Not runtime-verified: the new kernel image, DTBs, clock-latency-ns, suspend states and
the kernel patch 0006 require a reflash + reboot. The userspace changes were deployed and
syntax/runtime-checked on the connected phone (charging over USB, so no discharge-current
measurement was possible). Deep standby stays opt-in until that boot test is done.
11. Recovery: why the kernel-config items cannot ship as-is
The first implementation pass rebuilt the kernel image from a retuned config and produced an
image that stays on the lk2nd logo. Two ABI incompatibilities with the
linux-postmarketos-qcom-msm8916 module tree (which this repo does not rebuild) were found:
- Vermagic —
CONFIG_PREEMPT_VOLUNTARYremovesCONFIG_PREEMPT_BUILD, so the rebuilt kernel reports6.12.1-msm8916 SMP mod_unload ARMv7 p2v8while every package module reports6.12.1-msm8916 SMP preempt mod_unload ARMv7 p2v8.modproberefuses all of them, includingpanel-mipi-dbiandmsm, so the display never initialises. Verified on-device before the reflash and on the built artifacts withmodinfo. - Struct layout —
CONFIG_SUSPEND=yselectsCONFIG_PM_SLEEP, which addsentry,completion,wakeup,wakeup_path,syscore,no_pm_callbacks,async_in_progress,must_resume,may_skip_resumetostruct dev_pm_info. Modules built without it use wrongdev->power.*offsets; matching vermagic would not be sufficient.
Consequence: K1 (CONFIG_SUSPEND + wakelocks), K6 (preempt/HZ/hrtick), K7 (debug/tracing
config), K8 (no serial console), K13 (ZRAM_DEF_COMP) and K14 (ENERGY_MODEL) are reverted to
the known-good config. Implementing them properly requires either (a) vendoring and rebuilding
the entire pmaports kernel module tree so every module matches the new kernel, or (b) shipping
a kernel with the original ABI and accepting that those config-level savings are unavailable.
Kept because they do not depend on the kernel config: K2 (clock-latency-ns in the DTB),
K3/K4/K5 (patch 0006, rebuilt with the original config), K10 (IPv6 sysctl), and all U1-U14
userspace changes. Deep standby (U2) stays disabled and inert.
12. Post-flash fixes (after the recovery image booted)
- U1 idle blank wake race: replaced the
sxmo_idle.sh/xprintidlejob with a dwm-native idle timer (src/sxmo-dwm/dwm.c), because dwm consumes evdev key events before X sees them.wake_phone()now resets the timer, so pressing the power key can no longer turn the screen on and immediately back off. - DSDS with a PIN-locked SIM:
provision_slot()now prefers the ready slot forprimary-gw-provisioningwhen the preferred slot ispin1/puk1, so the unlocked SIM registers at boot.verify-pinre-runsbootafter unlock.
13. Configurable screen blank (post-flash)
U1's idle blanking is now a user-facing setting: Config -> Screen blank
(Off, 30 s, 1/5/10/30 min; default 5 min) writes
~/.config/sxmo/idle_blank_timeout. dwm reads it live and reloads on
SIGUSR1. Lid close / Power-menu Lock blank immediately; incoming calls and
SMS/notifications wake immediately via bananarchy-screen-wake.sh, which also
resets dwm's idle timer. This keeps the panel off for long idle periods
(battery) without delaying call/SMS visibility.
14. Remaining kernel headroom and the full-module-tree question (live re-measurement)
This section answers two questions with fresh on-device data: what kernel-side
optimizations are still unimplemented after ad3461b / 0dbb37f / 22d629f /
da68bb8, and whether rebuilding the entire pmaports kernel module tree is
worth doing to unlock them.
14.1 Session, limits, and state
- Host clock 2026-11-07 18:03-18:46 EET; phone
Bananarchy Linux a1107(historical measurement; current builda1111/lennon),Linux nokia-argon 6.12.1-msm8916 #1 SMP PREEMPT, freshly rebooted (uptime 12-22 min during the windows), reachable at172.16.42.1over USB RNDIS. - Charging throughout:
pm8916-lbc-chgr/online=1,constant_charge_current=540000,pm8916-bms-vm/status=Charging, capacity85 -> 87,voltage_now4.198 -> 4.309 V. There is nocurrent_now, no coulomb counter,voltage_ocvis empty,hwmon6exposes onlyin0_input,/proc/config.gzis absent, and the SPMIregmapdebugfsregistersfiles are read-only and returnXX. The charger'sCONSTANT_CHARGE_CURRENTsetter clamps toPM8916_LBC_CHGR_MIN_CURRENT(90 mA) and always writesCHG_EN, so charging cannot be disabled from userspace. No discharge current was measurable; every mA figure below is a structural estimate, exactly as in section 1. - Wi-Fi associated to
OffOurStreets_; both SIMs registered on the network (SLOT1_REG_STATE=registered / lte / -67 dBm,SLOT2_REG_STATE=registered / gsm / -66 dBm), so DSDS RF was active during the measurement. Caveat:mmcli -LreportedNo modems were foundin this session even though QMI NAS showed both SIMs registered; as root-caused and fixed in section 20.3,U9's conditional--dpm-open-portgating leftnet/wwan0unregistered on Wi-Fi-only setups, causingMMPluginQcomSocto abort modem probing without affecting modem RF registration. - Idle windows ran with the panel forced dark (
brightness=0,bl_power=4, DPMSOff) viabananarchy-idle-blank.sh off. - Session incident: at ~22 min uptime the phone stopped responding (blank
panel, USB RNDIS gone from the host, no fastboot/EDL/ADB) and needed a hard
power-key reset.
pstorewas empty and the post-resetdmesgshows no panic or oops; after the reset the phone booted normally with the screen on, Wi-Fi connected and all services started. No kernel image, module, DTB, cmdline or config was changed in this session — every probe was a read-only sysfs/debugfs//procread plusbananarchy-idle-blank.sh off/onround-trips. The cause is unknown; it is another reason not to swap the kernel/module ABI on a device whose wake path is this fragile. - Post-reset fuel-gauge transient (new kernel-side finding): for the first
~3.5 min after a hard reset the VM-BMS reports
voltage_now=19199723uV (19.2 V),health=Over voltage,status=Full,capacity=100, whilevoltage_ocvis a sane 4.267 V. The cause is an uninitialised FIFO sample of0xffff:pm8916_bms_vm_fifo_update_done_irq()accepts any raw value> 8000, and0xffff * 292.969 uV = 19.2 V. It settles to 4.32 V /Good/ 96% once the first real 30 s FIFO sample arrives. This is a correctness bug inpm8916_bms_vm.c, fixable with a source-only sanity clamp (no config or ABI change); it is listed in 14.7.
14.2 What the idle application processor actually does now
60-second window, screen off, Wi-Fi up, both SIMs registered:
| Signal | Rate |
|---|---|
arch_mem_timer (broadcast timer, GIC 39) |
20.70 /s |
arch_timer (GIC 20) |
15.08 /s |
| Total timer IRQs | 35.78 /s |
IPI3 function call |
8.40 /s |
IPI1 timer broadcast |
1.78 /s |
IPI2 rescheduling |
0.85 /s |
wcn36xx_rx |
2.43 /s |
mmc0 |
2.20 /s |
smd-edge |
0.35 /s |
wcn36xx_tx |
0.08 /s |
pm8916_vm_bms |
0.02 /s |
cpu-sleep-0 (SPC) entries, cpu0 / cpu1 |
19.4 /s, 10.1 /s (29.5 /s) |
CPU idle (/proc/stat) |
98.08% overall, 99.22% cpu0, 96.93% cpu1 |
Runtime PM / clocks / regulators at the same moment:
78b9000.spi,1c00000.gpu,7824900.sdhci,7864900.sdhciallstatus=suspended; GPU devfreqsimple_ondemand, 409.6 MHz, 100 ms poll.pm_genpd_summary:mx,mx_ao,cx, all GDSCsoff-0;cx_aoon(cpu0);1c00000.gpu,4080000.remoteproc(modem),a204000.remoteproc(WCNSS) allsuspended.- 21 clocks have a nonzero enable count. The always-on ones are structural:
bimc_ddr_clk_src768 MHz (DDR not in self-refresh),a53pll1094.4 MHz,gcc_mss_q6_bimc_axi_clk768 MHz (modem bus),gcc_usb_hs_system_clk80 MHz +gcc_usb_hs_ahb_clk100 MHz (USB RNDIS),sleep-clk32.768 kHz, andgcc_blsp1_uart1_apps_clk3.686 MHz (theconsole=ttyMSM0serial console). Regulators withuse > 0ares2,l5,l6,l7,l8,l13,l17(audio codec, SDHCI, USB PHY, panel supplies) — no orphaned rail. - All four LEDs are off with
none/mmc0/mmc1triggers; no periodic LED trigger exists. - With the panel dark, userspace is nearly silent: 19.5 voluntary context
switches/s total, of which
rcu_preempt9.8/s,kcompactd02.1/s, a few kworkers ~4/s.Xorgdrops from 43.5/s (screen on) to ~0/s. Ninehrtimer_wakeupentries were armed at any instant, with 0.5-2.5 s periods.
In short: the userspace work from U1-U14 has already removed essentially all userspace wakeups. What remains is kernel-internal tick/hrtimer/RCU activity plus a handful of peripheral IRQs, on an AP that is already ~98% idle with every runtime-PM domain collapsed.
14.3 Decisive finding: mem suspend is impossible on this platform
Enabling CONFIG_SUSPEND would not give suspend-to-RAM here:
arch/arm/boot/dts/qcom/qcom-msm8916-smp.dtsiexplicitly setspsci { status = "disabled"; }and replaces the PSCI idle state withqcom,idle-state-spc. The live device tree has no/proc/device-tree/pscinode, no/sys/firmware/psci,dmesgsaysqcom_scm: convention: smc legacy, and the cpuidle driver isqcom_spm.- The only
suspend_set_ops()caller reachable on ARM DT platforms isdrivers/firmware/psci/psci.c, and it only registers when PSCI 1.0SYSTEM_SUSPENDis available.arch/arm/mach-qcom/has no suspend ops.valid_state(PM_SUSPEND_MEM)inkernel/power/suspend.creturns false withoutsuspend_ops, so writingmemto/sys/power/statedegrades tomem_sleep_current = s2idleat best and is rejected otherwise. - Consequence:
CONFIG_SUSPEND=yyields onlyfreeze(s2idle). s2idle callstick_freeze()->timekeeping_suspend()and freezes tasks, so the ~36 timer IRQs/s stop, but there is no RPM-assisted SoC power collapse and no DDR self-refresh.bimc_ddr_clk_srcstays at 768 MHz. That is the one saving that could plausibly have been worth tens of mA, and it is gated by firmware (lk2nd would have to implement PSCISYSTEM_SUSPEND), not by the kernel config.
14.4 Full module tree rebuild: feasibility (it is clean)
The rebuild itself turned out to be much less risky than assumed in section 11:
- pmaports
v26.06device/testing/linux-postmarketos-qcom-msm8916/APKBUILD(6.12.1-r5) uses the samemsm8916-mainline/linuxv6.12.1-msm8916tarball thatscripts/build-kernel-audio.shalready caches. Itsprepare()isdefault_preparepluscp config-...armv7 .config— no patches at all. There are no pmaports-only driver fixes to lose. - Our
config-bananarchy-msm8909.armv7differs fromconfig-postmarketos-qcom-msm8916.armv7in ~248 lines, almost entirely the GCC/binutils version stamp,CONFIG_MODULE_COMPRESS_ALL=y, andCONFIG_NFT_REDIR=mfor ournft_redir.ko. - The package tree is 579
.ko.zstfiles / 11 MB. Our config already hasCONFIG_MODULE_COMPRESS_ZSTD=y,CONFIG_MODULE_COMPRESS_ALL=yandCONFIG_MODULE_DECOMPRESS=y, somake modules_install INSTALL_MOD_STRIP=1reproduces the exact on-disk layout, andrebuild-image.shalready runsdepmod -b "$ROOTFS" 6.12.1-msm8916.scripts/sync-prebuilt-overlay.shwould mirror aprebuilt/kernel-6.12.1-msm8916/lib/modules/...tree into the overlay without changes.
So the mechanical part is a bounded build-script change plus ~11 MB of artifacts. The reason not to do it is the benefit, not the mechanics.
14.5 Full module tree rebuild: benefit (it is not real)
Quantify the only thing s2idle adds on top of the current state:
- Eliminating all 29.5 SPC entries/s. Entry+exit latency of
qcom,idle-state-spcis 130/150 us; even at a pessimistic 75 mA during each transition, that is ~0.3-0.5 mA of AP transition overhead. Removing every timer IRQ, IPI and Wi-Fi/eMMC IRQ wakeup is the same order of magnitude (<1 mA combined). dpm_suspend()would run every driver's system-sleep callback. Most of what those would power down is already runtime-suspended (SPI, GPU, SDHCI, remoteprocs, panel via DPMS).wcn36xx_suspend()would add ARP/NS/GTK offload andenable_irq_wake(wcn->rx_irq)is already set at probe, so Wi-Fi wake would work, but it only removes 2.43 RX IRQs/s.- The dominant DSDS + Wi-Fi drain is untouched: two registered SIMs' RF, the
WCNSS/Pronto firmware, the modem bus clock, and DDR in active mode. None of
these are configurable from the kernel. Reaching 24 h on 1500 mAh needs
<= 62.5 mAaverage; a plausible current draw in this mode is ~80-120 mA, so ~20-55 mA has to come from the modem/Wi-Fi side, not from <1 mA of AP wakeup overhead.
The remaining config-level items (K6/K7/K13/K14) do not change that verdict:
CONFIG_HZ=100changes theHZmacro compiled into module inlines (include/linux/jiffies.h), so it is not ABI-safe either.CONFIG_ENERGY_MODEL=yinsertsem_pdintostruct device(include/linux/device.h) andCONFIG_PERF_EVENTS/CONFIG_FUNCTION_GRAPH_TRACERchangestruct task_struct— all module-visible. ARM32 has no EAS, soENERGY_MODELbuys nothing anyway.CONFIG_RCU_LAZYdepends onRCU_NOCB_CPUand requiresrcu_nocbs=all; on 2 cores that adds always-runningrcuokthreads and trades away the idle saving (already withdrawn as C17/K14).CONFIG_PREEMPT_VOLUNTARY/CONFIG_HZ=100also work against the project's< 2 msUI wakeup latency target.CONFIG_SCHED_HRTICKoff andCONFIG_CPU_IDLE_GOV_TEO=yare genuinely ABI-safe (the former only touches the privatekernel/sched/sched.h), but with no CFS bandwidth quotas and only two cpuidle states they are effectively no-ops.
14.6 Verdict
Do not rebuild the entire kernel module tree. It is technically feasible,
but the only feature it unlocks is s2idle, which on this firmware cannot do
mem, cannot reach DDR self-refresh, and can save less than ~1 mA of AP
transition overhead against a ~20-55 mA deficit. It would reintroduce exactly
the class of risk that produced the unbootable ad3461b image (vermagic +
struct dev_pm_info), activate untested system-sleep callbacks for the panel,
DRM, Wi-Fi and modem remoteprocs, and conflict with the low-latency design
goal — for no measurable gain in DSDS + Wi-Fi runtime. pmaports deliberately
ships # CONFIG_SUSPEND is not set for this kernel.
Deep standby therefore stays shipped disabled (/etc/bananarchy-no-deep-standby)
and inert, and the known-good module ABI stays untouched. If PSCI
SYSTEM_SUSPEND ever appears in lk2nd for MSM8909, revisit K1: that is the
change that would make a full rebuild worthwhile.
14.7 Remaining kernel-level items, individually
| Item | Expected gain | ABI / design risk | Verdict |
|---|---|---|---|
K1 CONFIG_SUSPEND + wakelocks + autosleep |
<1 mA (s2idle only, no mem) |
vermagic + struct dev_pm_info; untested driver sleep callbacks |
Declined (see 14.3-14.6) |
K6 HZ=100, PREEMPT_VOLUNTARY, no hrtick, TEO |
<1 mA, mostly duplicate of K1 | HZ macro in module inlines; vermagic; latency regression |
Declined |
| K7 disable ftrace/perf/kprobes/BPF-JIT/debug | ~0 when unused | struct task_struct layout for perf/ftrace |
Declined |
K8 remove earlycon console=ttyMSM0 |
gates one 3.686 MHz UART clock, ~0.1-1 mA | none (cmdline only), but removes the serial debug lifeline | Optional, deliberately kept |
| K9 unused input/LED classes | 0 (no LED trigger active, all LEDs off) | none | No-op, declined |
K13 ZRAM_DEF_COMP_LZ4 |
0 (userspace already sets lz4) |
changes the zram module default |
No-op, declined |
K14 ENERGY_MODEL / RCU_LAZY |
0 | struct device / needs rcu_nocbs=all |
Declined |
| K2/K3/K4/K5/K10 (DT + patch 0006) | already landed | none | Done in ad3461b |
| K12 panel partial updates | deferred (display corruption risk) | none | Still deferred |
New: wcn36xx listen_interval 3 -> 5+ |
cuts ~1 Wi-Fi RX IRQ/s | none (source patch), but delays inbound Wi-Fi data | Marginal, declined |
New: commit= on the rootfs mount |
cuts ~2 eMMC IRQs/s | userspace, not kernel; risks data loss on sudden power cut | Out of scope, noted |
| New: VM-BMS FIFO sanity clamp | 0 power, fixes a 19.2 V / Over voltage misreport for ~3.5 min after hard reset |
none (source-only patch to pm8916_bms_vm.c) |
Worth fixing; no rebuild needed |
14.8 Where the 24 h actually has to come from
With the display now dark after 5 minutes and userspace quiet, the kernel is no longer the bottleneck. The remaining budget has to be attacked at the modem and Wi-Fi layers:
- Modem idle power: LTE eDRX / PSM via
AT+CEDRXS/AT+CPSMSon/dev/wwan0at0(or the QMI NAS equivalents). Two continuously registered SIMs on LTE + GSM are the largest single drain; PSM/eDRX is the standard way to cut it by an order of magnitude while staying reachable. This is a modem-firmware configuration, not a kernel config option. - DSDS policy: parking the second SIM (or reducing its polling) when idle trades DSDS availability for a large RF saving.
- Wi-Fi DTIM / listen interval: AP-side DTIM and
wcn36xxlisten_intervaltuning can cut the 2.43 RX IRQs/s, at the cost of inbound data latency. - DDR self-refresh: requires
memsuspend, which needs PSCISYSTEM_SUSPENDin lk2nd. Until thenbimc_ddr_clk_srcstays at 768 MHz and no kernel-side change can fix it.
None of these four are unlocked by rebuilding the module tree.
15. Kernel-side fix and runtime power policies (implemented)
Section 14 concluded that a full module tree rebuild is not worthwhile. This section records the two things that were worth doing: one source-only kernel fix, and a configurable runtime power-policy layer for the modem/Wi-Fi/DSDS items that section 14.8 identified as the real remaining levers.
15.1 VM-BMS FIFO sanity clamp (kernel patch 0007)
patches/kernel/0007-msm8909-bms-fifo-wifi-policy.patch makes the VM-BMS
VADC conversion defensive: PM8916_BMS_VM_RAW_MIN 8000 /
PM8916_BMS_VM_RAW_MAX 16000 (~2.34-4.69 V) with a
PM8916_BMS_VM_NOMINAL_UV 3700000 fallback, and rejects out-of-window FIFO
samples in both the IRQ handler and the probe-time pre-read. An uninitialised
0xffff sample (from the FIFO or the OCV register read on probe/resume)
previously produced voltage_now=19.2 V, health=Over voltage,
status=Full, capacity=100 for the first minutes after a hard reset. The
conversion guard covers every call site, including the two OCV register
reads that a FIFO-only clamp misses. This is a source-only change: no config
symbol, vermagic, or module-visible struct changes, so the known-good
pmaports module ABI stays intact.
15.2 Wi-Fi beacon listen interval (kernel patch 0007 + policy)
wcn36xx gained a listen_interval module parameter (1-10, default 5,
writable via /sys/module/wcn36xx/parameters/listen_interval). The previous
hardcoded value was 3. /etc/bananarchy-power-policy.conf exposes
WIFI_LISTEN_INTERVAL; bananarchy-power-policy.sh regenerates
/etc/modprobe.d/10-bananarchy-power.conf from it. The option is read at
module load, so a change needs a reboot or a wcn36xx reload. Higher values
cut idle wcn36xx_rx wakeups (measured 2.43/s at interval 3) at the cost of
inbound packet latency.
15.3 Modem DRX policy
Live probing of the modem (MPSS.JO.3.0.c4, 2018 firmware) showed:
| Command | Result |
|---|---|
AT+CPSMS=?, AT+CPSMS? |
ERROR (PSM unsupported) |
AT+CEDRXS=?, AT+CEDRXS? |
ERROR (eDRX unsupported) |
AT$QCDRX=? |
$QCDRX: (0,6-9) |
AT$QCDRX? |
$QCDRX: 0 |
AT$QCDRX=6..9 |
OK, readback correct, AT+COPS? stays registered |
qmicli --nas-get-drx |
unknown (read-only, no setter) |
So the standard 3GPP PSM/eDRX AT commands from section 14.8 are not
available on this firmware. The Qualcomm-proprietary AT$QCDRX DRX mode is
the supported equivalent. MODEM_DRX_MODE in
/etc/bananarchy-power-policy.conf accepts 0 (firmware default) or 6-9
and is applied at boot and on every screen wake via
msm-modem-uim-selection at auto. Default is 0 because values above 6
are undocumented here: AT$QCDRX=9 made the AT channel briefly
unresponsive during testing. Users who accept longer paging latency can opt
in to 6.
15.4 DSDS secondary-SIM policy
Two mechanisms were tested on the live phone:
qmicli --uim-sim-power-off=2/--uim-sim-power-on=2works, but the power-on leaves a PIN-enabled SIM inpin1-or-upin-pin-required/enabled-not-verifiedand the secondary subscription unregistered. A warm reboot andAT+CFUN=1,1do not restore the cached PIN verification. This mechanism is therefore rejected for automatic parking.qmicli --uim-change-provisioning-session='activate=no,session-type=secondary-gw-provisioning'deactivates the secondary GW session cleanly, and reactivation withslot=2,activate=yes,session-type=secondary-gw-provisioning,aid=<AID>restores it without power-cycling the SIM (no PIN loss). Verified on the device.
DSDS_SECONDARY_MODE=eco (default active) uses the second mechanism: after
DSDS_PARK_DELAY seconds of a dark panel, bananarchy-power-policy.sh
parks the secondary subscription and reactivates it on wake. The AID is read
from --uim-get-card-status at park time and cached in /run. Hooks in
sxmo_wm.sh display off/on drive it, so both the dwm idle blank and the
locker screenoff paths are covered. SIM2 is unreachable while parked;
that is the deliberate trade for its RF saving.
15.5 What is still not implementable
- DDR self-refresh /
memsuspend needs PSCISYSTEM_SUSPENDin lk2nd (section 14.3). No kernel or userspace change can provide it here. - Standard LTE PSM/eDRX needs modem firmware support that this
MPSS.JO.3.0.c4build does not expose (section 15.3). - Discharge-current measurement remains impossible over USB RNDIS
(charging at 540 mA, no
current_now, no coulomb counter). All savings above are expressed as wakeup/IRQ counts, not mA.
15.6 Deployment and verification
scripts/build-kernel-audio.shapplies patch 0007 in both the cached-tree and fresh-tarball paths; the resolved.configis unchanged, so vermagic andstruct dev_pm_infostay compatible with the untouched package modules.bananarchy-power-policy.shis installed as an OpenRC default-runlevel service;doas.d/50-sxmo.confpermits the X session to invoke it.- Live verification on the connected phone:
statusreportsWIFI_LISTEN_INTERVAL=5/wcn36xx_param=5/modem_drx_now=$QCDRX: 0;MODEM_DRX_MODE=6applies and reads back as$QCDRX: 6with both SIMs still registered;DSDS_SECONDARY_MODE=ecoparks the secondary GW session after the delay and restores it (with its captured slot and AID) on wake;WIFI_LISTEN_INTERVAL=0removes the module option. The rebuilt modules load with the same6.12.1-msm8916 SMP preempt mod_unload ARMv7 p2v8vermagic as the package modules, and the defensive BMS conversion is present in the disassembly. The rebuilt image's initramfs and rootfs both contain the newpm8916_bms_vm.ko.zst/wcn36xx.ko.zst(SHA-256 match), andboot.imgstill carries the byte-identical known-good zImage + DTB. - The live phone's
/boot/boot.imgwas deliberately left untouched: the boot-time0xfffftransient only disappears after a reflash with the rebuilt image. Reloadingpm8916_bms_vmat runtime from/lib/modulesconfirms the new module reports sane voltage andhealth=Good.
16. Network-up NTP synchronisation (U6 follow-up)
16.1 Symptom and measurement
U6 set pool pool.ntp.org minpoll 12 maxpoll 16 and removed iburst to avoid
the startup packet burst. A later live check on the connected Nokia 8110 4G
found the clock at Mon Jan 12 12:09:59 UTC 1970 with Wi-Fi connected to
OffOurStreets_, USB RNDIS up, DNS working (getent hosts pool.ntp.org
returned 3 addresses) and chronyd reported started by OpenRC:
| Probe | Result |
|---|---|
chronyd processes |
2, -f /etc/chrony/chrony.conf -F 1 |
| NTP/chrony UDP sockets | none (no source had an address) |
chronyc activity over the root Unix socket |
4 sources online, 4 sources with unknown address |
chronyc tracking |
Reference ID : 00000000 (), ref time 1970 |
/var/lib/chrony |
root:root 0750, empty; chronyd logged Could not open /var/lib/chrony/chrony.drift.tmp : Permission denied |
chronyd -Q -t 30 ... iburst |
clock wrong by 1793085783 s, measured in 5 s |
chronyd -d -x -t 25 -F 1 with shipped config |
no source activity for the whole 25 s |
Three independent causes combined:
- DNS is not ready when chronyd starts. OpenRC's
need netis satisfied by NetworkManagerprovide netas soon as the service starts, not when a connection has a workingresolv.conf. chronyd resolves pool names once at startup and does not retry; the four sources stay atunknown address. - No
iburstandminpoll 12. Even with DNS working, the first poll is scheduled up to 4096 s after startup. Restarting chronyd with the network already up produced no NTP socket and no clock change within 15 s; addingiburstproduced four reachable sources at poll 12 within 6 s. cmdport 0was assumed to disable chronyc entirely. It only closes the UDP command port. chronyd 4.9 keeps a root/chrony-only Unix socket at/run/chrony/chronyd.sock;chronycdefaults to that socket first, so privileged commands (refresh,burst,online) work without any key or network exposure.chronyc -h 127.0.0.1 refreshreturns501 Not authorised, whilechronyc -h /run/chrony/chronyd.sock refreshreturns200 OK.
A Wi-Fi disconnect/reconnect confirmed NetworkManager dispatcher scripts do
run even though the networkmanager-dispatcher OpenRC service is stopped:
D-Bus activates org.freedesktop.nm_dispatcher. Events observed:
connectivity-change, dns-change, down, dns-change, dhcp4-change,
up, connectivity-change.
16.2 Fix
etc/chrony/chrony.confrestoresiburstand keepsminpoll 12 maxpoll 16,rtcsync,cmdport 0andmakestep 1 -1. The startup burst is 4 sources x a few packets once per boot, negligible next to 4096 s of a wrong clock.usr/bin/bananarchy-time-sync.sh(root,doas -nre-exec) waits for the chronyd Unix socket, callschronyc refreshuntilactivityreports0 sources with unknown address, thenonlineandburst 2/4. It only writes its throttle stamp once the pool resolves, so a later network event can retry. Throttling uses/proc/uptime(monotonic): 15 s between attempts while unsynchronised, 300 s between source refreshes once synchronised, and a non-blockingflockserialises the several dispatcher events that fire for one connection.statusandforceare available from the CLI.etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.shhandlesup,dhcp4-change,dhcp6-change,dns-change,connectivity-changeandvpn-up.etc/init.d/bananarchy-time-sync(need chronyd net,after networkmanager) covers the boot race where dispatcher events fire before chronyd is ready; both are backgrounded so they never block NM or OpenRC./var/lib/chronyis chowned to thechronyuid/gid in bothrebuild-image.shandapply-bananarchy-overlay.sh, so the driftfile is written and the frequency estimate survives reboots.scripts/check-rebuild.shguards the four new files, theiburst/cmdport 0pair, the runlevel hook and both ownership fixes.
16.3 Verification
On the live phone, chronyc refresh followed by chronyc burst 2/4 over
/run/chrony/chronyd.sock resolved all four pool sources and stepped the
clock from 1970-01-12 to Sat Nov 7 19:40:25 UTC 2026 within seconds;
chronyc tracking then showed Reference ID : 53A84595 (hosted-by.SkillHost.PL) and System time : 0.000000000 seconds fast of NTP time. No UDP chronyc port was opened. The steady-state poll interval remains
minpoll 12 maxpoll 16, so U6's battery saving is preserved; the only extra
traffic is one short burst at boot and on each network transition.
16.4 Reflashed boot: why autosync still took 80 s
The image was reflashed and the boot was measured from /proc/uptime,
NetworkManager's timestamps file, OpenRC's /run/openrc/started symlinks,
chronyc sources and the helper's /run/bananarchy-time-sync/last stamp.
The RTC held 1970-01-12 12:39:26 UTC (epoch 995966), so all boot file
timestamps are on that fake date and map to uptime by subtracting 995966:
| Uptime | Event |
|---|---|
| 0 s | kernel sets the clock from rtc-pm8xxx to 1970-01-12 12:39:26 UTC |
| ~27 s | NetworkManager, chronyd, bananarchy-time-sync started; chronyd resolves the pool before DNS exists, so all 8 sources stay unknown address |
| ~30 s | dnsmasq, wlan0 DHCP lease, resolv.conf; Wi-Fi OffOurStreets_ activated (NM timestamp 995997) |
| ~112 s | USB RNDIS (usb0) activated (NM timestamp 996078); helper stamp 112; first NTP samples; clock stepped to 2026-11-07 20:04:23 UTC |
So chronyd did autostart, but at boot rather than on Wi-Fi: OpenRC need net
is satisfied by NetworkManager provide net as soon as the daemon starts.
chronyd resolves pool.ntp.org once, at ~27 s, before dnsmasq is up; with
minpoll 12 an unresolved pool produces no packets for up to 4096 s. The
network-up hook is meant to fix that, but none of the Wi-Fi dispatcher events
(up, dns-change, dhcp4-change) at ~30 s produced a burst: the boot
helper either held /run/bananarchy-time-sync/lock for its whole 60 s
refresh retry loop (so flock -n 9 dropped them) or had already written its
15 s throttle stamp after resolved() mistook a zero-source activity report
for a resolved pool. The next event was usb0 up at ~112 s, which finally ran
the helper and synced the clock. A controlled reproduction
with nameserver 127.0.0.9 showed chronyd does not re-resolve on its own
(8 unknown sources for 10 s after DNS was restored) while chronyc refresh
resolves them within ~4 s.
Fixes, without changing the long steady-state poll interval:
wait_chronyd()andwait_sources()now run before the lock is taken; only the stamp /online/burstsection is serialised, withflock -w 5. A slow boot retry can no longer swallow network-up events.resolved()requires at least one known source (online, offline or doing a burst) in addition to0 sources with unknown address, so a chronyd that has not created any pool sources yet cannot cause a no-op burst.network-up/force/syncget 8 retries (16 s) instead of 3 (6 s).bananarchy-time-sync.sh syncwaits up to 15 s forchronyc trackingto show a reference ID and printsNetwork time synced: <UTC date>or a clear failure. Config -> Sync net time calls it viabananarchy-sync-net-time.shand shows a desktop notification, so the user can always force a sync without a shell.
17. Battery longevity re-analysis (post-85c6a7b live measurement)
A fresh 60 s idle window was measured on 2026-11-08 at ~10.3 h uptime with the
panel dark (brightness=0, bl_power=4), Wi-Fi connected to
OffOurStreets_, USB RNDIS up, and both SIM applications ready. The phone
was charging at 540000 uA with no current_now and no coulomb counter, so
all results below are wakeup/IRQ/context-switch counts, not discharge mA.
capacity was 44%, health=Good, voltage_now=4054397 uV and
voltage_ocv returned No data available.
17.1 Measurement caveat: modem registration anomaly
msm-modem-uim-selection status reported
NAS_REG_STATE=not-registered-searching, SEC_NAS_REG_STATE=not-registered,
mmcli -L returned No modems were found, and the slot mapping was
PRIMARY_GW_SLOT=2 / SECONDARY_GW_SLOT=1 (swapped relative to the earlier
verified 1 / 2 state). AT+COPS? returned +COPS: 0 with no operator.
This is a separate functional issue; no PIN verification was attempted. A
searching modem can draw more RF current than a registered idle modem, so the
radio-related conclusions below are conservative and need a battery-powered
A/B run once registration is restored.
17.2 Baseline: the application processor is already near its floor
60 s, screen off, Wi-Fi up, both SIM applications ready:
| Source | Rate |
|---|---|
arch_timer |
15.01/s |
arch_mem_timer |
11.64/s |
mmc0 |
0.56/s |
smd-edge |
0.52/s |
wcn36xx_rx |
0.34/s |
wcn36xx_tx |
0.11/s |
pm8916_vm_bms |
0.02/s |
| CPU idle | 97.93% overall, 99.48% cpu0, 96.37% cpu1 |
cpu-sleep-0 entries |
12.47/s cpu0, 7.54/s cpu1 |
| WFI entries | 0.97/s cpu0, 1.05/s cpu1 |
Top context-switch deltas were kernel threads (rcu_preempt 5.35/s,
kcompactd0 1.97/s, four kworker threads 1.11/1.10/0.50/0.47/s), then
NetworkManager 0.37/s, wpa_supplicant 0.26/s, nmcli device monitor
0.11/s, dbus-daemon 0.11/s, udevd 0.06/s and init 0.06/s. All 26
preloaded dwm-plugin daemons and Xorg were absent from the top 30, which
confirms the zero-lag resident-plugin model is not the remaining drain.
Runtime PM was already effective: 1c00000.gpu, both SDHCI hosts, SPI, DMA
controllers, IOMMU and the modem bam-dmux were suspended; genpd mx,
mx_ao, cx and all GDSCs were off, with only cx_ao on. GPU devfreq was
simple_ondemand at 409.6 MHz with a 100 ms poll. 21 clocks remained enabled,
including bimc_ddr_clk_src, gcc_mss_q6_bimc_axi_clk, USB HS clocks and the
serial-console gcc_blsp1_uart1_apps_clk. Regulators with users were the dummy
regulator, s2, l5, l7, l8 and l13.
/sys/power/state was still 0 bytes, /proc/device-tree/psci absent,
cpuidle driver qcom_spm with WFI + cpu-sleep-0, CONFIG_SUSPEND off,
CONFIG_NO_HZ_IDLE=y, CONFIG_HZ=300, CONFIG_PREEMPT=y,
CONFIG_PERF_EVENTS=y, CONFIG_FUNCTION_GRAPH_TRACER=y,
CONFIG_ENERGY_MODEL off and CONFIG_CPU_IDLE_GOV_MENU=y. The ABI-breaking
config list from section 14 still applies; a full pmaports module tree rebuild
remains declined.
17.3 Two low-risk wins found and implemented
-
The active zram swap used
zstd, not the shippedlz4setting.postmarketos-zram-swapcalls/usr/bin/zramstart, which sources/usr/share/misc/source_deviceinfoand defaultsdeviceinfo_zram_swap_algotozstd; it ignores/etc/conf.d/zram-init. Live/sys/block/zram0/comp_algorithmshowed[zstd]. All fivedevices/*/deviceinfo*files now setdeviceinfo_zram_swap_algo="lz4", and thezram-initconfig carries a compatibility note. This restores the intended U12/K13 CPU saving without changing the kernel or module ABI. -
Proactive compaction kept
kcompactd0awake. The defaultvm.compaction_proactiveness=20produced 1.97 context switches/s fromkcompactd0. A controlled 60 s A/B withvm.compaction_proactiveness=0reduced that to 0.02/s and raised measured CPU idle from 97.93% to 99.22%; combined timer IRQs fell from 26.65/s to 17.39/s. The A/B window also showed a 3.42/sci_hdrc_msmUSB IRQ from SSH/charger activity, so this is a wakeup saving, not a measured mA saving.vm.compaction_proactiveness=0is now set inetc/sysctl.d/99-bananarchy-power.confandetc/local.d/10-power-save.start.
17.4 DSDS eco A/B was inconclusive without discharge current
With DSDS_SECONDARY_MODE=eco and DSDS_PARK_DELAY=2, the secondary GW
session parked cleanly (secondary_parked=yes, SECONDARY_GW_SLOT=0) and
restored on wake. The 60 s IRQ rates did not improve versus baseline
(mmc0 1.24/s, wcn36xx_rx 0.74/s, smd-edge 0.61/s), likely because the
modem was already searching and the measurement included policy/config file
writes. Eco mode remains an opt-in trade (SIM2 unreachable while parked); its
RF saving can only be quantified on battery power with a registered modem.
17.5 Remaining opportunities, in priority order
- Restore modem registration and the primary/secondary slot mapping. This is a functional prerequisite for any radio-power A/B measurement.
- Battery-powered A/B for
WIFI_LISTEN_INTERVAL=10,MODEM_DRX_MODE=6-9andDSDS_SECONDARY_MODE=eco. All three are already configurable via/etc/bananarchy-power-policy.conf; defaults stay conservative because higher DRX modes and longer listen intervals delay inbound data, andAT$QCDRX=9previously made the AT channel briefly unresponsive. - Replace
nmcli device monitorwith NetworkManager dispatcher hooks. It accounts for 0.11 context switches/s and duplicates the dispatcher path already used for DPM and time sync. commit=60on the rootfs mount. Could cut a fraction of the 0.56/smmc0IRQs, but risks data loss on sudden power cut; deliberately not shipped.- Remove
earlycon console=ttyMSM0from the cmdline. Cmdline-only and ABI-safe, would gate the 3.686 MHz UART clock, but removes the serial debug lifeline; deliberately kept. - PSCI
SYSTEM_SUSPENDin lk2nd. Still the only path to DDR self-refresh andmemsuspend. Until thenbimc_ddr_clk_srcstays enabled and no kernel config change can fix it. - AP-side Wi-Fi DTIM tuning. Not controllable from the phone.
The AP and userspace are already close to their idle floor. Further 24 h battery life has to come from modem/Wi-Fi RF policy, DDR self-refresh, or a battery-powered measurement campaign; another kernel config trim or full module tree rebuild is not justified.
18. No-tradeoff idle headroom: A/B sweep and event-driven process cleanup
This section answers a narrower question than section 17: what can still be
saved at idle without delaying UI wakeup, calls/SMS, Wi-Fi, or network
state changes? All measurements below were 45-60 s screen-off windows on the
same USB-charged phone, so they are wakeup/IRQ/context-switch counts rather
than discharge mA. vm.compaction_proactiveness=0 from section 17 stayed
active throughout.
18.1 Kernel/VFS candidates that were measured and rejected
| Candidate | Baseline | Candidate result | Decision |
|---|---|---|---|
vm.stat_interval=120 (from 30) |
96.85% CPU idle, 30.07 timer IRQs/s | 96.10% idle, 36.38 timer IRQs/s, mmc0 0.89/s |
Rejected; worse or noise |
vm.vfs_cache_pressure=50 (from 150) |
96.85% idle | 94.34% idle, 47.38 timer IRQs/s | Rejected |
vm.swappiness=100 (from 180) |
96.85% idle, mmc0 0.21/s |
96.47% idle, mmc0 1.69/s |
Rejected |
kernel.sched_autogroup_enabled=0 |
96.85% idle | 95.46% idle, 37.50 timer IRQs/s | Rejected |
noatime rootfs remount |
first run 96.85% -> 97.38% idle | confirmation run 97.49% -> 95.90% idle | Rejected; contradictory A/B |
kernel.timer_migration was already 1. vm.page-cluster=0,
vm.dirty_writeback_centisecs=6000, vm.dirty_expire_centisecs=6000,
kernel.nmi_watchdog=0, workqueue.power_efficient=Y and the SPI/GPU/CPU
runtime-PM settings from earlier sections were already active. Raising the
dirty writeback interval or adding commit= would risk data loss on a sudden
power cut, so neither was shipped. All rejected sysctls and relatime were
restored on the live phone.
18.2 Process management: remove the nmcli device monitor poller
sxmo_networkmonitor.sh kept a long-lived nmcli device monitor plus two
shell wrappers alive to translate NetworkManager device states into Sxmo
network hooks and status bar updates. It accounted for roughly 0.08-0.13
context switches/s and duplicated the dispatcher path already used for DPM
and time sync.
It is replaced by:
etc/NetworkManager/dispatcher.d/30-bananarchy-network-status.sh, which reacts toup,down,pre-up,pre-down, VPN equivalents, and connectivity/DHCP/DNS changes, then double-forks so NetworkManager never waits for shell hooks.usr/bin/bananarchy-network-event.sh, re-executed as the X session user viasu, which resolves the device type and calls the samesxmo_hook_network_{up,down,pre_up,pre_down}.shandsxmo_hook_statusbar.sh networkhooks. Running as the user keepssxmo_statusfiles, the root status name and the status bar cache user-owned.- Both
sxmo_hook_start.shcopies now runsuperctl disable sxmo_networkmonitorinstead of starting the poller;scripts/check-rebuild.shguards this.
This does not stop NetworkManager, wpa_supplicant, dnsmasq, ModemManager,
rmtfs, q6voiced, the DSDS helper, chronyd, dunst, or any preloaded DWM plugin.
Incoming network events still wake the same hooks immediately; only the idle
poller and its two shell wrappers disappear. Live verification after a Wi-Fi
disconnect/reconnect logged 09:22:55 up wlan0 wifi from a temporary user
sxmo_hook_network_up.sh, with wlan0 back on OffOurStreets_,
sxmo_networkmonitor stopped, network_monitor_device gone and no
nmcli device monitor process. A 60 s screen-off window after the change
measured 97.78% CPU idle with no nmcli device monitor in the top context
switchers (it had been ~0.08-0.13/s before).
18.3 Still available, but deliberately not shipped
- Longer
statusbar_periodicsinterval: 300 s could become 600 s because dmenu and unlock now refresh the clock, but an on-screen idle clock could then be up to 10 minutes stale. Not shipped. - Longer
dsds-daemon/sxmo_modemmonitor.sh/ Wi-Fi scan intervals: these would delay modem or roaming state changes. Not shipped. - Consolidating
sxmo_soundmonitor.sh/sxmo_modemmonitor.shshell pipelines: possible, but they are event-driven (evtest,pactl subscribe,dbus-monitor) and rewriting them risks audio/call routing regressions for sub-0.1/s savings. Not shipped. - Wi-Fi listen interval >5,
MODEM_DRX_MODE=6-9,DSDS_SECONDARY_MODE=eco: these trade inbound latency or SIM2 reachability for RF saving, so they stay opt-in via/etc/bananarchy-power-policy.conf. - Serial console removal,
commit=60, ABI-breaking kernel configs, full module tree rebuild: rejected for the reasons in sections 14-17.
18.4 Verdict
After sections 17 and 18, the remaining no-tradeoff AP/userspace headroom is
very small: the kernel is already ~98-99% idle, the 26 preloaded plugins and
Xorg are asleep when dark, runtime PM has collapsed the GPU/SDHCI/SPI/DMA
domains, and the remaining periodic work is either event-driven or spaced
300-1800 s apart. Further meaningful 24 h gains still require radio firmware
policy, DDR self-refresh via lk2nd PSCI SYSTEM_SUSPEND, or a real
battery-powered discharge measurement; they cannot come from more idle
timer/sysctl trimming without hurting latency or connectivity.
19. Dual-target idle audit for upcoming build a1114 / carbonara (nokia-argon and nokia-beatles)
After the Nokia 2720 Flip (nokia-beatles) lid/cover stack, Bluetooth HOGP/OBEX
gamepad bridge, and minute-fresh dark statusbar clock landed in a1108--a1111,
a fresh cross-target battery audit inspected every daemon, hook, DTB, kernel
module, and sysfs power knob across both active devices for upcoming build
a1114 (codename carbonara).
19.1 Verified parity and clean subsystems
- DTB and boot image parity:
qcom-msm8905-nokia-beatles.dtsalready matchesqcom-msm8905-nokia-argon.dtsoncpu-opp-tableclock-latency-ns(100000ns),spccpu-idle-states, peripheralsleeppinctrl states,wakeup-sourcegpio-keys, and identicalvmlinuzplus patchedpm8916_bms_vm,pm8916_lbc, andwcn36xxkernel modules. - Target isolation:
apply-bananarchy-overlay.shwritesslidervsflipto/usr/share/bananarchy/lid-profileand disables all flip services, udev rules, and mux modules onnokia-argon. - Desktop and drivers:
dwm,dmenu, preloadeddwmplugins,dsds-daemon, PipeWire/WirePlumber,sshd-debug,unudhcpd,msm8905-cam, andleds-msm8905-torchall rest at0wakeups/s when dark.
19.2 Six zero-regression optimizations implemented
- Event-driven steady state in
bananarchy-lid(nokia-beatles):bananarchy-lid.cpreviously ranpoll(..., 20)(50 Hz= 3,000 wakeups/min), read/sys/kernel/debug/gpioto EOF at10 Hz(600 full SoC GPIO register dumps/min), and every2 sglobbed/dev/input/event*, rewrote/run/bananarchy/lid-state, ransync_sw_lid(), and sentCLOSED/OPENto/run/bananarchy/cover.sock(wakingbananarchy-cover-idleevery 2 s). Becausehall-lid-open(gpio36) andhall-lid-closed(gpio92) are hardware-IRQgpio-keyswithwakeup-source,bananarchy-lidnow watches/dev/inputviainotify, retains the20 ms(LID_LOOP_MS/LID_DEBOUNCE_MS/HALL_EDGE_MS) settle window onEV_SWedges plus one+2 spost-transition confirmation broadcast, and then blocks inpoll(..., -1)at0steady-state wakeups/s. Flip-open and flip-close transitions also synchronize CPUscaling_governor,schedutil/rate_limit_us(40000), and Adreno 304governordirectly in C. - Event-driven
bananarchy-volume-keys(nokia-beatles):bananarchy-volume-keys.creplaced its1,000 mspoll()loop and2,000 ms/dev/input/event*glob()with aninotifywatch on/dev/inputpluspoll(..., -1), eliminating ~90 wakeups/min while keepingBANANARCHY_INPUT_GLOBFIFO polling for host tests. - Adreno 304
devfreqpowersavepermissions andschedutilrate_limit_usrestoration (both targets):10-power-save.startpreviously grantedvideo-group write permissions (0664) to CPUscaling_governoronly, sosxmo_wm.sh's[ -w /sys/class/devfreq/1c00000.gpu/governor ]check failed silently and left the GPU insimple_ondemandwhile dark.10-power-save.startnow applieschgrp videoandchmod 0664to1c00000.gpu/governor,locker_plugin.cpptoggles1c00000.gpu/governoron lockscreen idle-blank and wake, andbananarchy-display-power-syncsynchronizes1c00000.gpu/governorand restoresschedutil/rate_limit_us = 40000on both forced (FORCE=1) and normal (FORCE=0) transitions. - Lightweight per-minute clock maintenance (both targets):
sxmo_hook_statusbar.shskips sourcing the 257-linesxmo_hook_icons.shtable ontimeticks and updates099-timedirectly in-shell when thesxmo_statusruntime directory already exists (avoiding spawningsxmo_status.shand twomkdir -pcalls every minute while dark), andsxmo_status.shguardsmkdir -p "$ROOT"with[ -d "$ROOT" ]. - Avoid redundant ext4 eMMC write and no-op
sxmo_autosuspend.shfork on blanking (both targets):sxmo_wm.sh display offnow writes~/.config/sxmo/brightnesson ext4 only when brightness actually changed (avoiding dirty-page eMMC writeback wakeups 60 s after blanking), andsxmo_hook_screenoff.shskips spawningsxmo_autosuspend.shwhen/etc/bananarchy-no-deep-standbyis present. - Event-driven
bananarchy-bt-obexwhen Bluetooth is enabled (both targets): replaced the1.0 sD-Bus/RFCOMM poll timeout and the1.5--2.0 s/dev/inputgamepad polling loop with a signal self-pipe,ctypesinotifyon/dev/input, and blockingselect.select(..., None), dropping Bluetooth daemon idle wakeups from ~100/min to0/min and reducing gamepad hotplug latency from2 sto<5 ms.
20. Hardware, kernel, and firmware deep-standby fixes after the 4-hour DSDS + Wi-Fi standby test (a1114 / carbonara)
20.1 Real-world discharge measurement and root-cause decomposition
On-battery standby testing on a1114 (carbonara) with the screen off, DSDS
active, and Wi-Fi connected measured 20% battery drain over 4 hours
(5.0%/h, or ~75 mA continuous average on the 1,500 mAh battery). Because
section 19 had already reduced userspace idle wakeups to near zero and CPU cores
were spending ~98% of uptime in standalone power collapse (SPC), auditing the
6.12.1-msm8916 kernel source, .config, DTBs, and radio policy uncovered five
hardware/firmware power floors keeping SoC buses, clocks, RF receivers, and the
display controller active continuously without CONFIG_SUSPEND:
- RPM bus clocks (
BIMC,PCNOC,SNOC) pinned atINT_MAX(~533 MHz DDR / ~133 MHz NoC):# CONFIG_INTERCONNECT_QCOM_MSM8909 is not setand all six MSM8905/MSM8909 DTS files lackedinterconnect@400000(bimc),interconnect@500000(pcnoc), andinterconnect@580000(snoc) nodes. Without an interconnect provider reachingicc_sync_state,clk-smd-rpm.c'sclk_smd_rpm_handoff()votedINT_MAXin bothQCOM_SMD_RPM_ACTIVE_STATEandQCOM_SMD_RPM_SLEEP_STATEat boot and never released it (~22--30 mA). In addition,qnoc_probe()indrivers/interconnect/qcom/icc-rpm.czero-initializedqp->bus_clk_rate[], sosleep_rate == 0matched the cached0and skipped sending a0sleep-set vote to RPM. - WCN3620 Wi-Fi firmware lacking screen-off ARP/NS/GTK/DTIM offloads and
conf.listen_intervalmismatch:wcn36xx/main.conly enabledwcn36xx_smd_arp_offload(),wcn36xx_smd_ipv6_ns_offload(),wcn36xx_smd_gtk_offload(), andwcn36xx_smd_set_power_params(ignore_dtim=true)insidewcn36xx_suspend(), which never runs withCONFIG_SUSPEND=n. In addition,0007sethw->max_listen_intervalwithout settinghw->conf.listen_interval, leavingconf.listen_intervalat1(~12--18 mA). - ChipIdea USB controller (
ci_hdrc_msmat78d9000.usb) missing runtime PM:ci_hdrc_msm.chad noRUNTIME_PM_OPSand omittedCI_HDRC_SUPPORTS_RUNTIME_PM, leavingusb_hs_ahb_clk(100 MHz) andusb_hs_system_clk(80 MHz) ungated whenever unplugged on battery (~4--6 mA). - DSDS modem paging at default short DRX (
MODEM_DRX_MODE=0) and single-portAT$QCDRXapplication:bananarchy-power-policy.confshippedMODEM_DRX_MODE=0,msm-modem-uim-selection at autoexited after the first/dev/wwan0at*port without configuring the second DSDS AT channel, anddsds-daemonchecked only/tmp/bananarchy_screen_lockedrather than raw backlight state (~10--15 mA). - GC9305 / ST7789V SPI panel controller left in active 60 Hz GRAM scan during
DPMS off:
drivers/gpu/drm/tiny/panel-mipi-dbi.comitted a.disablecallback onpanel_mipi_dbi_pipe_funcs, soxset dpms force offturned off the PWM backlight without issuingMIPI_DCS_SET_DISPLAY_OFF(0x28) andMIPI_DCS_ENTER_SLEEP_MODE(0x10) before disablingvdd/io(~3--6 mA on boards with always-on or shared panel rails).
20.2 Five hardware, kernel, and firmware fixes implemented (0008)
- MSM8909 RPM interconnect scaling (
CONFIG_INTERCONNECT_QCOM_MSM8909=y): enabledCONFIG_INTERCONNECT_QCOM=y,CONFIG_INTERCONNECT_QCOM_MSM8909=y, andCONFIG_INTERCONNECT_QCOM_SMD_RPM=y(built-in, preserving modulevermagicacross all 580.ko.zstmodules), added.keep_alive = trueonmsm8909_bimc,msm8909_pcnoc, andmsm8909_snoc(19.2 MHzactive floor,0inSLEEP_STATE), initializedqp->bus_clk_rate[*]toU32_MAXinqnoc_probe()soicc_sync_stateclears theINT_MAXsleep handoff vote in RPM, and wiredbimc/pcnoc/snocpluscpusinterconnectsandcpu-opp-tableopp-peak-kBpsacross all six MSM8905/MSM8909 DTS files. - Live WCN3620 screen-off firmware offloads without freezing host RX:
wcn36xxnow initializes bothhw->max_listen_intervalandhw->conf.listen_intervalfromlisten_interval(clamped1..10, default5) beforeieee80211_register_hw(), and exposes/sys/module/wcn36xx/parameters/screen_off_offload(toggled bybananarchy-display-power-sync). When1,wcn36xxprograms hardware ARP offload (when a single IPv4 address is assigned, preserving DHCP), IPv6 NS offload, GTK rekey offload,ignore_dtim = true, anddynamic_ps_timeout = 40 mswhile keepingrx_irq/tx_irqenabled and never sendingwlan_host_suspend_ind, so inbound SSH/TCP/IM unicast packets still wake the host immediately. - ChipIdea USB runtime PM while unplugged:
ci_hdrc_msm.cenablesCI_HDRC_SUPPORTS_RUNTIME_PM, wrapsci_hdrc_msm_por_reset()inpm_runtime_resume_and_get()/pm_runtime_put(), gatesiface_clkandcore_clkinRUNTIME_PM_OPSwhenvbus_extconis unplugged, and skipsci_ulpi_resume()'sULPI_SYNC_STATEviewport poll whenCI_HDRC_OVERRIDE_PHY_CONTROLis set so cable hotplug resumes cleanly beforeCI_HDRC_CONTROLLER_RESET_EVENTpowers the ULPI PHY. - Default dual-port
MODEM_DRX_MODE=6and dark-screendsds-daemonsleep:bananarchy-power-policy.confdefaults toMODEM_DRX_MODE=6while keepingDSDS_SECONDARY_MODE=activeso both SIMs stay reachable;msm-modem-uim-selectionaddsat allmulti-port support andscreen_is_idle()indsds-daemon(poll_timeout = Nonewhenever locked, cover-lit, or backlight off); andbananarchy-power-policy.shserializes AT port access withflock, waits pastModemManager's startup port probe at boot, and re-appliesAT$QCDRX=6across all/dev/wwan0at*ports onmodem-ready(sxmo_hook_modem.shregistered/connectedand post-PIN/switch registration) with per-port devtmpfs inode caching in/run/bananarchy-power-policy/drx.<port>. - MIPI DCS
DISPOFF+SLPINonpanel-mipi-dbiDPMS off:panel_mipi_dbi_disable()sends0x28(msleep(20)) and0x10(msleep(50)) underdrm_dev_enter()afterbacklight_disable(), halting the panel boost converter and 60 Hz GRAM scan while leaving the 2720 Flipbackend = kernelcover path (DPMS Onduring closed cover wake) intact.
20.3 Post-test fix: unconditional BAM-DMUX wwan0 registration for ModemManager and QMI VOICE USSD fallback
Live testing on a Nokia 2720 Flip (nokia-beatles) running on Wi-Fi without an
existing type=gsm NetworkManager connection profile surfaced error: couldn't find modem when sending USSD queries on SIM 1:
- Root cause:
MMPluginQcomSoc(libmm-plugin-qcom-soc.so) setsbase-modem-data-net-supported = TRUEandbase-modem-data-tty-supported = FALSE, soModemManagerrefuses to export/org/freedesktop/ModemManager1/Modem/0("Failed to find a data port in the modem") unlessbam-dmuxhas registerednet/wwan0.bam-dmuxonly createsnet/wwan0after MPSS sendsBAM_DMUX_CMD_OPENin response toqmicli --dpm-open-port=hw-data-ep-type=bam-dmux,.... Gating--dpm-open-portontype=gsm.nmconnectionfiles (U9/K11) brokeModemManagerdiscovery on Wi-Fi-only setups (the same"No modems were found"symptom noted in section 14.1). Meanwhile, inspectingdrivers/net/ethernet/qualcomm/bam-dmux.cconfirmed thatbam-dmuxalready usesBAM_DMUX_AUTOSUSPEND_DELAY = 1000ms runtime PM autosuspend, droppingbam_dmux_pc_vote(dmux, false)(pc_state=0) and releasing TX/RX BAM DMA channels after 1 s of inactivity — so keeping the DPM port open at boot adds zero idle power draw. - Fix:
etc/init.d/msm8909-modem-wwan-port(andprovision_slot()/bananarchy-dpm.sh open) now opens the BAM-DMUX QMI DPM port unconditionally beforeModemManagerstarts and waits for/sys/class/net/wwan0(triggeringmmcli -Sifwwan0is opened late whileModemManagerhas no modem), and10-bananarchy-dpm.shno longer closes the DPM port on NetworkManagerdownevents. In addition,msm-modem-uim-selection ussdresolvesmm_modemviammcli -Linstead ofmmcli -m anyand falls back to direct QMI VOICE USSD overAF_QIPCRTR(QMI_SERVICE_VOICE = 9,sub = 0) for the primary SIM just likesub = 1on the secondary SIM, preserving interactive multi-step/tmp/sxmo_ussd_session_statesessions even ifModemManageris unavailable.
21. Deep-standby SoC rail, RPM handoff, USB HS PHY, WCN3620 BET/host-suspend, and MIPI DBI reset fixes (0009)
Live benchmarking after 0008 improved screen-off DSDS + Wi-Fi standby from
-20% / 4h to -40% / 8h (5.0%/h), still well above stock KaiOS because five
kernel/build gaps kept SoC rails, RPM sleep votes, USB PHY regulators, WCN3620
beacon wakeups, and stale drm_mipi_dbi.ko active:
21.1 Five remaining standby root causes found after 0008
fw_devlinksync_statedeadlock on driverless/cpus/cpu@0..3+ 100 MHz BIMC floor (~30-50 mA):CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUTwas unset inpatches/kernel/config-bananarchy-msm8909.armv7. Because/cpus/cpu@0..3carryqcom,msm8909-bimcinterconnect suppliers andcpufreq-dtdoes not bind CPU platform devices viafw_devlink,fw_devlink_probing_done()never completed. Consequently,rpmpd_sync_state()never fired (leavingVDD_CXandVDD_MXpinned atSUPER_TURBOfrom boot), andicc_sync_state()(qnoc_sync_state) never cleared RPM'sINT_MAXbus floor. In addition, the 200 MHz idle CPU OPP (opp-199999951) requestedopp-peak-kBps = <0xc3500>(800,000kBps =100 MHzBIMC) instead of<0x25800>(153,600kBps =19.2 MHzXO floor).- Unclaimed
clk-smd-rpmactive and sleep-set handoff votes (~10-20 mA):rpm_smd_clk_probe()(drivers/clk/qcom/clk-smd-rpm.c) wroteINT_MAXboot-handoff rates to bothQCOM_SMD_RPM_ACTIVE_STATEandQCOM_SMD_RPM_SLEEP_STATE. Unclaimed clocks such asqdss_clk/qdss_a_clkandqpic_clk/qpic_a_clkkeptACTIVE_STATEvotes alive indefinitely, and all unclaimed RPM clocks keptSLEEP_STATEhandoff votes (INT_MAXor1) preventing RPM sleep-set collapse. - Unplugged ChipIdea USB HS PHY staying powered (
~5-10 mA):ci_hdrc_msm_probe()lackedpm_runtime_set_autosuspend_delay/pm_runtime_use_autosuspendand never shut down the ULPIphy-qcom-usb-hson runtime suspend when unplugged (vbus_extcondisconnected), leavingpm8909_l13(3.075 V),pm8909_l7(1.8 V),xo, and PHY clocks on. Meanwhileci_hdrc_probe()did not enable runtime autosuspend on the childci_hdrcdevice whenCI_HDRC_SUPPORTS_RUNTIME_PMwas set. - Incomplete
wcn36xxscreen-off offload (~10-15 mA):0008enabled ARP/NS/GTK offload andignore_dtim, but left Beacon Early Termination disabled (enable_bet = 0,bet_interval = 0), leftdtim_periodunaligned withlisten_interval, left broadcast/multicast firmware filtering disabled (bcast_mcast_filter = 0), and never sentWCN36XX_HAL_HOST_SUSPEND_INDwhen entering screen-off offload orHOST_RESUME_REQon screen wake. - Unpatched
drm_mipi_dbi.koshipped from May 30 (panel-mipi-dbisync gap):scripts/build-kernel-audio.sh,rebuild-image.sh, andscripts/apply-bananarchy-overlay.shexportedpanel-mipi-dbi.ko.zstandmsm.ko.zst, but never rebuilt or packageddrivers/gpu/drm/drm_mipi_dbi.ko(CONFIG_DRM_MIPI_DBI=m).
21.2 Five deep-standby fixes implemented (0009)
- Unblock
rpmpd_sync_state()+icc_sync_state()and drop idle BIMC floor to19.2 MHz: enabledCONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=yinpatches/kernel/config-bananarchy-msm8909.armv7, added thedrivers/base/core.cfw_devlink_sync_state_timeoutrelaxation after init (10 stimeout guarantee), and loweredopp-199999951opp-peak-kBpsfrom<0xc3500>to<0x25800>(153,600 kBps) across all six MSM8905/MSM8909 DTS files. - Release unclaimed
clk-smd-rpmactive (QDSS/QPIC) and sleep-set handoff votes:0009addslate_initcall_sync(rpm_smd_clk_late_cleanup)indrivers/clk/qcom/clk-smd-rpm.cto drop active votes on unclaimedQDSSandQPICRPM clocks and clearQCOM_SMD_RPM_SLEEP_STATEhandoff votes on all unclaimed RPM clocks (PCNOC,SNOC,BIMC,IPA,QPIC,QDSS,BB_CLK1,RF_CLK1,DIFF_CLK1,DIV_CLK1) without touchingACTIVE_STATEon modem-criticalBB_CLK1orRF_CLK1. - Shut down
phy-qcom-usb-hsand autosuspendci_hdrcwhile unplugged:0009updatesci_hdrc_msm.candcore.cto hold parent runtime PM acrossci_hdrc_add_device(), configure a200 msautosuspend delay on both parent and childci_hdrcdevices, callusb_phy_shutdown()on runtime suspend whenvbus_extconis disconnected (and re-initialize on resume/connect), and end probe withpm_runtime_put_autosuspend(). - Enable WCN3620 BET,
dtim_periodsync, multicast filter, andHOST_SUSPEND_IND/HOST_RESUME_REQinscreen_off_offload:wcn36xx/{wcn36xx.h,smd.c,main.c}now programenable_bet = 1,bet_interval = listen_interval,dtim_period = listen_interval,bcast_mcast_filter = 3, and sendwcn36xx_smd_wlan_host_suspend_ind()/HOST_RESUME_REQon screen-off / screen-on transitions while keeping hostrx_irq/tx_irqarmed for immediate inbound SSH/IM wake. - Build and ship
drm_mipi_dbi.ko.zstcleanly:scripts/build-kernel-audio.sh,rebuild-image.sh,scripts/apply-bananarchy-overlay.sh, andscripts/check-rebuild.shnow build, compress, install intooverlay/rootfsand target rootfs/initramfs, and verifydrm_mipi_dbi.ko.zstalongsidepanel-mipi-dbi.ko.zst.