jerpelea opened a new pull request, #20323:
URL: https://github.com/apache/nuttx/pull/20323

   ## Summary
   
   esp_pmstandby() fed up_step_idletime() the sleep duration it *asked* for 
(time_in_us) rather than the one it actually got (rtc_diff_us), and did so 
unconditionally.  Both halves are wrong.
   
   esp_pm_light_sleep_start() already stalls and restores the systimer itself, 
but only where SOC_SLEEP_SYSTIMER_STALL_WORKAROUND is defined -- esp32c3 and 
esp32p4.  On every other SoC, esp32s3 included, the systimer keeps counting 
straight through light sleep, so the time is already in the clock and stepping 
it again adds it twice.
   
   Measured on an esp32s3-xiao: over 54 min with 1919 light sleeps totalling 
454.7 s, the monotonic clock ran 443.2 s fast -- 0.97 of the time slept, i.e. 
counted exactly twice, leaving the clock 13.8% fast.  Anything that 
reconstructs wall time from CLOCK_MONOTONIC inherits that error; for this 
collar it corrupted every IMU sample timestamp.
   
   Invisible until light sleep started happening for real, because a board that 
never sleeps never steps the clock.
   
   Note for upstream: the risc-v copy here only switches to the measured 
duration and does not gate on SOC_SLEEP_SYSTIMER_STALL_WORKAROUND.  The two 
should be reconciled before this is proposed -- it is kept as-is so the 
asymmetry is visible rather than silently decided.
   
   ## Impact
   
   RELEASE
   
   ## Testing
   
   CI


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to