Merge branch 'fix/esp-phy-isr-safe-logging' into 'master'

fix(esp_phy): use early log macros in ISR context to avoid log lock deadlock

See merge request espressif/esp-idf!50443
This commit is contained in:
Shu Chen
2026-07-29 09:13:15 +00:00
2 changed files with 13 additions and 3 deletions
+7 -2
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2016-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2016-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "esp_log.h"
#include "esp_attr.h"
@@ -36,7 +37,11 @@ static int lib_printf(const char* tag, const char* format, va_list arg)
temp[i] = 0;
}
if (i > 0) {
ESP_LOGI(tag, "%s", temp);
if (xPortInIsrContext()) {
ESP_EARLY_LOGI(tag, "%s", temp);
} else {
ESP_LOGI(tag, "%s", temp);
}
}
va_end(arg);
return len;
+6 -1
View File
@@ -17,6 +17,7 @@
#include "esp_private/phy.h"
#include "esp_phy.h"
#include "esp_attr.h"
#include "freertos/FreeRTOS.h"
#if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP
#include "hal/temperature_sensor_ll.h"
@@ -388,6 +389,10 @@ void phy_wakeup_from_modem_state_extra_init(void)
__attribute__((weak)) void phy_wait_freq_hw_hop_done(void)
{
ESP_LOGD(TAG, "phy_wait_freq_hw_hop_done is not implemented");
if (xPortInIsrContext()) {
ESP_EARLY_LOGD(TAG, "phy_wait_freq_hw_hop_done is not implemented");
} else {
ESP_LOGD(TAG, "phy_wait_freq_hw_hop_done is not implemented");
}
return;
}