Bluetooth: request LE data length for MT7922
Subsystems (3)
PATCH v3 1/1 Bluetooth: request LE data length for MT7922
MT7922 USB firmware can accept maximum LE suggested default data lengths without negotiating a larger transmit data length on a new connection. On an ASUS G614PR with USB ID 0489:e0f6 and firmware 20260724143815, ASHA playback remains choppy until an explicit LE Set Data Length request. A request on the same Cochlear Nucleus 8 connection raises delivery from 21.5 to 50 audio SDUs/s and reduces peak outstanding packets from 32 to 3.
Set a quirk for MT7922 in USB setup and request the current suggested defaults after successful remote feature exchange on central-role links. Require local and remote DLE support and the LE Set Data Length command. Keep suggested-default initialization and PHY negotiation unchanged.
Do not restrict the workaround to the tested firmware build or OEM USB
ID: the affected firmware range has not been confirmed. Other MediaTek chips do not enable the quirk. The request also applies to 1M peers that support DLE, and ordinary link-layer negotiation determines the result.
Hold a connection reference while queued and revalidate its membership, state, role and capabilities before sending. Release the reference on completion, cancellation or queue failure. A failed optional request does not reject connection setup.
---
Changes in v3: move personal correspondence out of the commit message; no source changes. Previous version: https://lore.kernel.org/linux-bluetooth/[email protected]/
Hi Luiz,
Since there hasn't been a response from
the MediaTek folks in over 5 weeks I've gone
ahead and prepared this v2 quirk patch that
will work for USB MT7922 controllers.
Thanks,
Kyle Pepper
Contingency revision: MediaTek has been asked about a firmware fix and its affected scope. No reply has been received as of November 23. This does not establish that a firmware fix is unavailable or that every MT7922 firmware release is affected. A firmware fix remains preferable.
Changes in v2:
- Match MT7922 in USB setup, without a firmware-build or OEM USB-ID gate.
- Remove firmware-header matching and its setup-time clear/recheck logic.
- Rebase on current bluetooth-next; retain guarded referenced queue work.
Previous patch:
https://lore.kernel.org/linux-bluetooth/[email protected]/
Luiz requested checking firmware-fix plans and avoiding a single-build gate unless MediaTek confirms an image-specific regression. This v2 is prepared in case a validated firmware fix is not forthcoming; his reply is conditional guidance, not an Acked-by or approval of this revision.
Historical evidence: manual same-link request on 0489:e0f6 with firmware 20260724143815 gave 21.5 -> 50 SDUs/s. Automatic requests worked in the local patched 7.2.9 stack. No new hardware result is claimed for v2, for other firmware/OEM boards, or for vanilla upstream. Suspend/resume, other profiles, native concurrency and power regressions remain untested.
Local validation on base ffb95458a0f7: GCC and Clang baseline/candidate builds each compile four Bluetooth objects with W=1 and zero warnings. 82 source-extracted ASan/UBSan controls pass; the baseline and five mutation controls detect missing behavior and guards. LeakSanitizer is disabled because the command runner uses ptrace; these are model tests. Source-only strict checkpatch is clean. Stock full-mail checkpatch flags the retained Assisted-by trailers as BAD_SIGN_OFF. No checker is changed or attribution removed; remote CI and human-signed mail remain unchecked.
No introducing kernel commit has been established for this firmware bug, so no Fixes or stable tag is inferred. No extra patch/MR dependency. Human review and DCO sign-off are required before publication.
AI assistance: the retained request/queue implementation originated with OpenCode:gpt-6.1-sol. Codex adapted matching, rebased it, and prepared this message, review notes and offline validation in response to Luiz's review.
drivers/bluetooth/btmtk.c | 4 +++ include/net/bluetooth/hci.h | 5 +++ include/net/bluetooth/hci_sync.h | 1 + net/bluetooth/hci_event.c | 8 +++++ net/bluetooth/hci_sync.c | 58 ++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+)
drivers/bluetooth/btmtk.c +4 -0
@@ -1858,6 +1858,10 @@ int btmtk_usb_setup(struct hci_dev *hdev) btmtk_data->dev_id = dev_id; +/* MT7922 needs per-link requests despite suggested defaults. */ +if (dev_id ==0x7922 ) +hci_set_quirk (hdev,HCI_QUIRK_NEEDS_LE_SET_DATA_LEN ); + err =btmtk_register_coredump (hdev, btmtk_data->drv_name, fw_version);if (err <0 )bt_dev_err (hdev,"Failed to register coredump (%d)" , err);
include/net/bluetooth/hci.h +5 -0
@@ -348,6 +348,11 @@ enum {*/ HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE , +/* The controller needs an explicit LE Set Data Length request for +* each central-role connection despite accepting suggested defaults. +*/ + HCI_QUIRK_NEEDS_LE_SET_DATA_LEN, +/* * When this quirk is set, the reserved bits of Primary/Secondary_PHY * inside the LE Extended Advertising Report events are discarded.
include/net/bluetooth/hci_sync.h +1 -0
@@ -195,6 +195,7 @@ int hci_le_read_remote_features(struct hci_conn *conn);int hci_acl_change_pkt_type (struct hci_conn *conn,u16 pkt_type);int hci_le_set_phy (struct hci_conn *conn,u8 tx_phys,u8 rx_phys,u16 phy_opts); +int hci_le_set_data_len (struct hci_conn *conn);int hci_le_set_cig_params_sync (struct hci_dev *hdev,u8 cig_id);int hci_le_create_big_sync (struct hci_conn *conn,struct bt_iso_qos_ext *qos,u8 num_bis);
net/bluetooth/hci_event.c +8 -0
@@ -7436,6 +7436,14 @@ static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, void *data,*/ conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_HDT ; conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_HDT ; + +if (hci_test_quirk (hdev,HCI_QUIRK_NEEDS_LE_SET_DATA_LEN ) && + conn->role ==HCI_ROLE_MASTER && + (hdev->commands[33 ] &BIT (6 )) && + (hdev->le_features[0 ] &HCI_LE_DATA_LEN_EXT ) && + (conn->le_features[0 ] &HCI_LE_DATA_LEN_EXT ) && + hdev->le_def_tx_len >27 ) +hci_le_set_data_len (conn); }if (conn->state ==BT_CONFIG ) {
net/bluetooth/hci_sync.c +58 -0
61 lines not on this page · raw message
base-commit: ffb95458a0f70dcab620eee0ecf5ef7750971b2f
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1220185/
---Test result---
Test Summary:
CheckPatch FAIL 1.46 seconds VerifyFixes PASS 0.10 seconds VerifySignedoff PASS 0.10 seconds GitLint FAIL 0.28 seconds SubjectPrefix PASS 0.09 seconds BuildKernel PASS 29.14 seconds CheckAllWarning PASS 32.88 seconds CheckSparse WARNING 35.15 seconds BuildKernel32 PASS 29.21 seconds CheckKernelLLVM PASS 31.26 seconds TestRunnerSetup PASS 676.98 seconds TestRunner_l2cap-tester PASS 16.66 seconds TestRunner_iso-tester PASS 14.91 seconds TestRunner_bnep-tester PASS 3.05 seconds TestRunner_mgmt-tester PASS 87.78 seconds TestRunner_rfcomm-tester PASS 4.39 seconds TestRunner_sco-tester PASS 5.49 seconds TestRunner_ioctl-tester PASS 4.54 seconds TestRunner_mesh-tester PASS 4.40 seconds TestRunner_smp-tester PASS 4.27 seconds TestRunner_userchan-tester PASS 3.19 seconds TestRunner_6lowpan-tester PASS 4.33 seconds IncrementalBuild PASS 27.15 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v3] Bluetooth: request LE data length for MT7922
WARNING: Non-standard signature: Assisted-by:
#104:
ERROR: Unrecognized email address: 'OpenCode:gpt-6.1-sol' #104:
WARNING: Non-standard signature: Assisted-by:
#105:
ERROR: Unrecognized email address: 'Codex'
#105:
total: 2 errors, 2 warnings, 0 checks, 103 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/home/runner/work/bluetooth-next/bluetooth-next/src/patch/15014728.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v3] Bluetooth: request LE data length for MT7922
30: B1 Line exceeds max length (89>80): "Changes in v3: move personal correspondence out of the commit message; no source changes." 32: B2 Line has trailing whitespace: "Hi Luiz, "
35: B2 Line has trailing whitespace: "ahead and prepared this v2 quirk patch that "
37: B2 Line has trailing whitespace: "Thanks, "
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
https://github.com/bluez/bluetooth-next/pull/1206
---
Regards,
Linux Bluetooth
PATCH v4 1/1 Bluetooth: request LE data length for MT7922
In reply to Kyle PepperMT7922 USB firmware can accept maximum LE suggested default data lengths without negotiating a larger transmit data length on a new connection. On an ASUS G614PR with USB ID 0489:e0f6 and firmware 20260724143815, ASHA playback remains choppy until an explicit LE Set Data Length request. A request on the same Cochlear Nucleus 8 connection raises delivery from 21.5 to 50 audio SDUs/s and reduces peak outstanding packets from 32 to 3.
Set a quirk for MT7922 in USB setup and request the current suggested defaults after successful remote feature exchange on central-role links. Require local and remote DLE support and the LE Set Data Length command. Keep suggested-default initialization and PHY negotiation unchanged.
Do not restrict the workaround to the tested firmware build or OEM USB
ID: the affected firmware range has not been confirmed. Other MediaTek chips do not enable the quirk. The request also applies to 1M peers that support DLE, and ordinary link-layer negotiation determines the result.
Hold a connection reference while queued and revalidate its membership, state, role and capabilities before sending. Release the reference on completion, cancellation or queue failure. A failed optional request does not reject connection setup.
OpenCode and Codex assisted with the implementation, review and testing.
---
Changes in this revision: disclose AI assistance in the changelog.
No source changes.
Previous version: https://lore.kernel.org/r/[email protected]/
A firmware fix remains preferable; the affected firmware scope is unconfirmed. Wider hardware, suspend/resume, other profiles and native concurrency testing remain open. GCC/Clang W=1 builds and 82 source-extracted sanitizer controls passed on the v2 source.
drivers/bluetooth/btmtk.c +4 -0
@@ -1858,6 +1858,10 @@ int btmtk_usb_setup(struct hci_dev *hdev) btmtk_data->dev_id = dev_id; +/* MT7922 needs per-link requests despite suggested defaults. */ +if (dev_id ==0x7922 ) +hci_set_quirk (hdev,HCI_QUIRK_NEEDS_LE_SET_DATA_LEN ); + err =btmtk_register_coredump (hdev, btmtk_data->drv_name, fw_version);if (err <0 )bt_dev_err (hdev,"Failed to register coredump (%d)" , err);
include/net/bluetooth/hci.h +5 -0
@@ -348,6 +348,11 @@ enum {*/ HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE , +/* The controller needs an explicit LE Set Data Length request for +* each central-role connection despite accepting suggested defaults. +*/ + HCI_QUIRK_NEEDS_LE_SET_DATA_LEN, +/* * When this quirk is set, the reserved bits of Primary/Secondary_PHY * inside the LE Extended Advertising Report events are discarded.
include/net/bluetooth/hci_sync.h +1 -0
@@ -195,6 +195,7 @@ int hci_le_read_remote_features(struct hci_conn *conn);int hci_acl_change_pkt_type (struct hci_conn *conn,u16 pkt_type);int hci_le_set_phy (struct hci_conn *conn,u8 tx_phys,u8 rx_phys,u16 phy_opts); +int hci_le_set_data_len (struct hci_conn *conn);int hci_le_set_cig_params_sync (struct hci_dev *hdev,u8 cig_id);int hci_le_create_big_sync (struct hci_conn *conn,struct bt_iso_qos_ext *qos,u8 num_bis);
net/bluetooth/hci_event.c +8 -0
@@ -7436,6 +7436,14 @@ static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, void *data,*/ conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_HDT ; conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_HDT ; + +if (hci_test_quirk (hdev,HCI_QUIRK_NEEDS_LE_SET_DATA_LEN ) && + conn->role ==HCI_ROLE_MASTER && + (hdev->commands[33 ] &BIT (6 )) && + (hdev->le_features[0 ] &HCI_LE_DATA_LEN_EXT ) && + (conn->le_features[0 ] &HCI_LE_DATA_LEN_EXT ) && + hdev->le_def_tx_len >27 ) +hci_le_set_data_len (conn); }if (conn->state ==BT_CONFIG ) {
net/bluetooth/hci_sync.c +58 -0
61 lines not on this page · raw message
base-commit: ffb95458a0f70dcab620eee0ecf5ef7750971b2f
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1220932/
---Test result---
Test Summary:
CheckPatch PASS 1.69 seconds VerifyFixes PASS 0.10 seconds VerifySignedoff PASS 0.10 seconds GitLint PASS 0.30 seconds SubjectPrefix PASS 0.10 seconds BuildKernel PASS 30.51 seconds CheckAllWarning PASS 34.44 seconds CheckSparse WARNING 36.64 seconds BuildKernel32 PASS 30.46 seconds CheckKernelLLVM PASS 33.87 seconds TestRunnerSetup PASS 730.38 seconds TestRunner_l2cap-tester PASS 14.56 seconds TestRunner_iso-tester PASS 13.04 seconds TestRunner_bnep-tester PASS 3.20 seconds TestRunner_mgmt-tester PASS 88.61 seconds TestRunner_rfcomm-tester PASS 4.52 seconds TestRunner_sco-tester PASS 5.62 seconds TestRunner_ioctl-tester PASS 4.69 seconds TestRunner_mesh-tester PASS 4.54 seconds TestRunner_smp-tester PASS 4.39 seconds TestRunner_userchan-tester PASS 3.26 seconds TestRunner_6lowpan-tester PASS 4.47 seconds IncrementalBuild PASS 29.23 seconds
Details
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
https://github.com/bluez/bluetooth-next/pull/1218
---
Regards,
Linux Bluetooth
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 8 lines · On Tue, 24 Nov 2026 14:03:39 +0000 you wrote:
MT7922 USB firmware can accept maximum LE suggested default data lengths without negotiating a larger transmit data length on a new connection. On an ASUS G614PR with USB ID 0489:e0f6 and firmware 20260724143815, ASHA playback remains choppy until an explicit LE Set Data Length request. A request on the same Cochlear Nucleus 8 connection raises delivery from 21.5 to 50 audio SDUs/s and reduces peak outstanding packets from 32 to 3.
[...]
Here is the summary with links:
- [v4] Bluetooth: request LE data length for MT7922
https://git.kernel.org/bluetooth/bluetooth-next/c/f57f78086ab5
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html