Commit fc9c54f
fw/services/bluetooth: fix deadlock in evaluate_pairing_refcount
The evaluate_pairing_refcount callback was
calling gap_le_slave_is_discoverable()
which acquires bt_lock from the System Task context. This caused a
deadlock when
the Launcher Task already held bt_lock while waiting for ble_hs_mutex,
resulting
in a watchdog timeout.
Fix by caching the BLE discoverable state locally instead of querying it
via
gap_le_slave_is_discoverable(), eliminating the cross-task lock
acquisition.
The cached state maintains the same optimization (avoiding redundant
calls to
gap_le_slave_set_discoverable) without the deadlock risk.
Signed-off-by: Joshua Jun <[email protected]>1 parent deeb8db commit fc9c54f
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
0 commit comments