Skip to content

Commit 54338e6

Browse files
committed
fixup! Bluetooth: Host: Don't call user callback from TX thread
1 parent 7b4f5d4 commit 54338e6

File tree

1 file changed

+3
-2
lines changed
  • subsys/bluetooth/host

1 file changed

+3
-2
lines changed

subsys/bluetooth/host/att.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,15 @@ static void att_tx_destroy_work_handler(struct k_work *work)
285285
}
286286

287287
if (!sys_slist_is_empty(&tx_destroy_queue)) {
288-
k_work_submit(&att_tx_destroy_work);
288+
k_work_submit_to_queue(bt_workq_chosen, &att_tx_destroy_work);
289289
}
290290
}
291291

292292
static void att_tx_destroy(struct net_buf *buf)
293293
{
294+
/* We need to invoke `att_on_sent_cb` which may block. Defer to bt_workq. */
294295
net_buf_slist_put(&tx_destroy_queue, buf);
295-
k_work_submit(&att_tx_destroy_work);
296+
k_work_submit_to_queue(bt_workq_chosen, &att_tx_destroy_work); /* att_tx_destroy_work_handler */
296297
}
297298

298299
NET_BUF_POOL_DEFINE(att_pool, CONFIG_BT_ATT_TX_COUNT,

0 commit comments

Comments
 (0)