public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/5] Bluetooth: ISO: Don't initiate CIS connections if there are no buffers
@ 2025-08-13 21:15 Luiz Augusto von Dentz
  2025-08-13 21:15 ` [PATCH v3 2/5] Bluetooth: HCI: Fix using LE/ACL buffers for ISO packets Luiz Augusto von Dentz
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Luiz Augusto von Dentz @ 2025-08-13 21:15 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If the controller has no buffers left return -ENOBUFF to indicate that
iso_cnt might be out of sync.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/iso.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 5ce823ca3aaf..dff3fc4917d6 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -458,6 +458,13 @@ static int iso_connect_cis(struct sock *sk)
 		goto unlock;
 	}
 
+	/* Check if there are available buffers for output/TX. */
+	if (iso_pi(sk)->qos.ucast.out.sdu && !hci_conn_num(hdev, CIS_LINK) &&
+	    (hdev->iso_pkts && !hdev->iso_cnt)) {
+		err = -ENOBUFS;
+		goto unlock;
+	}
+
 	/* Just bind if DEFER_SETUP has been set */
 	if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) {
 		hcon = hci_bind_cis(hdev, &iso_pi(sk)->dst,
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-08-14 15:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 21:15 [PATCH v3 1/5] Bluetooth: ISO: Don't initiate CIS connections if there are no buffers Luiz Augusto von Dentz
2025-08-13 21:15 ` [PATCH v3 2/5] Bluetooth: HCI: Fix using LE/ACL buffers for ISO packets Luiz Augusto von Dentz
2025-08-13 21:15 ` [PATCH v3 3/5] Bluetooth: hci_conn: Make unacked packet handling more robust Luiz Augusto von Dentz
2025-08-14 15:30   ` Pauli Virtanen
2025-08-14 15:45     ` Luiz Augusto von Dentz
2025-08-13 21:15 ` [PATCH v3 4/5] Bluetooth: ISO: Use sk_sndtimeo as conn_timeout Luiz Augusto von Dentz
2025-08-13 21:15 ` [PATCH v3 5/5] Bluetooth: hci_core: Detect if an ISO link has stalled Luiz Augusto von Dentz
2025-08-13 21:28 ` [PATCH v3 1/5] Bluetooth: ISO: Don't initiate CIS connections if there are no buffers Paul Menzel
2025-08-13 21:59 ` [v3,1/5] " bluez.test.bot
2025-08-14 15:26 ` [PATCH v3 1/5] " Pauli Virtanen
2025-08-14 15:44   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox