Implement 0012 72h standby battery optimizations and initramfs depmod hook
- Add patches/kernel/0012-msm8909-standby-wifi-wcd-panel-ldo-bms.patch, rebuild affected kernel/module artifacts and all six device DTS/DTB files (msm8916-wcd-analog s2/bias gating, wcn36xx offload_sync_work and healthy-RSSI screen_off_offload scan short-circuit, pm8916_bms_vm screen_off FORCE_S3 OCV mode, panel-mipi-dbi dc/reset low on blank, spi-qup runtime PM sleep pinctrl, PM8909 l1/l4 LDO seeding, and sdhci-msm vmmc/vqmmc set_load with regulator-allow-set-load on l8/l12), and switch msm8905-cam from direct APSS SPMI LDO6/LDO17 writes to RPM regulator consumer voting.
- Update standby power policy and compiled C daemons (WIFI_LISTEN_INTERVAL=8, WIFI_STANDBY_RAT=gsm with CS verification and fallback, 10-bananarchy-dpm.sh wifi-up/unpark-rat dispatch, 25 s boot QRTR wait and QMI DMS online recovery, pm8916_bms_vm screen_off sync, bananarchy-run-aligned dark-screen skip, bananarchy-dsds --sig-hysteresis, bananarchy-cover-idle wake_blank_timeout = 8, and scripts/test-standby-power-policy.py).
- Add overlay/rootfs/etc/boot-deploy/hooks/10-initramfs-depmod.sh to run depmod -b per staged initramfs cpio archive and eliminate Stage 2 udevd missing-module boot console errors, enforce .ko.zst-only module installs in apply-bananarchy-overlay.sh, stage Alpine 3.24 /usr/lib/{libz,libcrypto}.so* in rebuild-image.sh chroot with failure cleanup, and add initramfs cpio guards plus verified image hashes in scripts/check-rebuild.sh.
- Document all changes under Unreleased in CHANGELOG.md and synchronize AGENTS.md, MANUAL.md, and BATTERY-OPTIMIZATION-ANALYSIS.md.
This commit is contained in:
1 parent
9700949b28
commit
fc5c4282f5
67 files changed
+67482
-65598
No files matched your search
@@ -1510,3 +1510,106 @@ vMPM timer programming or last-man L2 SAW2 shutdown.
|
||||
`bananarchy-x11-session.sh` tail loop with 0%-CPU compiled C11 ARM ELF
|
||||
binaries (`poll(..., -1)` / `inotify` / `nanosleep`) built by
|
||||
`scripts/build-bananarchy-daemons.sh`.
|
||||
|
||||
---
|
||||
|
||||
## 23. 72-hour DSDS + Wi-Fi standby optimizations & live hardware verification
|
||||
|
||||
Following measured standby of 60% drain in 24h on a `nokia-beatles` (`2720 Flip`)
|
||||
with DSDS active, Wi-Fi connected, and no microSD inserted, the following kernel,
|
||||
driver, DTS, daemon, and power-policy changes were implemented toward the 72h
|
||||
standby baseline (`<= 20.8 mA` on the 1,500 mAh cell) without re-enabling
|
||||
`CONFIG_SUSPEND` or regressing `nokia-argon`:
|
||||
|
||||
1. **Kernel standby patch
|
||||
(`patches/kernel/0012-msm8909-standby-wifi-wcd-panel-ldo-bms.patch`)**:
|
||||
- **Analog audio codec (`sound/soc/codecs/msm8916-wcd-analog.c`)**: switched
|
||||
`pm8916_wcd_analog` to `.idle_bias_on = 0` with `.set_bias_level` and
|
||||
`pm8916_wcd_analog_update_power_locked()` (`power_lock`, `audio_active`,
|
||||
`jack_inserted`, `s2_enabled`), disabling `s2` (`vdd-cdc-tx-rx-cx`,
|
||||
1.85 V) and master bias whenever playback/capture and headset insertion are
|
||||
both idle, and masking `MBHC_BUTTON_PRESS_DET | MBHC_BUTTON_RELEASE_DET`
|
||||
while no jack is inserted.
|
||||
- **WCN3620 Wi-Fi (`drivers/net/wireless/ath/wcn36xx/{main.c,smd.c,wcn36xx.h}`)**:
|
||||
added `offload_sync_work` (`wcn36xx_schedule_offload_sync()`) to re-sync
|
||||
`HOST_SUSPEND_IND` / NS offload after scans and IPv6 address updates, and
|
||||
short-circuited associated multi-channel `wcn36xx_hw_scan()` requests when
|
||||
`screen_off_offload` is enabled and `wcn36xx_operating_rssi_healthy()` shows
|
||||
RSSI `>= -75 dBm`.
|
||||
- **Fuel gauge (`drivers/power/supply/pm8916_bms_vm.c`)**: added the
|
||||
`screen_off` module parameter (`pm8916_bms_screen_off_ops`) and
|
||||
`pm8916_bms_vm_sync_mode()` so the BMS enters `PM8916_BMS_VM_MODE_FORCE_S3`
|
||||
while the panel is off and discharging, sampling
|
||||
`PM8916_BMS_VM_S3_S7_OCV_DATA0` when returning to
|
||||
`PM8916_BMS_VM_MODE_NORMAL`. `bananarchy-display-power-sync` drives
|
||||
`/sys/module/pm8916_bms_vm/parameters/screen_off`.
|
||||
- **MIPI DBI panel + SPI QUP (`panel-mipi-dbi.c`, `spi-qup.c`)**:
|
||||
`panel_mipi_dbi_disable()` drives `dc` and `reset` GPIOs low on blank/DPMS
|
||||
Off, and `spi_qup_pm_suspend_runtime()` / `spi_qup_pm_resume_runtime()`
|
||||
toggle `pinctrl_pm_select_sleep_state()` and
|
||||
`pinctrl_pm_select_default_state()` around QUP runtime PM.
|
||||
- **Unused RPM LDO seeding (`drivers/regulator/qcom_smd-regulator.c`)**:
|
||||
extended `rpm_regulator_init_vreg()` seeding (`vreg->is_enabled = 1`) to
|
||||
PM8909 `l1` and `l4` alongside `l14`, `l15`, and `l18` so unreferenced
|
||||
rails power down cleanly after late regulator cleanup.
|
||||
- **microSD LPM preparation (`drivers/mmc/host/sdhci-msm.c` + device DTS)**:
|
||||
`sdhci_msm_runtime_suspend()` and `sdhci_msm_runtime_resume()` scale
|
||||
`vmmc`/`vqmmc` regulator load between `0` and `200000` / `20000` uA,
|
||||
paired with `regulator-allow-set-load;` on `l8`/`l12` in all six device
|
||||
DTS files (`nokia-argon`, `nokia-beatles`, `nokia-beatles-cover`,
|
||||
`nokia-coconut`, `nokia-sparkler`, `nokia-leo`). Physical microSD rundown
|
||||
testing remains to be run once a card is inserted.
|
||||
|
||||
2. **Camera driver RPM regulator fix (`src/msm8905-cam/msm8905-cam.c`)**:
|
||||
- Closed-flip (`DPMS Off`) camera capture testing exposed a kernel Oops in
|
||||
`pmic_arb_write_cmd()` when `msm8905-cam` wrote `LDO6` (`0x4546`) directly
|
||||
over APSS SPMI (`usid1_regmap`); `LDO6` and `LDO17` belong to RPM
|
||||
(`qcom_smd-regulator`), which only went unnoticed previously when `display@0`
|
||||
was powered on.
|
||||
- Replaced direct `LDO6`/`LDO17` SPMI writes with Linux regulator consumer
|
||||
voting (`regulator_get_optional(&cam->pdev->dev, "l6"|"l17")`,
|
||||
`msm8905_cam_regulators_enable()`, and
|
||||
`msm8905_cam_regulators_disable()`), keeping `msm8905_cam_spmi_restore()`
|
||||
solely for codec analog `PPID 0xf1`. Verified `bananarchy-photo` during
|
||||
`DPMS Off` on rebuilt `6.12.1-msm8916` with zero warnings or Oopses and
|
||||
`l6`/`l17` returning to `use=0` after capture.
|
||||
|
||||
3. **Userspace daemons, boot readiness, and standby power policy**:
|
||||
- `/etc/bananarchy-power-policy.conf` defaults updated to
|
||||
`WIFI_LISTEN_INTERVAL=8` and `WIFI_STANDBY_RAT=gsm` (keeps `CPU_RPM_SLEEP=0`,
|
||||
`CPU_L2_SLEEP=0`, `MODEM_DRX_MODE=0`, `DSDS_SECONDARY_MODE=active`,
|
||||
`WIFI_SCREEN_OFF_IPV6_MUTE=1`).
|
||||
- `/etc/NetworkManager/conf.d/10-power.conf` keeps `wifi.powersave=3` and
|
||||
`[connectivity] enabled=false` without an overriding `wifi.scan-interval`.
|
||||
- `/etc/NetworkManager/dispatcher.d/10-bananarchy-dpm.sh` dispatches
|
||||
`bananarchy-power-policy.sh unpark-rat` on `wlan0` `down|pre-down` and
|
||||
`bananarchy-power-policy.sh wifi-up` on `up|dhcp4-change`.
|
||||
- `bananarchy-power-policy.sh`, `etc/init.d/msm8909-modem-wwan-port`,
|
||||
`etc/init.d/msm-modem-uim-selection`, and
|
||||
`usr/libexec/msm-modem-uim-selection` raise boot QRTR waits from 15 s to
|
||||
25 s, recover QMI DMS from low-power/offline to `online` inside
|
||||
`provision_slot()`, redirect background timer subshell FDs in
|
||||
`arm_rat_park_timer()`, and apply `screenoff` on boot when dark.
|
||||
- `bananarchy-run-aligned.c` (`should_skip_while_dark()`), `sxmo_wm.sh`
|
||||
(`killall -USR1 bananarchy-run-aligned`, `bananarchy-power-policy.sh`),
|
||||
`bananarchy-dsds.c` (`--sig-hysteresis`), and `bananarchy-cover-idle.c` /
|
||||
`cover-display.conf` (`wake_blank_timeout = 8` for passive closed-flip
|
||||
wakes) suppress unnecessary idle wakeups.
|
||||
|
||||
4. **Verified live `nokia-beatles` telemetry & image checks (before multi-day rundown)**:
|
||||
- Closed-flip Wi-Fi + DSDS standby (`lid=closed`, `dpms=Off`, `blp=4`,
|
||||
`br=0`, `bms_off=Y`): `spi_runtime=suspended`, `gpio13=out low`,
|
||||
`gpio25=out low`, `gpio110=out low`, `s2 use=0`, `l6 use=0`, `l12 use=0`,
|
||||
`l17 use=0`, `wcn36xx_param=8`, `wcn36xx_screen_off_offload=Y`,
|
||||
`wlan0_accept_ra=0`, `rat_parked=yes` (`Mode preference: 'gsm'`, both SIM
|
||||
slots `registered`), `MPSS` `XO shutdown count: 605`, `PRONTO`
|
||||
`XO shutdown count: 296`, and codec `dapm/bias_level` = `Off`.
|
||||
- Post-rebuild `6.12.1-msm8916` boot verification (`Sun Nov 15 11:56:20 UTC
|
||||
2026`): automatic QMI DMS `Mode: 'online'`, `DUAL_SIM_ACTIVE=1` (`lifecell`
|
||||
Slot 1 `gsm` + Slot 2 `umts` `registered`), `spi_runtime=suspended`,
|
||||
`l12 use=0`, and clean `DPMS Off` camera capture (`31K` JPEG).
|
||||
- Both rebuilt `nokia-argon` and `nokia-beatles` release images passed
|
||||
`e2fsck -fn`, `debugfs`, `scripts/test-standby-power-policy.py`, and
|
||||
`scripts/check-rebuild.sh` zero-regression checks.
|
||||
- Physical 24h and 72h unplugged discharge measurements (without and with a
|
||||
microSD card installed) remain to be measured against the rebuilt image.
|
||||
Reference in new issue
Block a user