From 80ca9dfa347a9af16607992b995133d99a5cce48 Mon Sep 17 00:00:00 2001 From: Yicheng Li Date: Mon, 18 Nov 2019 16:11:31 -0800 Subject: chip/stm32: Add explanation for previous STOP mode bug. Commit a6c2477aca71c0dd3aed21d34009aecf056a6f4a fixed a bug in STOP mode. This commit adds more explanation of what was happening. BUG=b:140538084 BRANCH=none TEST=none Change-Id: Ibfca1884aef4fabf8f74238b3ff1f70d5e0da3dd Signed-off-by: Yicheng Li Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1922912 Reviewed-by: Craig Hesling --- chip/stm32/clock-stm32h7.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'chip') diff --git a/chip/stm32/clock-stm32h7.c b/chip/stm32/clock-stm32h7.c index f41a76b87a..bd7cf65d3f 100644 --- a/chip/stm32/clock-stm32h7.c +++ b/chip/stm32/clock-stm32h7.c @@ -33,10 +33,9 @@ */ #define LPTIM_PRESCALER_LOG2 2 /* - * LPTIM_PRESCALER and LPTIM_PERIOD_US have to be signed, because we compare - * them to an int to decide whether to go to deep sleep. Simply using BIT() - * makes them unsigned, which causes a bug in deep sleep behavior. - * TODO(b/140538084): Explain exactly what the bug is. + * LPTIM_PRESCALER and LPTIM_PERIOD_US have to be signed, because they + * determine the signedness of the comparison with |next_delay| in + * __idle(), where |next_delay| is negative if no next event. */ #define LPTIM_PRESCALER ((int)BIT(LPTIM_PRESCALER_LOG2)) #define LPTIM_PERIOD_US (SECOND / (STM32_LSI_CLOCK / LPTIM_PRESCALER)) -- cgit v1.2.1