Skip to content

Bluetooth: hci_bcm4377: cap the ACL MTU at what the ACL ring takes - #3138

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
kazuhidet:j715/bcm4377-acl-mtu
Nov 25, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
kazuhidet:j715/bcm4377-acl-mtu

Conversation

@kazuhidet

Copy link
Copy Markdown
Contributor

What: hci_bcm4377 drops every outgoing ACL fragment above 1032 bytes, because the core fragments to the controller's reported ACL MTU (2586 on the J715) while the driver's ACL ring takes at most 1032. Cap acl_mtu and le_mtu at HCI_MAX_ACL_SIZE after init.
Tested: J715 M4 Air, the everyday 7.3.0-j715-aurora+ with this change as a module: ACL MTU 2586 → 1024, 0 refused frames, Bluetooth tethering to an Android phone with 5 MB downloads 4/4 and 2 MB uploads 4/4. Without it, the same test refused 16 frames and failed 2 of 2 second downloads. Not booted from this PR's head.
Risk: two-way · Macs with hci_bcm4377 whose controller reports an ACL MTU above 1024; no change where it reports 1024 or less (M1 J293: 1021)
Not yet: a boot at this head; J713 and other M3/M4 Macs (their reported MTU isn't checked); mainline.

Details
  • The limit.
    • Ring 5 is BCM4377_XFER_RING_ACL_H2D. It has no in-place payload, and its mapped payload is MAX_ACL_PAYLOAD_SIZE: HCI_MAX_FRAME_SIZE + HCI_ACL_HDR_SIZE = 1032.
    • bcm4377_enqueue() returns -EINVAL for anything larger, so the core logs sending frame failed (-22) and the fragment is lost.
  • The MTU.
    • hci_cc_read_buffer_size() takes acl_mtu from the controller, and L2CAP fragments outgoing data to it.
    • On the J715 the controller reports 2586. On an M1 MacBook Pro (J293, BCM4378) it reports 1021, which is why this hasn't shown on M1.
  • Why post_init. hci_dev_init_sync() calls it after hci_init_sync(), so after Read Buffer Size and LE Read Buffer Size, and before any connection. It runs on every power-on, so a re-read is capped again.
  • Alternative not taken: larger mapped payloads for ring 5. That would use the controller's full MTU, but I don't know what payload sizes the firmware accepts, so I haven't tried it.
  • Why it hasn't shown in audio: HFP voice uses the SCO ring. A2DP media packets are usually below 1024 bytes, but I haven't measured them.
  • Mainline has the same ring size and no MTU cap. Its driver has no post_init, so a mainline version would add one for this.
Evidence

J715 (MacBook Air 15-inch, M4), OS firmware 26.6.2. Everyday kernel 7.3.0-j715-aurora+ (integration/aurora 0abc2f3 + local J715 patches, none in Bluetooth). The change was built as an hci_bcm4377.ko against that tree, with the same lines as this PR. It was installed into updates/, the J715 was rebooted, and then it was rolled back.

ACL MTU, read with HCIGETDEVINFO:

acl_mtu largest ACL frame ring 5 limit
stock driver 2586 2590 1032
with this change 1024 1028 1032
after rollback 2586 2590 1032

With this change, the kernel logs once: hci_bcm4377 0000:01:00.1: controller ACL MTU 2586 exceeds the ACL ring's 1024, using 1024. There's no LE line, so le_mtu was not above 1024.

Bluetooth tethering, J715 as PANU, Android 17 phone as NAP. Each run is 2 cycles of connect, DHCP, 10 pings to the phone and to 1.1.1.1, a 5 MB HTTPS download and (with the change) a 2 MB HTTPS upload, then disconnect:

stock driver (2 runs) with this change (2 runs)
connect 4 of 5 (one failed after link tx timeout, killing stalled connection) 4 of 4
ping (phone, 1.1.1.1) 40/40, 40/40 40/40, 40/40
5 MB download first of each run: completed once (88 KB/s), stopped once by the 60 s limit at 4.7 MB; second of each run failed after about 15 s, 2 of 2 4 of 4 (107–157 KB/s)
2 MB upload not run 4 of 4 (89–127 KB/s)
too large for ring 5 16 0
  • Regression, with the change: a headset reconnected (A2DP and AVRCP set up; no audio played), and a 15 s LE scan found 48 devices.
  • On main at 34bdf7124b77: builds with W=1 and no warnings; checkpatch.pl: 0 errors, 0 warnings.

The host-to-controller ACL ring is set up with a mapped payload of
MAX_ACL_PAYLOAD_SIZE (HCI_MAX_ACL_SIZE of data plus the header), and
bcm4377_enqueue() refuses anything larger. The core fragments outgoing
ACL data to the MTU the controller reports in Read Buffer Size, which
the driver doesn't limit. On a 15-inch M4 MacBook Air (J715) the
controller reports an ACL MTU of 2586, so every fragment above 1028
bytes is dropped:

  hci_bcm4377 0000:01:00.1: payload len 1451 is too large for ring 5 (max is 0 or 1032)
  Bluetooth: hci0: sending frame failed (-22)

Small traffic gets through, but anything that sends full-size
fragments breaks. Over Bluetooth tethering (BNEP), HTTPS transfers
stall and fail, and the ACL link can stall until it is killed.

Cap acl_mtu and le_mtu at HCI_MAX_ACL_SIZE in post_init, which runs
after the init sequence has read the buffer sizes and before any
connection. Sending fragments smaller than the controller allows is
always valid. A controller that reports 1024 or less, like the M1's
(1021), is unaffected.

Signed-off-by: Kazuhide Takahashi <[email protected]>
@kazuhidet
kazuhidet requested review from a team as code owners November 25, 2026 07:48
@github-actions github-actions Bot added area:wireless Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 2fcf03cc: ready to merge

Check Detail
CI at head ok no CI for this change (the hardware row is the gate)
Review ok approved by satchlj
Requested changes ok none
Hardware row at head ok comment at 2fcf03cc
Conflicts ok none
PR text ok Risk: two-way · Macs with hcibcm4377 whose controller reports an ACL MTU above 1024; no change where it reports 1024 or less (M1 J293: 1021)

Areas: area:wireless
Merge: gh pr merge 3138 --merge (Owners and Core through the bypass: add --admin).

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

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: MERGE at 2fcf03ccec62

Blockers: none

Checked: Full diff in drivers/bluetooth/hci_bcm4377.c, exact-head hardware row, and live CI status.

Evidence
  • Audited the 45-line diff capping ACL MTU to the ACL ring capacity in hci_bcm4377.c; bounds and existing ring invariants are preserved.
  • Exact-head hardware verification and all CI checks on 2fcf03ccec62 are green.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Nov 25, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

2fcf03ccec62 J615 (M3 Air 15", BCM4388) + J316s (M1 Pro, BCM4387) PASS:

  • J615 (stock baseline acl_mtu=2764, trial 7.3.0-aurora-pr2899-3138, boot_id=62abaaac-d21d-460b-9f78-46c7da4746be, default cmdline): hci_bcm4377 logged controller ACL MTU 2764 exceeds the ACL ring's 1024, using 1024 on cold boot and after btmgmt power off/on; HCIGETDEVINFO read acl_mtu=1024 acl_pkts=8 pre/post power-cycle and after rtc0 s2idle 1/1; 5 s BLE scan discovered nearby devices; 0 BT drop errors, 0 AVC, 0 failed units, Enforcing; restored saved 7.3.0-aurora-fleet85 (d6df27ce-6b1d-4616-a5b6-c0b6cc732691).
  • J316s (stock baseline acl_mtu=2586, trial 7.3.0-aurora-pr2899-3138, boot_id=273a6bbb-50a5-4b8a-bccb-a7e0798a5859, default cmdline): hci_bcm4377 logged controller ACL MTU 2586 exceeds the ACL ring's 1024, using 1024 on cold boot and after btmgmt power off/on; HCIGETDEVINFO read acl_mtu=1024 acl_pkts=8 pre/post power-cycle and after rtc1 s2idle 1/1; 5 s BLE scan discovered nearby devices; GL (Apple M1 Pro (G13S C0)) + Borealis VK (cases=1 rc=0) ok; 0 BT drop errors, 0 AVC, 0 failed units, Enforcing; restored saved 7.3.0-aurora-fleet89 (1e624810-eb26-474c-ad80-9b53a98fb0e1).

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 25, 2026
@DjDeveloperr
DjDeveloperr merged commit 0d812c5 into aurora-silicon:main Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:wireless Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants