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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 29 Jun 2023 17:52:18 +0000 (10:52 -0700)
commit6b9545dc9f8ff01d8bc1229103960d9cd265343f
tree48f68675f802c512748ade8944c3c1a4da03b4e5
parent56b7f325db139c9255b1eb1d1e741576d5f8fa34
Bluetooth: ISO: use hci_sync for setting CIG parameters

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>
net/bluetooth/hci_conn.c