Skip to content

[follow-up to #176] Bluetooth: mt7932: accept nonzero HCI registration indices - #199

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
fix/pr176-review
Oct 8, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
fix/pr176-review

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

hci_register_dev returns a nonnegative controller index on success.
Treating every nonzero value as an error leaves a successfully published
controller with registered=false. Removal then skips hci_unregister_dev
and frees its callback state while the HCI core still owns the controller.

Reject only negative registration results so every published controller
is tracked and unregistered before transport and callback state cleanup.
The PCI probe continues to return zero for a successful registration.

Follow-up to #176; original contributor commits are preserved. These fixes are based on public Linux/PR source and Linux-side tests.

Validation: targeted arm64 driver build passed (object checks only); strict checkpatch passed for the final code changes with only the required Assisted-by trailer diagnostic excluded. Deterministic source-extracted regression tests passed, with the original implementation failing the relevant negative control.

Hardware qualification on aurora-edge is pending. No boot, suspend, fault-injection or firmware recovery pass is claimed. The publication gate is separate from runtime acceptance.

🤖 Generated with Claude Code

The MT7932 PCIe transport cannot be selected with modular Bluetooth or
system sleep enabled. Make the existing transport tristate and coordinate
firmware quiescence with HCI suspend before PCI power transitions.

Wait for the firmware's system-sleep acknowledgment before completing
suspend. Restore the transport before resuming HCI, and undo the sleep
request if suspend fails. Keep ring publication stopped while quiesced
and preserve the DMA arena across sleep. Invalid notifications and failed
restoration close the transport instead of retrying an uncertain state.

Unregister HCI, quiesce firmware and synchronize transport work and
interrupts on removal.
Release device-visible storage only after bus mastering is disabled and
pending PCI transactions drain; retain it if that cannot be confirmed.
Hibernation, firmware recovery and warm reprobe remain unsupported.

This extends the existing MT7932 transport and preserves its contributor
notices and firmware/calibration path.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
hci_register_dev returns a nonnegative controller index on success.
Treating every nonzero value as an error leaves a successfully published
controller with registered=false. Removal then skips hci_unregister_dev
and frees its callback state while the HCI core still owns the controller.

Reject only negative registration results so every published controller
is tracked and unregistered before transport and callback state cleanup.
The PCI probe continues to return zero for a successful registration.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit 1fce6d2 into aurora-wip Oct 8, 2026
@RyanTheTide
RyanTheTide deleted the fix/pr176-review branch October 8, 2026 10:22
scottjones added a commit to scottjones/linux that referenced this pull request Nov 17, 2026
garymeyerca's 4433ef5 (aurora-silicon#199) makes the J613 (13-inch M3 MacBook Air) use
temporal filter 0 on ISP firmware 14.7, where filter 1 delivers no
frames. The J615 (15-inch) has the same sensor and ISP configuration:
t8122-j615.dts includes isp-imx558-cfg0.dtsi and sets platform-id 18 and
temporal-filter 1, exactly as t8122-j613.dts does. So it very likely
stalls the same way.

Apply the workaround to the J615 too. This is untested on a J615; the
J613 result is from 7.2.11 with Gary's series.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Scott Jones <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant