Skip to content

[BUG] esp32s3 wifi deadlock #15314

@yamt

Description

@yamt

Description / Steps to reproduce the issue

net_lock() and esp_wifi_lock() are taken in an inconsistent order.
thus it can cause a deadlock.

wlan_ifdown net_lock();
  |
  v
esp_wifi_sta_stop esp_wifi_lock(true);
esp_evt_work_cb esp_wifi_lock(true);
  |
  v
esp32s3_wlan_sta_set_linkstatus(false)
  |
  v
netdev_carrier_off
  |
  v
devif_dev_event net_lock();

the most straightforward fix: make esp_evt_work_cb (and other functions taking esp_wifi_lock first if any) acquire net_lock() before esp_wifi_lock(). (note that net_lock() is a recursive lock.)

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

macOS 15.2

NuttX Version

master

Issue Architecture

[Arch: xtensa]

Issue Area

[Area: Drivers]

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: xtensaIssues related to the Xtensa architectureArea: DriversDrivers issuesOS: MacIssues related to MacOS (building system, etc)Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions