Skip to content

Commit 80ee819

Browse files
Raffael RostagnoMaureenHelm
authored andcommitted
drivers: systimer: xtensa: Fix ISR/idle_exit concurrency
IDLE exit is programmed to happen shortly before systimer programmed wake-up event happens. If the interrupt from the timer happens before, idle_exit() does not run, as timeout_idle flag is cleared at the ISR. Fix condition for both systimer (ESP32) and xtensa drivers. Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
1 parent afcfbf6 commit 80ee819

2 files changed

Lines changed: 0 additions & 4 deletions

File tree

drivers/timer/esp32_sys_timer.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ void sys_clock_set_timeout(int32_t ticks, bool idle)
134134
lptim_pre_idle = esp32_lptim_hook_on_lpm_entry(timeout_us);
135135
systimer_pre_idle = get_systimer_alarm();
136136
timeout_idle = true;
137-
} else {
138-
timeout_idle = false;
139137
}
140138
#else
141139
ARG_UNUSED(idle);

drivers/timer/xtensa_sys_timer.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ void sys_clock_set_timeout(int32_t ticks, bool idle)
118118
lptim_pre_idle = z_xtensa_lptim_hook_on_lpm_entry(timeout_us);
119119
ccount_pre_idle = ccount();
120120
timeout_idle = true;
121-
} else {
122-
timeout_idle = false;
123121
}
124122
} else {
125123
ARG_UNUSED(idle);

0 commit comments

Comments
 (0)