mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-24 17:27:21 +00:00
esp_hw_support: Fix esp_light_sleep_start() deadlock
esp_light_sleep_start() will stall the other CPU via esp_ipc_isr_stall_other_cpu(). After stalling the other CPU, will call esp_clk_... API which themselves take locks. If the other stalled CPU is holding those locks, this will result in a deadlock. This commit adds a workaround calling esp_clk_private_lock() to take the lock before stalling the other CPU.
This commit is contained in:
@@ -51,11 +51,11 @@ void esp_timer_private_set(uint64_t new_us);
|
||||
void esp_timer_private_advance(int64_t time_diff_us);
|
||||
|
||||
/**
|
||||
* @brief obtain internal critical section used esp_timer implementation
|
||||
* @brief obtain internal critical section used in the esp_timer implementation
|
||||
* This can be used when a sequence of calls to esp_timer has to be made,
|
||||
* and it is necessary that the state of the timer is consistent between
|
||||
* the calls. Should be treated in the same way as a spinlock.
|
||||
* Call esp_timer_unlock to release the lock
|
||||
* Call esp_timer_private_unlock to release the lock
|
||||
*/
|
||||
void esp_timer_private_lock(void);
|
||||
|
||||
|
Reference in New Issue
Block a user