Bluetooth: host: Document not waiting for TX context from sys workqueue

Document the GATT APIs not waiting for TX context when being called
from the system workqueue context. This is because the TX contexts
are freed by the system workqueue so blocking would cause a deadlock.

The number of TX contexts are by default equal to the number of
TX buffers in the system. Since TX contexts is allocated after a buffer,
but freed from a lower priority than the buffer then there can be more
allocated TX contexts than TX buffers.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2021-03-01 11:41:51 +01:00 committed by Carles Cufí
parent 9d09d21627
commit a9a7e27b21

View file

@ -906,6 +906,10 @@ struct bt_gatt_notify_params {
* callback function will be called.
*
* The callback is run from System Workqueue context.
* When called from the System Workqueue context this API will not wait for
* resources for the callback but instead return an error.
* The number of pending callbacks can be increased with the
* @option{CONFIG_BT_CONN_TX_MAX} option.
*
* Alternatively it is possible to notify by UUID by setting it on the
* parameters, when using this method the attribute given is used as the
@ -920,6 +924,8 @@ int bt_gatt_notify_cb(struct bt_conn *conn,
struct bt_gatt_notify_params *params);
/** @brief Notify multiple attribute value change.
*
* This function works in the same way as @ref bt_gatt_notify_cb.
*
* @param conn Connection object.
* @param num_params Number of notification parameters.
@ -1367,6 +1373,11 @@ int bt_gatt_write(struct bt_conn *conn, struct bt_gatt_write_params *params);
* called.
*
* The callback is run from System Workqueue context.
* When called from the System Workqueue context this API will not wait for
* resources for the callback but instead return an error.
* The number of pending callbacks can be increased with the
* @option{CONFIG_BT_CONN_TX_MAX} option.
*
* @note By using a callback it also disable the internal flow control
* which would prevent sending multiple commands without waiting for