Skip to content

Bluetooth: btcentauri_t6050: skip malformed RX descriptors and fall back to host duplicate filtering - #3945

Merged
DjDeveloperr merged 2 commits into
aurora-silicon:mainfrom
tully-8888:fix/t6050-bt-rx-descriptors
Dec 2, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-silicon:mainfrom
tully-8888:fix/t6050-bt-rx-descriptors

Conversation

@tully-8888

@tully-8888 tully-8888 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What: Two error path fixes in the t6050 Bluetooth transport. One malformed RX descriptor stopped Bluetooth until the module was reloaded; it is now counted, logged and handed back to the firmware. When the firmware refuses the vendor command that flushes its duplicate filter, LE scanning no longer fails; the host filters duplicate reports instead.
Tested: J714s (MacBook Pro 14-inch, M5 Pro) at 4ce92d0, loaded as a module next to the stock Wi-Fi module on a local 7.3 kernel: controller powered, btmgmt find -l found 34, 34 and 31 LE devices in 3 scans, no Bluetooth kernel errors.
Risk: two-way door · Macs that bind btcentauri_t6050 (M5 Pro, M5 Max)
Not yet: neither error path was hit on hardware; both bugs were found by reading the code. CI runs no Apple build for this PR, because drivers/bluetooth/** is not in the apple-build path filter; the only build is the local one under Evidence.

Details

RX descriptors: the work handler cleared running on a bad event length and left HCI registered. The bad descriptor stayed at rx_head, so a reset or reopen hit it again. The LE ACL ring and the auxiliary ACL, SCO and ISO rings did the same for a length above the footer. Such a descriptor now counts as an RX error, is logged rate limited, and its slot goes back to the firmware like a consumed packet. An invalid ring index still stops the transport.

Duplicate filter: reset_dup_filter returned the firmware's refusal, and hci_sync gave up before LE Scan Enable. For Unknown Command, Command Disallowed, Unsupported Feature and Invalid Parameters the driver now logs once, remembers it and returns 0. While that fallback is set, it clears Filter_Duplicates in the copy of LE Set Scan Enable and LE Set Extended Scan Enable written to the command ring. Send, cancel and timeout errors are still returned.

Evidence

At 4ce92d0 on the J714s, module built against the running kernel and swapped in live (the module showed the out-of-tree taint, so this build ran): controller powered in all 3 checks, btmgmt find -l 34 / 34 / 31 LE devices. The only Bluetooth kernel line is HCI Enhanced Setup Synchronous Connection command is advertised, but not supported, which the stock module prints on every load too.

Earlier, on a local 7.3 kernel with the same driver file:

Check Before With the change
btmgmt find -l, LE devices, 3 scans 16 / 18 / 13 12 / 14 / 13
Controller powered powered
Bluetooth kernel errors 0 0

The LE device count follows the devices in the room, not the driver. An earlier module swap in the same session found 10 / 11 / 10 and 16 / 17 / 15 with the change, around a stock block of 16 / 18 / 13.

At this head: make LLVM=1 W=1 module build of btcentauri_t6050.o with 0 warnings; checkpatch.pl --strict on both commits: 0 errors, 0 warnings.

One event descriptor with a bad length stopped the transport: the work
handler cleared running and left HCI registered. The bad descriptor
stayed at rx_head, so a reset or reopen hit it again and Bluetooth was
dead until the module was reloaded. The LE ACL ring and the auxiliary
ACL, SCO and ISO rings did the same for a length above the footer.

Count such a descriptor as an RX error, log it rate-limited, and return
the slot to the firmware the same way as a consumed packet. An invalid
ring index still stops the transport.

Signed-off-by: vlad <tulituvlad@gmail.com>
When the firmware refuses the vendor command that flushes its duplicate
filter, reset_dup_filter returned the error and hci_sync gave up before
sending LE Scan Enable. LE scanning then failed, so BLE discovery and
HID reconnects did not work.

A refusal arrives as a negative errno from bt_to_errno(). For Unknown
Command, Command Disallowed, Unsupported Feature and Invalid Parameters,
log it once, remember it and return 0. While the fallback is set, clear
Filter_Duplicates in the copy of LE Set Scan Enable and LE Set Extended
Scan Enable written to the command ring, so the host handles repeated
reports. Send, cancel and timeout errors are still returned.

Signed-off-by: vlad <tulituvlad@gmail.com>
@tully-8888
tully-8888 marked this pull request as ready for review December 2, 2026 17:12
@tully-8888
tully-8888 requested review from a team as code owners December 2, 2026 17:12
@github-actions github-actions Bot added blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Merge readiness at 4ce92d06: not ready yet

Check Detail
CI at head ok 1 check passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 4ce92d06
Conflicts ok none
PR text ok Risk: two-way · Macs that bind btcentaurit6050 (M5 Pro, M5 Max)

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed at 4ce92d06cd6d (non-author, 12-01 bar).

Malformed RX descriptors on event, LE ACL, and aux rings now count err_rx, rate-limit log, and advance/repost the slot instead of wedging the transport while keeping invalid ring indices fatal. cen_hci_reset_dup_filter() catches only the four firmware-refusal errnos (-EBADRQC, -EBUSY, -EOPNOTSUPP, -EINVAL), passes transport/timeout errors through, and clears byte 4 (Filter_Duplicates) on enabled LE_SET_SCAN_ENABLE / LE_SET_EXT_SCAN_ENABLE commands (guarded by skb->len >= 5). Exact-head J714s row at 4ce92d06cd6d passes (3 LE scans, 0 Bluetooth errors).

@DjDeveloperr
DjDeveloperr merged commit f345d04 into aurora-silicon:main Dec 2, 2026
2 checks passed
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merged as f345d04 (gh pr merge 3945 --merge --match-head-commit 4ce92d06). Hosted CI didn't build this PR, because drivers/bluetooth/** isn't in the apple-build path filter. I ran the equivalent build on pc instead.

Tree: main 2f5b01a merged with #3944 (a040d04) and #3945 (4ce92d0), giving local merge c1d4e460 (tree 3388cb36). Both merges were clean with git merge-tree --write-tree --merge-base=8616760e. Main has since gained #3944 and 8 other commits (drm/asahi Rust, sched/psi.c, a clpc host test, one t602x dts line), and none of the 8 touch this file. The landed btcentauri_t6050.c (blob d044a66e) is byte-identical to the one built.

Build: arm64 aurora_defconfig, byte-identical to a fresh one, with BT_HCICENTAURI=m. Toolchain clang 23.1.3 and rustc 1.100.1. It was an incremental build from a warm main 048505b output.

  • make ARCH=arm64 LLVM=1 CROSS_COMPILE=aarch64-linux-gnu- Image modules: rc 0. btcentauri_t6050.o was rebuilt and btcentauri_t6050.ko linked (depends=apple_centauri_t6050,bluetooth). modpost ran over every module with no errors and no warnings for this module. The only warnings are 4 old "missing MODULE_DESCRIPTION" ones on unrelated test modules.
  • make ... W=1 drivers/bluetooth/btcentauri_t6050.o: rc 0, 0 warnings.
  • scripts/checkpatch.pl --strict on c1d23e2 and 4ce92d0: 0 errors, 0 warnings, 0 checks each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants