nuttx/arch
Felipe Moura 7c02367483 esp32s3/esp32s3_idle.c: report light-sleep time to the PM statistics
/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
2026-09-22 13:29:13 +08:00
..
arm arch/arm/stm32h7: timestamp the transmitted frames in hardware. 2026-09-21 21:45:01 +08:00
arm64 arch/arm64: AES using the Armv8 Cryptography Extension. 2026-09-21 18:43:36 +08:00
avr arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
ceva arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
dummy
hc tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00
mips arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
misoc arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
or1k arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
renesas nuttx/libc: refine the atomic related Kconfig 2026-08-24 13:20:45 +08:00
risc-v arch/risc-v/eic7700x: Name the reset lines through procfs. 2026-09-21 16:29:12 +08:00
sim sched/pthread: Implement pthread_sigqueue 2026-09-21 14:53:26 +08:00
sparc arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
tricore arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
x86 arch/x86: Add -P to CPP to suppress linemarkers. 2026-09-17 16:21:59 +08:00
x86_64 arch/intel64: don't touch the outgoing stack after releasing the csection 2026-09-15 11:39:05 -03:00
xtensa esp32s3/esp32s3_idle.c: report light-sleep time to the PM statistics 2026-09-22 13:29:13 +08:00
z16 tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00
z80
CMakeLists.txt cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
Kconfig binfmt, arch/arm: Add the CONFIG_FDPIC option and the ABI header. 2026-09-08 16:31:16 -03:00