linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pauli Virtanen <pav@iki.fi>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.dentz@gmail.com, Pauli Virtanen <pav@iki.fi>
Subject: [PATCH v2 2/4] Bluetooth: ISO: don't try to remove CIG if there are bound CIS left
Date: Thu,  1 Jun 2023 09:34:44 +0300	[thread overview]
Message-ID: <137e16ab38ea84a02241385e6622497de52ce9a3.1685565568.git.pav@iki.fi> (raw)
In-Reply-To: <cover.1685565568.git.pav@iki.fi>

Consider existing BOUND & CONNECT state CIS to block CIG removal.
Otherwise, under suitable timing conditions we may attempt to remove CIG
while Create CIS is pending, which fails.

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
---

Notes:
    v2: no changes

 net/bluetooth/hci_conn.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index f45476deca82..15cba23ade52 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -983,6 +983,8 @@ static void cis_cleanup(struct hci_conn *conn)
 	/* Check if ISO connection is a CIS and remove CIG if there are
 	 * no other connections using it.
 	 */
+	hci_conn_hash_list_state(hdev, find_cis, ISO_LINK, BT_BOUND, &d);
+	hci_conn_hash_list_state(hdev, find_cis, ISO_LINK, BT_CONNECT, &d);
 	hci_conn_hash_list_state(hdev, find_cis, ISO_LINK, BT_CONNECTED, &d);
 	if (d.count)
 		return;
-- 
2.40.1


  parent reply	other threads:[~2023-06-01  6:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01  6:34 [PATCH v2 0/4] LE Set CIG Parameters / Create CIS fixes Pauli Virtanen
2023-06-01  6:34 ` [PATCH v2 1/4] Bluetooth: ISO: use hci_sync for setting CIG parameters Pauli Virtanen
2023-06-01  7:36   ` LE Set CIG Parameters / Create CIS fixes bluez.test.bot
2023-06-01  6:34 ` Pauli Virtanen [this message]
2023-06-01  6:34 ` [PATCH v2 3/4] Bluetooth: ISO: use correct CIS order in Set CIG Parameters event Pauli Virtanen
2023-06-01  6:34 ` [PATCH v2 4/4] Bluetooth: ISO: do not emit new LE Create CIS if previous is pending Pauli Virtanen
2023-06-02 20:30 ` [PATCH v2 0/4] LE Set CIG Parameters / Create CIS fixes patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=137e16ab38ea84a02241385e6622497de52ce9a3.1685565568.git.pav@iki.fi \
    --to=pav@iki.fi \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).