Skip to content

Bluetooth: ISO: Cleanup BIG before stopped callback #93324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thalley
Copy link
Contributor

@Thalley Thalley commented Jul 18, 2025

Modify the big_disconnect function to do cleanup_big before
calling the stopped callback. This will allow the ISO channels,
as well as the BIG itself, to be reused for other purposes directly
in the stopped callback, without having to offload such actions
to a separate thread.

@Thalley Thalley requested a review from Copilot July 18, 2025 12:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the BIG (Broadcast Isochronous Group) disconnection sequence to perform cleanup before invoking the stopped callback, allowing callers to immediately reuse BIG and ISO channel resources. The key changes include:

  • Moved cleanup_big() call inside big_disconnect() to occur before the stopped callback
  • Added special handling for BIS (Broadcast Isochronous Stream) TX completion cleanup
  • Added assertion to prevent workqueue corruption during connection initialization

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
subsys/bluetooth/host/iso.c Core change: moves cleanup_big() into big_disconnect() and adds BIS TX completion handling
subsys/bluetooth/host/conn.c Adds assertion to prevent workqueue corruption during connection initialization
tests/bluetooth/host/conn/mocks/kernel.h Adds mock declaration for k_work_busy_get function
tests/bluetooth/host/conn/mocks/kernel.c Adds mock implementation for k_work_busy_get function

@Thalley Thalley force-pushed the big_cleanup_before_stopped branch from 0079caf to 1412438 Compare July 29, 2025 09:21
@Thalley Thalley force-pushed the big_cleanup_before_stopped branch 2 times, most recently from 03333fe to 30a9dee Compare August 4, 2025 10:01
@Thalley Thalley marked this pull request as ready for review August 4, 2025 10:01
@zephyrbot zephyrbot added area: Bluetooth ISO Bluetooth LE Isochronous Channels area: Bluetooth labels Aug 4, 2025
Modify the big_disconnect function to do cleanup_big before
calling the `stopped` callback. This will allow the ISO channels,
as well as the BIG itself, to be reused for other purposes directly
in the stopped callback, without having to offload such actions
to a separate thread.

Signed-off-by: Emil Gydesen <[email protected]>
@Thalley Thalley force-pushed the big_cleanup_before_stopped branch from 30a9dee to dcd1e6a Compare August 15, 2025 08:34
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth ISO Bluetooth LE Isochronous Channels area: Bluetooth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants