10 KiB
Power optimization
Geminux tunes the kernel, hardware power rails, radios, and daemons for cool idle operation and multi-day closed-lid standby on the Gemini PDA's 4268 mAh battery.
Standby modes and targets
| Mode (lid closed on battery) | Endurance target (max avg draw) | Active hardware & wake path |
|---|---|---|
| Airplane Mode ON | >= 72 h (<= 59 mA avg) |
MD1 powered off (stage=0), CONSYS Wi-Fi/BT unloaded, Panfrost VGPU/LDOs/MFGPLL off, TCXO gated in SPM mem sleep; wakes on Hall lid switch (SW_LID), power key, USB attach, or internal 600 s PCM timer rollover |
| Airplane Mode OFF | >= 48 h (<= 89 mA avg) |
CONSYS unloaded, GPU rails off, 4G MD1 stays in LTE DRX idle while AP enters SPM mem sleep (allow_md1=1); RF LDOs (VTCXO28, VRF18, VRF12) use SRCLKEN0 low-IQ mode; incoming calls/SMS/SIP INVITEs wake AP via CCIF0/CLDMA/MD1_WDT |
Actual standby life depends on physical cell health, signal strength / carrier LTE DRX interval, and SIM configuration.
Kernel-level optimizations
Built into 7.3.5-geminux via kernel/configs/geminux-mt6797x.config:
CONFIG_HZ_100=y&CONFIG_RCU_LAZY=y: Cuts periodic timer interrupts compared to 250/1000 Hz kernels and batches idle RCU callbacks for deeper CPU C-state residency.CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y: DrivesschedutilDVFS viaclk-mt6797-mcusys+cpufreq-dtloaded by geminux-hwinit (GEMINUX_ENABLE_CPUFREQ="yes"in conf.d/geminux-hwinit), scalingpolicy0(221..897 MHz) andpolicy4(325..1209 MHz) without waking the Cortex-A72 cluster (GEMINUX_ENABLE_A72="no").mt6797-gate-unused: Gates ~25 unused bootloader leaf clocks (SPI,UART,PWM,IRTX,ICUSB,ANC_MD32, etc.) left running underclk_ignore_unused.- Sensor IR LED gating: Blacklists
stk3310in modprobe.d/geminux.conf (GEMINUX_ENABLE_SENSORS="no") to prevent unconsumed ALS/proximity IR polling. CONFIG_ZRAM_DEF_COMP_LZ4=y&CONFIG_CRYPTO_AES_ARM64_CE_BLK=y: Uses2 GiBLZ4zram(vm.swappiness=100) instead of eMMC flash swap, with ARMv8 AES-CE acceleration for optional LUKS2 (--allow-discards).
Deep sleep (mem) and wakeup reliability
CONFIG_SUSPEND=y drives Suspend-to-RAM (mem) through mt6797-spm-sleep (sodi_idle=0 pmic_modes=1 allow_md1=1 timer_sec=600 in modprobe.d/geminux.conf):
- PMIC sleep modes & TCXO hardware gating (
0014): Re-enablespmic_modes=1soTOP_CONBIT(6) gates the 26 MHz TCXO wheneverSRCLKEN0drops low, bucks (VCORE/VGPU/VS1/VS2) step down viaVSLEEP_EN, and six LDOs enter SRCLKEN0 low-IQ mode—while clampingVCOREslots.slots[7](MT6351_VCORE_CON6) to0x10(0.700 V) so CPU0 never browns out inWFI. - MD1 cellular
memsuspend (0014): Enablesallow_md1=1so closed-lid standby enters true SPMmemsleep even while 4GMD1is booted (SODI still refuses active MD1):- Arms
WAKE_CCIF0(BIT(8)),WAKE_MD1_WDT(BIT(25)), andWAKE_CLDMA(BIT(26)) dynamically whenMD1is active, and exposes the latest wakeup bitmask vialast_wake_r12. - Enables
MT6351_LDO_MODE_CTRL_BIT(SRCLKEN0low-IQ mode) onVTCXO28/VRF18/VRF12without cutting RF transceiver power. - Guards pending
rx_workand unread RX GPDs inmt6797_ccci_suspend(), restores/restarts RXSOrings inmt6797_ccci_resume(), and raisespm_wakeup_event()to3000 mson CLDMA/CCIF interrupts.
- Arms
- Panfrost VGPU / LDO / MFGPLL suspend rail-off (
0014): Once all four GPU core domains are runtime-suspended,panfrost_device_suspend()releases OPP/regulator references alongsidemt->vgpu(shutting off externalrt5735_vgpu), clearsMT6797_GPULDO_EN(0x1ff -> 0), and parksmfg-selonclk26mto power offMFGPLL, restoring in vendor LDO →vgpu→clk_set_rate→ OPP order on resume. - CCCI MD1 cold-boot & flight-mode gating (
0014):mt6797_ccci_power_off()and cold-bootstage=0re-gateINFRA_CG0_MD_MASK/INFRA_CG1_MD_MASK, setC2K_LTE_LS_ISO_BITandMD1_EXT_BUCK_ISO_BIT, clearMDPLL126 MHz clock bits, and ensureSPM_MD1_PWR_CONis powered down so Airplane Mode leaks zero modem power. - SPM, Hall lid, PMIC IRQ & fuel-gauge hardening (
0008,0011,0012,0013): Boundsspm_enter()PCM rollovers, clearsmtk-eintdebounce across wakeups, debounces HallSW_LID(1 ms) / keypad (10 ms), reconcilesgemini-lidonPM_POST_SUSPEND, movesmt6397_irq_suspend/resumetoLATE_SYSTEM_SLEEP_PM_OPS, addsWAKE_PCM_WDT+ a5000 mscntpsafety backstop, and stabilizesmt6351-fuel-gauge+bq25890zero-current OCV/taper calibration.
Zero-poll userspace daemons
geminux-powerd
Starts after modules geminux-hwinit geminux-ccci and waits in epoll_wait() over /dev/input/event* (SW_LID, KEY_POWER, mtk-pmic-keys KEY_ESC), filtered KOBJECT_UEVENT netlink (input, power_supply, drm), /run/geminux/powerd.sock, and a lazy timerfd:
- USB/AC policy (
inhibit_ac_lid): Locks and blanks (bl_power=4+DPMSModeOff) without unloading CONSYS or invoking/sys/power/state, keepingbq25890's40 swatchdog fed without-EBUSYthrash. - Battery
mem& standby backoff: Entersmemsuspend whenevermd1/stage == 0orallow_md1=Y(falling back tolow_power_standbyfor active MD1 only ifallow_md1=N). Before suspending, it reaps any in-flightradio_worker_pid, unloads CONSYS, and ensuresmd1/stage == 0when Airplane Mode is enabled; transient-EBUSYresults trigger exponential retries (3s -> 10s -> 30s -> 60s) and immediateSIGCHLDre-arming whenradio_worker_pidcompletes. - Wakeup filtering & modem-wake grace: Polls post-resume input events (
90 ms) BEFORE onlining secondary CPUs and checks/sys/module/mt6797_spm_sleep/parameters/last_wake_r12:- Internal
600 sPCM timer rollovers (quiet_timer_resleep) keepcpu1..7offline and re-entermemsleep after300 mswithout waking Xorg or reloading CONSYS. - Modem wakes (
CCIF0/MD1_WDT/CLDMA) grant a3500 msclosed-lid grace window soModemManager/geminux-modem-ctl/geminux-imsdcan assertinhibit add call; once the call ends (inhibit del), suspend re-arms after1000 ms. - Only
closed -> openlid transitions, genuine user input, or AC attach wake the session.
- Internal
- X11 DPMS blank/wake & lock sync: Blanking sets
brightness=0,bl_power=4, andDPMSModeOff; unblanking callsDPMSForceLevel(..., DPMSModeOn)+XResetScreenSaver()in a500 mstimeout-capped privilege-dropped child; pre-suspend locking waits up to1800 msforgeminux-lockto publish_GEMINUX_LOCK_READY.
Supporting daemons & X11 efficiency
geminux-statusd: Event-drivenepoll(signalfd, netlink, filtered uevents,inotify, minute-alignedtimerfd); deduplicatesWM_NAMEupdates with zero shell forks.geminux-modem-ctl: Sleeps inepoll_wait(..., -1)viainotifyon/run/geminux(airplane-mode,ims-state) with nodbus-monitoror retry timer while Airplane Mode is active.- Display &
st:ShadowFB+TearFree(AccelMethod "none"in 10-geminux-gpu.conf) avoids Glamor spin-waits;stpauses cursor blink timers when unfocused. - Input, Audio, Modem, LEDs & Lock:
geminux-touchd,geminux-ccci-daemon,geminux-imsd(20 msRTPtimerfdarmed only mid-call),geminux-bt-obex,geminux-leds(AW9120 strip0 mAidle/100%, amberrgb:indicator-6while charging), andgeminux-lock(15 sclock refresh, diff-checked).
Cluster gating and profiles
Managed via geminux-power-ctl / geminux-control (geminux-power-policy.c):
| Profile | Governor | A72 (cpu8..9) |
A53 LL (policy0) / L (policy4) max freq |
Battery idle (dim -> suspend) | AC idle (lock+blank) |
|---|---|---|---|---|---|
eco |
schedutil |
Offline (0) |
715 MHz / 962 MHz |
60 s -> 180 s |
180 s |
balanced |
schedutil |
Online (1, 2002 MHz) |
897 / 1209 MHz (bat), 1547 / 1846 MHz (AC) |
120 s -> 300 s |
300 s |
performance |
performance |
Online (1, 2600 MHz) |
1547 MHz / 1846 MHz (clamped to DT max) |
180 s (lock+blank only) |
600 s |
Idle timers count strictly from the last user input (CLOCK_MONOTONIC), ignoring periodic battery uevents. Lid close (SW_LID = 1) on battery suspends unless inhibited by AC (inhibit_ac_lid), an active call, a manual inhibitor, or HDMI (SiI9024).
Audio, radios, and storage defaults
- Audio: PipeWire
min-quantum = 1024,quantum = 2048(10-geminux-power.conf); WirePlumber suspends idle nodes after3 s. - Bluetooth:
AutoEnable = false,FastConnectable = false(etc/bluetooth/main.conf); soft-blocked at boot. - Wi-Fi & NTP:
wifi.powersave = 2prevents associated CONSYS key/DNS stalls; Chrony usesmaxsources 2,minpoll 10 maxpoll 14(10-geminux.sources) + offline dispatch (30-geminux-chrony). - Toolkits & Storage:
NO_AT_BRIDGE=1(10-geminux-env.sh) avoids idle AT-SPI daemons;noatime,commit=60anddirty_writeback_centisecs=1500cut eMMC wakes;/media/sdcardmountsnoatimepurely viaeudevhotplug.
On-device verification and fallback
Inspect live power, suspend counters, GPU rail state, and wake reasons at any time:
geminux-power-audit
geminux-power-audit --json
Look for "spm_pmic_modes":"Y", "spm_allow_md1":"Y", incrementing "suspend_success" and "gpu_rail_suspends", "vgpu_state":"disabled", "last_failed_dev":"none", and standby current draw (current_ua) after a closed-lid battery sleep window. If you ever need to test cellular fallback without MD1 mem suspend, disable allow_md1 at runtime:
echo 0 | doas tee /sys/module/mt6797_spm_sleep/parameters/allow_md1