fix(esp_phy): Add protection of consecutive disable operations by single modem source

This commit is contained in:
Wang Mengyang
2025-08-03 19:18:58 +08:00
parent 29af244a49
commit 15d88a149b
3 changed files with 19 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -134,8 +134,9 @@ void esp_phy_disable(esp_phy_modem_t modem)
#if CONFIG_ESP_PHY_RECORD_USED_TIME
phy_record_time(false, modem);
#endif
esp_phy_modem_t saved_modem = phy_get_modem_flag();
phy_clr_modem_flag(modem);
if (phy_get_modem_flag() == 0) {
if (saved_modem == modem) {
#if !CONFIG_ESP_PHY_DISABLE_PLL_TRACK
phy_track_pll_deinit();