Merge branch 'bugfix/pm_isr_exit_lock_v3.3' into 'release/v3.3'

pm: prevent interrupt nesting during esp_pm_impl_isr_hook (backport v3.3)

See merge request espressif/esp-idf!4970
This commit is contained in:
Jiang Jiang Jian 2019-09-08 23:10:02 +08:00
commit 64fbce50c2

View file

@ -457,6 +457,10 @@ void IRAM_ATTR esp_pm_impl_isr_hook()
{
int core_id = xPortGetCoreID();
ESP_PM_TRACE_ENTER(ISR_HOOK, core_id);
/* Prevent higher level interrupts (than the one this function was called from)
* from happening in this section, since they will also call into esp_pm_impl_isr_hook.
*/
uint32_t state = portENTER_CRITICAL_NESTED();
#if portNUM_PROCESSORS == 2
if (s_need_update_ccompare[core_id]) {
update_ccompare();
@ -467,6 +471,7 @@ void IRAM_ATTR esp_pm_impl_isr_hook()
#else
leave_idle();
#endif // portNUM_PROCESSORS == 2
portEXIT_CRITICAL_NESTED(state);
ESP_PM_TRACE_EXIT(ISR_HOOK, core_id);
}