Bluetooth: ISO: use hci_sync for setting CIG parameters
authorPauli Virtanen <pav@iki.fi>
Thu, 1 Jun 2023 06:34:43 +0000 (09:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:22:02 +0000 (16:22 +0200)
commit4aa515393f02f69cb33121f8aac9078c6c925297
tree211a21a9dce3de9b2cf0d6a14adaa569735e6d67
parent018b12ff1661f5542133091daf740b1408337bf3
Bluetooth: ISO: use hci_sync for setting CIG parameters

[ Upstream commit 6b9545dc9f8ff01d8bc1229103960d9cd265343f ]

When reconfiguring CIG after disconnection of the last CIS, LE Remove
CIG shall be sent before LE Set CIG Parameters.  Otherwise, it fails
because CIG is in the inactive state and not configurable (Core v5.3
Vol 6 Part B Sec. 4.5.14.3). This ordering is currently wrong under
suitable timing conditions, because LE Remove CIG is sent via the
hci_sync queue and may be delayed, but Set CIG Parameters is via
hci_send_cmd.

Make the ordering well-defined by sending also Set CIG Parameters via
hci_sync.

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