]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: ISO: Fix defer tests being unstable
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 27 Feb 2026 20:23:01 +0000 (15:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2026 10:08:52 +0000 (11:08 +0100)
[ Upstream commit 62bcaa6b351b6dc400f6c6b83762001fd9f5c12d ]

iso-tester defer tests seem to fail with hci_conn_hash_lookup_cig
being unable to resolve a cig in set_cig_params_sync due a race
where it is run immediatelly before hci_bind_cis is able to set
the QoS settings into the hci_conn object.

So this moves the assigning of the QoS settings to be done directly
by hci_le_set_cig_params to prevent that from happening again.

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_conn.c

index fa74fac5af778a35633032b00224e86299f786ac..447d29c67e7c1b2481dd9796bb2256afd5b5f680 100644 (file)
@@ -1868,6 +1868,8 @@ static bool hci_le_set_cig_params(struct hci_conn *conn, struct bt_iso_qos *qos)
                return false;
 
 done:
+       conn->iso_qos = *qos;
+
        if (hci_cmd_sync_queue(hdev, set_cig_params_sync,
                               UINT_PTR(qos->ucast.cig), NULL) < 0)
                return false;
@@ -1934,8 +1936,6 @@ struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
        }
 
        hci_conn_hold(cis);
-
-       cis->iso_qos = *qos;
        cis->state = BT_BOUND;
 
        return cis;