FelipeMdeO commented on code in PR #20225:
URL: https://github.com/apache/nuttx/pull/20225#discussion_r4065827403


##########
arch/xtensa/src/common/espressif/esp_pm.c:
##########
@@ -44,6 +44,7 @@
 #endif
 #include "esp_sleep.h"
 #include "soc/rtc.h"
+#include "soc/soc_caps.h"    /* SOC_SLEEP_SYSTIMER_STALL_WORKAROUND */

Review Comment:
   Removed.



##########
arch/xtensa/src/common/espressif/esp_pm.c:
##########
@@ -775,8 +777,13 @@ void esp_pmstandby(uint64_t time_in_us)
 
   esp_pm_light_sleep_start(&rtc_diff_us);
 
-#ifdef CONFIG_SCHED_TICKLESS
-  up_step_idletime((uint32_t)time_in_us);
+  /* Only step the clock where the systimer actually stalls during sleep
+   * (SOC_SLEEP_SYSTIMER_STALL_WORKAROUND); elsewhere it keeps counting
+   * through light sleep, so stepping it here would double-count the time.
+   */
+
+#if defined(CONFIG_SCHED_TICKLESS) && SOC_SLEEP_SYSTIMER_STALL_WORKAROUND

Review Comment:
   Applied, thanks.



-- 
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