Bluetooth: Host: bt_iso_reset before bt_conn_cleanup_all #97439
+4
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move the call to bt_iso_reset to before bt_conn_cleanup_all. The reason for this is that bt_conn_cleanup_all will disconnect all the ACL connections, which will put the CIS in a disconnecting state, without finalizing them.
This means that if we get a num_completed_packet event between the call to bt_conn_cleanup_all and before the BT_HCI_OP_RESET request has been completed, we will trigger an assert in the hci_num_completed_packets function as the CIS still exists, but where we would already have cleaned up the pending TX without telling the controller.
Moving the call to bt_iso_reset means that the CIS will have been fully terminated at this point, which will prevent the assert from happening. Since CIS depends on ACLs, this is also the logical order for resetting them.