Skip to main content
Version: 030-rc3

Pantavisor Power

Overview: Power and Wakelocks explains why suspend is blocked the way it is, how managed mode schedules wakes, and what happens without kernel wakelock support.

Power modes

Set with PV_POWER_MODE.

ValueSuspendBehaviour
disabledneverNo power management; wakelock calls are no-ops
locksopportunisticKernel autosleep on; Pantavisor holds a wakelock whenever busy, so the device suspends only when idle and resumes on an external wake source. Default
managedopportunistic + timed wakeAs locks, plus Pantavisor arms an RTC alarm and wakes itself to poll Pantacor Hub, so no external wake source is required

Kernel requirement

locks and managed need CONFIG_PM_WAKELOCKS and a writable <PV_POWER_SYSFS_DIR>/wake_lock.

ModeKernel support missing
disabledTolerated
locksDegrades: one WARN, wakelocks become no-ops, boot proceeds. Reported as degraded in GET /wakelocks
managedFatal: init fails and Pantavisor does not start, so a try-boot into such a revision never confirms and rolls back

Wakelock scopes

All suspend blocking goes through one kernel wakelock named pantavisor, reference-counted in userspace. Each scope owns a guard and contributes at most one to the count.

ScopeHeld while
bootFrom start until the state machine first reaches steady state (RUNWAIT)
updateAn update downloads, installs and passes the post-boot test/commit
update_checkA poll-for-updates roundtrip is in flight
devmetaA local device-metadata change is not yet synced to Pantacor Hub, bounded by PV_POWER_DEVMETA_MAX_HELD
usrmetaA user-metadata GET is in flight
shutdownTeardown (sync, unmount) during shutdown
debug_shellA debug/serial shell session is open
pollA managed-mode wake window is open

Configuration keys

Full rows, levels included, are in the configuration reference. Every key below except PV_POWER_MODE and PV_POWER_SYSFS_DIR is a duration: it takes a bare number of seconds or a single-unit value — 30s, 10min, 1h, 1d.

KeyDefaultApplies toMeaning
PV_POWER_MODElocksallPower mode
PV_POWER_SYSFS_DIR/sys/powerlocks, managedBase dir of the wakelock sysfs nodes
PV_POWER_DEVMETA_EAGER_PUSH0allPush a dirty devmeta change out-of-band immediately instead of waiting up to a full devmeta interval
PV_POWER_DEVMETA_MAX_HELD300allMax seconds the devmeta scope is held awaiting a Hub ack
PV_POWER_AUTOSLEEP_SETTLE90managedDelay after ready before autosleep is enabled
PV_POWER_WAKE_INTERVAL3600managedSeconds between timed wakes
PV_POWER_WAKE_MIN_AWAKE10managedMinimum awake seconds per wake window
PV_POWER_WAKE_MAX_AWAKE60managedMaximum awake seconds per wake window
PV_POWER_WAKE_RUN_WINDOW0managedExtra awake seconds after the wake's payloads complete, as the containers' guaranteed run window

GET /wakelocks

Served by the control socket, and wrapped by pvcontrol wakelocks ls.

pvcontrol wakelocks ls
FieldTypeMeaning
modestringThe active power mode (disabled / locks / managed), which may lag the configured one until the next config apply
countnumberCurrent reference count on the pantavisor wakelock; 0 means the device is free to suspend
degradedbooltrue when locks mode fell back to no-op wakelocks because the kernel lacks wakelock support (managed fails init instead)
autosleepbooltrue once managed mode has enabled kernel autosleep, after the settle delay
settlingbooltrue while managed mode is waiting out PV_POWER_AUTOSLEEP_SETTLE before enabling autosleep
pollingbooltrue while a managed wake window is open — the device woke to poll Hub and/or run containers
run_windowbooltrue only while polling is true and the guaranteed container run window has not yet elapsed
held.bootboolHeld from start until the state machine first reaches steady state
held.updateboolAn update is downloading, installing, or in its post-boot test/commit
held.update_checkboolA poll-for-updates roundtrip is in flight
held.devmetaboolA local device-metadata change is not yet synced to Hub
held.usrmetaboolA user-metadata GET is in flight
held.shutdownboolTeardown (sync, unmount) is running during shutdown
held.debug_shellboolA debug/serial shell session is open
held.pollboolA managed-mode wake window is open (mirrors polling)