mirror of
https://github.com/apache/nuttx.git
synced 2026-10-04 04:38:10 +00:00
/proc/pm/state0 reported a flat 0 s in its SLEEP column on a board that was demonstrably light-sleeping, because this port never told the PM core it had slept. pm_stats() (drivers/power/pm/pm_changestate.c) splits the time since the last transition into dom->wake[state] or dom->sleep[state] depending on whether the state it is handed is PM_RESTORE. up_idlepm() called esp_pmstandby() and carried straight on, so every second -- including the ones spent in light sleep -- was billed to wake[]. The statistics CONFIG_PM_PROCFS advertises were simply never true here. Read from an esp32s3-xiao that had just spent 89 s in PM_STANDBY: DOMAIN0 WAKE SLEEP TOTAL standby 89s 83% 0s 0% 89s 83% Only PM_STANDBY needs this. PM_SLEEP is deep sleep and does not return at all -- the chip resets -- so there is nothing to attribute on its way back. pm_changestate(domain, PM_RESTORE) is the documented way to say this: it skips the driver prepare/veto phase, records the statistic, notifies drivers of the restore, and deliberately does not overwrite the domain's state, so the domain stays in PM_STANDBY as it should. Signed-off-by: Felipe Moura <moura.fmo@gmail.com> Assisted-by: Claude:claude-opus-5 |
||
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| avr | ||
| ceva | ||
| dummy | ||
| hc | ||
| mips | ||
| misoc | ||
| or1k | ||
| renesas | ||
| risc-v | ||
| sim | ||
| sparc | ||
| tricore | ||
| x86 | ||
| x86_64 | ||
| xtensa | ||
| z16 | ||
| z80 | ||
| CMakeLists.txt | ||
| Kconfig | ||