You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "rojer (via GitHub)" <gi...@apache.org> on 2026/04/17 21:02:43 UTC

[PR] host: Fix recursive lock in ble_hs_stop_done [mynewt-nimble]

rojer opened a new pull request, #2207:
URL: https://github.com/apache/mynewt-nimble/pull/2207

   ble_hs_stop_done() held ble_hs_lock while calling ble_gap_reset_state() which internally acquires the same lock via ble_hs_atomic_first_conn_handle() and ble_gap_conn_broken(). On platforms with non-recursive mutexes this causes a deadlock or assertion failure.
   
   Move ble_hs_stop_hci_reset(), ble_gap_reset_state(), ble_hs_id_reset(), and ble_hs_pvcy_reset() outside the locked section. These functions either manage their own locking internally or don't need the lock. ble_hs_enabled_state is set to OFF under the lock before releasing, preventing new operations.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] host: Fix recursive lock in ble_hs_stop_done [mynewt-nimble]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc merged PR #2207:
URL: https://github.com/apache/mynewt-nimble/pull/2207


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] host: Fix recursive lock in ble_hs_stop_done [mynewt-nimble]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on PR #2207:
URL: https://github.com/apache/mynewt-nimble/pull/2207#issuecomment-4333948686

   BTW I do think that in general we should get rid of this assert and simply make ble_hs_lock() recursive  (TBH I have no idea why it is like that in first place...)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org