Skip to contentSkip to conversation

Bluetooth: request LE data length for affected MT7922 firmware

PATCH Superseded Kyle Pepper 3 participants 7 messages Oct 16 – Nov 23

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: request LE data length for affected MT7922 firmware

On an ASUS G614PR, the MT7922 USB controller 0489:e0f6 accepts maximum LE suggested default data lengths, but ASHA playback remains severely choppy until the host sends an explicit LE Set Data Length request.

With the firmware image dated 2026-07-24 14:38:15, a request on the same Cochlear Nucleus 8 connection produces a Data Length Change event with TX 251 octets/2120 us. Delivery rises from 21.5 to 50 audio SDUs/s and the peak outstanding packet count falls from 32 to 3. Wi-Fi power save remains enabled. Playback also works with the automatic request in the local 7.2.9 kernel build.

Keep the existing suggested-default initialization and add a driver-set quirk for the tested USB ID, chip and firmware image only. After a successful remote feature exchange, queue a request using the current host defaults if the central-role link and controller support DLE and the controller advertises LE Set Data Length.

Hold a connection reference while queued and recheck its membership, state, role and capabilities before constructing the command. Release the reference on completion, cancellation or queue failure. Failure of this optional request must not reject connection setup. Other controller matches, PHY fallback and suggested defaults are unchanged.

Assisted-by OpenCode:gpt-6.1-sol

---
This is the first submission of this MediaTek-specific fix. It follows Luiz's suggestion, in review of a separate generic DLE RFC on October 13, to use a driver-set quirk if a controller needs explicit DLE. It is not a revision or resend of that generic request.

Differences from the separate generic RFC:
- Require the exact tested USB ID, chip and firmware image build.
- Keep the existing suggested-default write unchanged.
- Require a central-role link, local/peer DLE and command support.
- Use current host defaults, not hard-coded transmit limits.
- Keep referenced queued work, cancellation and locked revalidation.

Tested on ASUS G614PR with MT7922 and a Cochlear Nucleus 8:
- Manual same-connection request: 21.5 -> 50 SDUs/s, peak queue 32 -> 3.
- Automatic request: local 7.2.9-arch1-2-asha-mediatek boots and playback is reported working; the matching firmware and quirk log are present. This local kernel/userspace stack has other ASHA patches. This is not a vanilla upstream-kernel hardware test or a post-boot throughput trace.
- Broader suspend/resume, battery, other-profile and native concurrency coverage is not claimed. An earlier brief quality drop is not assigned a cause or declared independently resolved.

Validation on Bluetooth upstream base 185c11232d5f:
- Four native Bluetooth objects compile with W=1 on an x86_64 diagnostic configuration (Rust disabled); this is not a full upstream kernel build.
- 37 source-extracted ASan/UBSan controls pass, with unpatched baseline and negative controls. These are not in-kernel concurrency tests.
- Equivalent backports pass the same controls on pinned 7.2.y, 6.18.y and 6.12.y snapshots. The 6.18.y and 6.12.y variants also compile the four native objects with W=1. No older-kernel hardware boot is claimed.

The firmware gate uses the selected image header. If setup reuses an already-resident image, this is not an independent read of that image's identity; the observed boot log matches the tested image. Please review this limitation before widening the match to other firmware or devices.

Stable consideration: this fixes a real firmware interoperability issue, but the change exceeds the usual 100-line-with-context stable guideline. Please assess stable suitability after upstream review. No introducing kernel commit has been established, so no speculative Fixes tag is added. The 6.18.y backport uses the older connection-feature layout. The 6.12.y backport also uses scalar quirks and checks queued duplicates before taking a reference, since queue_once() there returns zero for duplicates. Backport application/API differences and checks are documented locally; no stable acceptance, older-kernel hardware test or public issue closure is claimed. Please do not queue an unreviewed backport directly.

 drivers/bluetooth/btmtk.c        | 29 ++++++++++++++++
 include/net/bluetooth/hci.h      |  6 ++++
 include/net/bluetooth/hci_sync.h |  1 +
 net/bluetooth/hci_event.c        |  8 +++++
 net/bluetooth/hci_sync.c         | 58 ++++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)
drivers/bluetooth/btmtk.c +29 -0
index 75483d823..cab5c4c36 100644
@@ -47,6 +47,24 @@ struct btmtk_global_desc {
 	__le32 section_num;
 } __packed;
 
+static bool btmtk_needs_manual_dle(struct hci_dev *hdev, u32 dev_id,
+				   const struct btmtk_patch_header *hdr)
+{
+	static const u8 affected_build[16] = "20260724143815";
+	struct btmtk_data *data;
+
+	if (hdev->bus != HCI_USB || dev_id != 0x7922)
+		return false;
+
+	data = hci_get_priv(hdev);
+	if (!data->udev)
+		return false;
+
+	return le16_to_cpu(data->udev->descriptor.idVendor) == 0x0489 &&
+	       le16_to_cpu(data->udev->descriptor.idProduct) == 0xe0f6 &&
+	       !memcmp(hdr->datetime, affected_build, sizeof(affected_build));
+}
+
 struct btmtk_section_map {
 	__le32 sectype;
 	__le32 secoffset;
@@ -219,6 +237,9 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
 	u32 section_num, dl_size, section_offset;
 	u8 cmd[64];
 
+	/* Re-evaluate the firmware-specific workaround on every setup. */
+	hci_clear_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+
 	err = request_firmware(&fw, fwname, &hdev->dev);
 	if (err < 0) {
 		bt_dev_err(hdev, "Failed to load firmware file (%d)", err);
@@ -347,6 +368,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
 	/* Wait a few moments for firmware activation done */
 	usleep_range(100000, 120000);
 
+	/* This firmware accepts maximum suggested defaults but needs an
+	 * explicit per-link request to negotiate a larger TX data length.
+	 */
+	if (btmtk_needs_manual_dle(hdev, dev_id, hdr)) {
+		hci_set_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+		bt_dev_info(hdev, "Using explicit LE data length requests");
+	}
+
 err_release_fw:
 	release_firmware(fw);
 
include/net/bluetooth/hci.h +6 -0
index 1c992e875..513ca226d 100644
@@ -340,6 +340,12 @@ enum {
 	 */
 	HCI_QUIRK_BROKEN_LE_CODED,
 
+	/* The controller needs an explicit LE Set Data Length request for
+	 * each central-role connection despite accepting suggested defaults.
+	 * Set during the vendor setup callback for affected firmware only.
+	 */
+	HCI_QUIRK_NEEDS_LE_SET_DATA_LEN,
+
 	/*
 	 * When this quirk is set, the HCI_OP_READ_ENC_KEY_SIZE command is
 	 * skipped during an HCI_EV_ENCRYPT_CHANGE event. This is required
include/net/bluetooth/hci_sync.h +1 -0
index 59cb918d1..5a37d3e50 100644
@@ -194,3 +194,4 @@ 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);
+int hci_le_set_data_len(struct hci_conn *conn);
net/bluetooth/hci_event.c +8 -0
index 56ad10ab9..d78f330e3 100644
@@ -6875,6 +6875,14 @@ static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, void *data,
 				conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_CODED;
 				conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_CODED;
 			}
+
+			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: 185c11232d5f586489bb3b74e6bcc7a6560ddd40

#1 lore raw

Hi Kyle,

Quoted 247 lines · Kyle Pepper

On an ASUS G614PR, the MT7922 USB controller 0489:e0f6 accepts maximum LE suggested default data lengths, but ASHA playback remains severely choppy until the host sends an explicit LE Set Data Length request.

With the firmware image dated 2026-07-24 14:38:15, a request on the same Cochlear Nucleus 8 connection produces a Data Length Change event with TX 251 octets/2120 us. Delivery rises from 21.5 to 50 audio SDUs/s and the peak outstanding packet count falls from 32 to 3. Wi-Fi power save remains enabled. Playback also works with the automatic request in the local 7.2.9 kernel build.

Keep the existing suggested-default initialization and add a driver-set quirk for the tested USB ID, chip and firmware image only. After a successful remote feature exchange, queue a request using the current host defaults if the central-role link and controller support DLE and the controller advertises LE Set Data Length.

Hold a connection reference while queued and recheck its membership, state, role and capabilities before constructing the command. Release the reference on completion, cancellation or queue failure. Failure of this optional request must not reject connection setup. Other controller matches, PHY fallback and suggested defaults are unchanged.

Assisted-by OpenCode:gpt-6.1-sol

---
This is the first submission of this MediaTek-specific fix. It follows Luiz's suggestion, in review of a separate generic DLE RFC on October 13, to use a driver-set quirk if a controller needs explicit DLE. It is not a revision or resend of that generic request.

Differences from the separate generic RFC:
- Require the exact tested USB ID, chip and firmware image build.
- Keep the existing suggested-default write unchanged.
- Require a central-role link, local/peer DLE and command support.
- Use current host defaults, not hard-coded transmit limits.
- Keep referenced queued work, cancellation and locked revalidation.

Tested on ASUS G614PR with MT7922 and a Cochlear Nucleus 8:
- Manual same-connection request: 21.5 -> 50 SDUs/s, peak queue 32 -> 3.
- Automatic request: local 7.2.9-arch1-2-asha-mediatek boots and playback is reported working; the matching firmware and quirk log are present. This local kernel/userspace stack has other ASHA patches. This is not a vanilla upstream-kernel hardware test or a post-boot throughput trace.
- Broader suspend/resume, battery, other-profile and native concurrency coverage is not claimed. An earlier brief quality drop is not assigned a cause or declared independently resolved.

Validation on Bluetooth upstream base 185c11232d5f:
- Four native Bluetooth objects compile with W=1 on an x86_64 diagnostic configuration (Rust disabled); this is not a full upstream kernel build.
- 37 source-extracted ASan/UBSan controls pass, with unpatched baseline and negative controls. These are not in-kernel concurrency tests.
- Equivalent backports pass the same controls on pinned 7.2.y, 6.18.y and 6.12.y snapshots. The 6.18.y and 6.12.y variants also compile the four native objects with W=1. No older-kernel hardware boot is claimed.

The firmware gate uses the selected image header. If setup reuses an already-resident image, this is not an independent read of that image's identity; the observed boot log matches the tested image. Please review this limitation before widening the match to other firmware or devices.

Stable consideration: this fixes a real firmware interoperability issue, but the change exceeds the usual 100-line-with-context stable guideline. Please assess stable suitability after upstream review. No introducing kernel commit has been established, so no speculative Fixes tag is added. The 6.18.y backport uses the older connection-feature layout. The 6.12.y backport also uses scalar quirks and checks queued duplicates before taking a reference, since queue_once() there returns zero for duplicates. Backport application/API differences and checks are documented locally; no stable acceptance, older-kernel hardware test or public issue closure is claimed. Please do not queue an unreviewed backport directly.

 drivers/bluetooth/btmtk.c        | 29 ++++++++++++++++
 include/net/bluetooth/hci.h      |  6 ++++
 include/net/bluetooth/hci_sync.h |  1 +
 net/bluetooth/hci_event.c        |  8 +++++
 net/bluetooth/hci_sync.c         | 58 ++++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)
drivers/bluetooth/btmtk.c +29 -0
index 75483d823..cab5c4c36 100644
@@ -47,6 +47,24 @@ struct btmtk_global_desc {
        __le32 section_num;
 } __packed;
 
+static bool btmtk_needs_manual_dle(struct hci_dev *hdev, u32 dev_id,
+                                  const struct btmtk_patch_header *hdr)
+{
+       static const u8 affected_build[16] = "20260724143815";
+       struct btmtk_data *data;
+
+       if (hdev->bus != HCI_USB || dev_id != 0x7922)
+               return false;
+
+       data = hci_get_priv(hdev);
+       if (!data->udev)
+               return false;
+
+       return le16_to_cpu(data->udev->descriptor.idVendor) == 0x0489 &&
+              le16_to_cpu(data->udev->descriptor.idProduct) == 0xe0f6 &&
+              !memcmp(hdr->datetime, affected_build, sizeof(affected_build));
+}
+
 struct btmtk_section_map {
        __le32 sectype;
        __le32 secoffset;
@@ -219,6 +237,9 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        u32 section_num, dl_size, section_offset;
        u8 cmd[64];
 
+       /* Re-evaluate the firmware-specific workaround on every setup. */
+       hci_clear_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+
        err = request_firmware(&fw, fwname, &hdev->dev);
        if (err < 0) {
                bt_dev_err(hdev, "Failed to load firmware file (%d)", err);
@@ -347,6 +368,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        /* Wait a few moments for firmware activation done */
        usleep_range(100000, 120000);
 
+       /* This firmware accepts maximum suggested defaults but needs an
+        * explicit per-link request to negotiate a larger TX data length.
+        */
+       if (btmtk_needs_manual_dle(hdev, dev_id, hdr)) {
+               hci_set_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+               bt_dev_info(hdev, "Using explicit LE data length requests");
+       }
+
 err_release_fw:
        release_firmware(fw);
 
include/net/bluetooth/hci.h +6 -0
index 1c992e875..513ca226d 100644
@@ -340,6 +340,12 @@ enum {
         */
        HCI_QUIRK_BROKEN_LE_CODED,
 
+       /* The controller needs an explicit LE Set Data Length request for
+        * each central-role connection despite accepting suggested defaults.
+        * Set during the vendor setup callback for affected firmware only.
+        */
+       HCI_QUIRK_NEEDS_LE_SET_DATA_LEN,
+
        /*
         * When this quirk is set, the HCI_OP_READ_ENC_KEY_SIZE command is
         * skipped during an HCI_EV_ENCRYPT_CHANGE event. This is required
include/net/bluetooth/hci_sync.h +1 -0
index 59cb918d1..5a37d3e50 100644
@@ -194,3 +194,4 @@ 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);
+int hci_le_set_data_len(struct hci_conn *conn);
net/bluetooth/hci_event.c +8 -0
index 56ad10ab9..d78f330e3 100644
@@ -6875,6 +6875,14 @@ static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, void *data,
                                conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_CODED;
                                conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_CODED;
                        }
+
+                       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
index 7ac26daba..f919249e9 100644
@@ -8152,3 +8152,61 @@ int hci_le_set_phy(struct hci_conn *conn, u8 tx_phys, u8 rx_phys)
 
        return (err == -EEXIST) ? 0 : err;
 }
+
+static void le_set_data_len_complete(struct hci_dev *hdev, void *data, int err)
+{
+       struct hci_conn *conn = data;
+
+       bt_dev_dbg(hdev, "err %d", err);
+       if (err && err != -ECANCELED && err != -ENODEV)
+               bt_dev_warn(hdev, "Failed to set LE data length (%d)", err);
+       hci_conn_put(conn);
+}
+
+static int hci_le_set_data_len_sync(struct hci_dev *hdev, void *data)
+{
+       struct hci_conn *conn = data;
+       struct hci_cp_le_set_data_len cp;
+
+       hci_dev_lock(hdev);
+
+       if (!hci_conn_valid(hdev, conn) || conn->type != LE_LINK ||
+           conn->role != HCI_ROLE_MASTER ||
+           (conn->state != BT_CONNECTED && conn->state != BT_CONFIG)) {
+               hci_dev_unlock(hdev);
+               return -ECANCELED;
+       }
+
+       /* Use the current suggested defaults, including later host changes. */
+       if (!hci_test_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN) ||
+           !(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_dev_unlock(hdev);
+               return 0;
+       }
+
+       cp.handle = cpu_to_le16(conn->handle);
+       cp.tx_len = cpu_to_le16(hdev->le_def_tx_len);
+       cp.tx_time = cpu_to_le16(hdev->le_def_tx_time);
+
+       hci_dev_unlock(hdev);
+
+       return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_DATA_LEN,
+                                    sizeof(cp), &cp, HCI_CMD_TIMEOUT);
+}
+
+int hci_le_set_data_len(struct hci_conn *conn)
+{
+       struct hci_dev *hdev = conn->hdev;
+       int err;
+
+       err = hci_cmd_sync_queue_once(hdev, hci_le_set_data_len_sync,
+                                     hci_conn_get(conn),
+                                     le_set_data_len_complete);
+       if (err)
+               hci_conn_put(conn);
+
+       return (err == -EEXIST) ? 0 : err;
+}
Quoted 1 line

base-commit: 185c11232d5f586489bb3b74e6bcc7a6560ddd40

Perhaps before we go into the whole trouble of adding a quirk we should check with MediaTek folks if there is a fix planned for this, since this is actually a firmware bug. If there isn't one and a fix would take time to be validated, I'd proceed with the quirk but I don't think gating it on a specific build is a good idea; there might be other firmware releases affected by this, unless MediaTek can confirm this is exclusive to a single image in which case we should treat it as a regression.

Signature · 1 line
Luiz Augusto von Dentz
author
#2 lore raw

Hi Luiz, Sean and the MediaTek team,

Thanks for your review Luiz. Sean/MediaTek team, could you help confirm whether a firmware fix is planned for this MT7922 behavior?

On my ASUS G614PR, with the Bluetooth USB ID 0489:e0f6 and firmware build 20260724143815, the controller accepts the maximum LE suggested default data lengths, but ASHA playback remains severely choppy. To the point that it's unusable due to only hearing a half second of audio every second or so.

Sending an explicit LE Set Data Length request on the same connection produces a Data Length Change event reporting TX 251 octets/2120 µs. Audio delivery then rises from about 21.5 to 50 SDUs/s, and peak outstanding packets fall from 32 to 3.

Is this a known firmware issue? Do you happen to know which firmware versions and devices are affected? And does there happen to be an expected timeline for a fix?

I haven't established if other versions are affected as well. I'll wait for your guidance before revising the quirk scope.

Thanks,
Kyle

Quoted 264 lines · Luiz Augusto von Dentz

Hi Kyle,

Quoted 247 lines · Kyle Pepper

On an ASUS G614PR, the MT7922 USB controller 0489:e0f6 accepts maximum LE suggested default data lengths, but ASHA playback remains severely choppy until the host sends an explicit LE Set Data Length request.

With the firmware image dated 2026-07-24 14:38:15, a request on the same Cochlear Nucleus 8 connection produces a Data Length Change event with TX 251 octets/2120 us. Delivery rises from 21.5 to 50 audio SDUs/s and the peak outstanding packet count falls from 32 to 3. Wi-Fi power save remains enabled. Playback also works with the automatic request in the local 7.2.9 kernel build.

Keep the existing suggested-default initialization and add a driver-set quirk for the tested USB ID, chip and firmware image only. After a successful remote feature exchange, queue a request using the current host defaults if the central-role link and controller support DLE and the controller advertises LE Set Data Length.

Hold a connection reference while queued and recheck its membership, state, role and capabilities before constructing the command. Release the reference on completion, cancellation or queue failure. Failure of this optional request must not reject connection setup. Other controller matches, PHY fallback and suggested defaults are unchanged.

Assisted-by OpenCode:gpt-6.1-sol

---
This is the first submission of this MediaTek-specific fix. It follows Luiz's suggestion, in review of a separate generic DLE RFC on October 13, to use a driver-set quirk if a controller needs explicit DLE. It is not a revision or resend of that generic request.

Differences from the separate generic RFC:
- Require the exact tested USB ID, chip and firmware image build.
- Keep the existing suggested-default write unchanged.
- Require a central-role link, local/peer DLE and command support.
- Use current host defaults, not hard-coded transmit limits.
- Keep referenced queued work, cancellation and locked revalidation.

Tested on ASUS G614PR with MT7922 and a Cochlear Nucleus 8:
- Manual same-connection request: 21.5 -> 50 SDUs/s, peak queue 32 -> 3.
- Automatic request: local 7.2.9-arch1-2-asha-mediatek boots and playback is reported working; the matching firmware and quirk log are present. This local kernel/userspace stack has other ASHA patches. This is not a vanilla upstream-kernel hardware test or a post-boot throughput trace.
- Broader suspend/resume, battery, other-profile and native concurrency coverage is not claimed. An earlier brief quality drop is not assigned a cause or declared independently resolved.

Validation on Bluetooth upstream base 185c11232d5f:
- Four native Bluetooth objects compile with W=1 on an x86_64 diagnostic configuration (Rust disabled); this is not a full upstream kernel build.
- 37 source-extracted ASan/UBSan controls pass, with unpatched baseline and negative controls. These are not in-kernel concurrency tests.
- Equivalent backports pass the same controls on pinned 7.2.y, 6.18.y and 6.12.y snapshots. The 6.18.y and 6.12.y variants also compile the four native objects with W=1. No older-kernel hardware boot is claimed.

The firmware gate uses the selected image header. If setup reuses an already-resident image, this is not an independent read of that image's identity; the observed boot log matches the tested image. Please review this limitation before widening the match to other firmware or devices.

Stable consideration: this fixes a real firmware interoperability issue, but the change exceeds the usual 100-line-with-context stable guideline. Please assess stable suitability after upstream review. No introducing kernel commit has been established, so no speculative Fixes tag is added. The 6.18.y backport uses the older connection-feature layout. The 6.12.y backport also uses scalar quirks and checks queued duplicates before taking a reference, since queue_once() there returns zero for duplicates. Backport application/API differences and checks are documented locally; no stable acceptance, older-kernel hardware test or public issue closure is claimed. Please do not queue an unreviewed backport directly.

 drivers/bluetooth/btmtk.c        | 29 ++++++++++++++++
 include/net/bluetooth/hci.h      |  6 ++++
 include/net/bluetooth/hci_sync.h |  1 +
 net/bluetooth/hci_event.c        |  8 +++++
 net/bluetooth/hci_sync.c         | 58 ++++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)
drivers/bluetooth/btmtk.c +29 -0
index 75483d823..cab5c4c36 100644
@@ -47,6 +47,24 @@ struct btmtk_global_desc {
        __le32 section_num;
 } __packed;
 
+static bool btmtk_needs_manual_dle(struct hci_dev *hdev, u32 dev_id,
+                                  const struct btmtk_patch_header *hdr)
+{
+       static const u8 affected_build[16] = "20260724143815";
+       struct btmtk_data *data;
+
+       if (hdev->bus != HCI_USB || dev_id != 0x7922)
+               return false;
+
+       data = hci_get_priv(hdev);
+       if (!data->udev)
+               return false;
+
+       return le16_to_cpu(data->udev->descriptor.idVendor) == 0x0489 &&
+              le16_to_cpu(data->udev->descriptor.idProduct) == 0xe0f6 &&
+              !memcmp(hdr->datetime, affected_build, sizeof(affected_build));
+}
+
 struct btmtk_section_map {
        __le32 sectype;
        __le32 secoffset;
@@ -219,6 +237,9 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        u32 section_num, dl_size, section_offset;
        u8 cmd[64];
 
+       /* Re-evaluate the firmware-specific workaround on every setup. */
+       hci_clear_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+
        err = request_firmware(&fw, fwname, &hdev->dev);
        if (err < 0) {
                bt_dev_err(hdev, "Failed to load firmware file (%d)", err);
@@ -347,6 +368,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        /* Wait a few moments for firmware activation done */
        usleep_range(100000, 120000);
 
+       /* This firmware accepts maximum suggested defaults but needs an
+        * explicit per-link request to negotiate a larger TX data length.
+        */
+       if (btmtk_needs_manual_dle(hdev, dev_id, hdr)) {
+               hci_set_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+               bt_dev_info(hdev, "Using explicit LE data length requests");
+       }
+
 err_release_fw:
        release_firmware(fw);
 
include/net/bluetooth/hci.h +6 -0
index 1c992e875..513ca226d 100644
@@ -340,6 +340,12 @@ enum {
         */
        HCI_QUIRK_BROKEN_LE_CODED,
 
+       /* The controller needs an explicit LE Set Data Length request for
+        * each central-role connection despite accepting suggested defaults.
+        * Set during the vendor setup callback for affected firmware only.
+        */
+       HCI_QUIRK_NEEDS_LE_SET_DATA_LEN,
+
        /*
         * When this quirk is set, the HCI_OP_READ_ENC_KEY_SIZE command is
         * skipped during an HCI_EV_ENCRYPT_CHANGE event. This is required
include/net/bluetooth/hci_sync.h +1 -0
index 59cb918d1..5a37d3e50 100644
@@ -194,3 +194,4 @@ 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);
+int hci_le_set_data_len(struct hci_conn *conn);
net/bluetooth/hci_event.c +8 -0
index 56ad10ab9..d78f330e3 100644
@@ -6875,6 +6875,14 @@ static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, void *data,
                                conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_CODED;
                                conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_CODED;
                        }
+
+                       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
index 7ac26daba..f919249e9 100644
@@ -8152,3 +8152,61 @@ int hci_le_set_phy(struct hci_conn *conn, u8 tx_phys, u8 rx_phys)
 
        return (err == -EEXIST) ? 0 : err;
 }
+
+static void le_set_data_len_complete(struct hci_dev *hdev, void *data, int err)
+{
+       struct hci_conn *conn = data;
+
+       bt_dev_dbg(hdev, "err %d", err);
+       if (err && err != -ECANCELED && err != -ENODEV)
+               bt_dev_warn(hdev, "Failed to set LE data length (%d)", err);
+       hci_conn_put(conn);
+}
+
+static int hci_le_set_data_len_sync(struct hci_dev *hdev, void *data)
+{
+       struct hci_conn *conn = data;
+       struct hci_cp_le_set_data_len cp;
+
+       hci_dev_lock(hdev);
+
+       if (!hci_conn_valid(hdev, conn) || conn->type != LE_LINK ||
+           conn->role != HCI_ROLE_MASTER ||
+           (conn->state != BT_CONNECTED && conn->state != BT_CONFIG)) {
+               hci_dev_unlock(hdev);
+               return -ECANCELED;
+       }
+
+       /* Use the current suggested defaults, including later host changes. */
+       if (!hci_test_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN) ||
+           !(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_dev_unlock(hdev);
+               return 0;
+       }
+
+       cp.handle = cpu_to_le16(conn->handle);
+       cp.tx_len = cpu_to_le16(hdev->le_def_tx_len);
+       cp.tx_time = cpu_to_le16(hdev->le_def_tx_time);
+
+       hci_dev_unlock(hdev);
+
+       return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_DATA_LEN,
+                                    sizeof(cp), &cp, HCI_CMD_TIMEOUT);
+}
+
+int hci_le_set_data_len(struct hci_conn *conn)
+{
+       struct hci_dev *hdev = conn->hdev;
+       int err;
+
+       err = hci_cmd_sync_queue_once(hdev, hci_le_set_data_len_sync,
+                                     hci_conn_get(conn),
+                                     le_set_data_len_complete);
+       if (err)
+               hci_conn_put(conn);
+
+       return (err == -EEXIST) ? 0 : err;
+}
Quoted 1 line

base-commit: 185c11232d5f586489bb3b74e6bcc7a6560ddd40

Perhaps before we go into the whole trouble of adding a quirk we should check with MediaTek folks if there is a fix planned for this, since this is actually a firmware bug. If there isn't one and a fix would take time to be validated, I'd proceed with the quirk but I don't think gating it on a specific build is a good idea; there might be other firmware releases affected by this, unless MediaTek can confirm this is exclusive to a single image in which case we should treat it as a regression.

--
Luiz Augusto von Dentz

author
#3 lore raw

Hi,

Following up on this, has there been any updates on the affected firmware versions or a possible firmware fix?

Thanks,
Kyle

Quoted 284 lines · cochcoder

Hi Luiz, Sean and the MediaTek team,

Thanks for your review Luiz. Sean/MediaTek team, could you help confirm whether a firmware fix is planned for this MT7922 behavior?

On my ASUS G614PR, with the Bluetooth USB ID 0489:e0f6 and firmware build 20260724143815, the controller accepts the maximum LE suggested default data lengths, but ASHA playback remains severely choppy. To the point that it's unusable due to only hearing a half second of audio every second or so.

Sending an explicit LE Set Data Length request on the same connection produces a Data Length Change event reporting TX 251 octets/2120 µs. Audio delivery then rises from about 21.5 to 50 SDUs/s, and peak outstanding packets fall from 32 to 3.

Is this a known firmware issue? Do you happen to know which firmware versions and devices are affected? And does there happen to be an expected timeline for a fix?

I haven't established if other versions are affected as well. I'll wait for your guidance before revising the quirk scope.

Thanks,
Kyle

Quoted 264 lines · Luiz Augusto von Dentz

Hi Kyle,

Quoted 247 lines · Kyle Pepper

On an ASUS G614PR, the MT7922 USB controller 0489:e0f6 accepts maximum LE suggested default data lengths, but ASHA playback remains severely choppy until the host sends an explicit LE Set Data Length request.

With the firmware image dated 2026-07-24 14:38:15, a request on the same Cochlear Nucleus 8 connection produces a Data Length Change event with TX 251 octets/2120 us. Delivery rises from 21.5 to 50 audio SDUs/s and the peak outstanding packet count falls from 32 to 3. Wi-Fi power save remains enabled. Playback also works with the automatic request in the local 7.2.9 kernel build.

Keep the existing suggested-default initialization and add a driver-set quirk for the tested USB ID, chip and firmware image only. After a successful remote feature exchange, queue a request using the current host defaults if the central-role link and controller support DLE and the controller advertises LE Set Data Length.

Hold a connection reference while queued and recheck its membership, state, role and capabilities before constructing the command. Release the reference on completion, cancellation or queue failure. Failure of this optional request must not reject connection setup. Other controller matches, PHY fallback and suggested defaults are unchanged.

Assisted-by OpenCode:gpt-6.1-sol

---
This is the first submission of this MediaTek-specific fix. It follows Luiz's suggestion, in review of a separate generic DLE RFC on October 13, to use a driver-set quirk if a controller needs explicit DLE. It is not a revision or resend of that generic request.

Differences from the separate generic RFC:
- Require the exact tested USB ID, chip and firmware image build.
- Keep the existing suggested-default write unchanged.
- Require a central-role link, local/peer DLE and command support.
- Use current host defaults, not hard-coded transmit limits.
- Keep referenced queued work, cancellation and locked revalidation.

Tested on ASUS G614PR with MT7922 and a Cochlear Nucleus 8:
- Manual same-connection request: 21.5 -> 50 SDUs/s, peak queue 32 -> 3.
- Automatic request: local 7.2.9-arch1-2-asha-mediatek boots and playback is reported working; the matching firmware and quirk log are present. This local kernel/userspace stack has other ASHA patches. This is not a vanilla upstream-kernel hardware test or a post-boot throughput trace.
- Broader suspend/resume, battery, other-profile and native concurrency coverage is not claimed. An earlier brief quality drop is not assigned a cause or declared independently resolved.

Validation on Bluetooth upstream base 185c11232d5f:
- Four native Bluetooth objects compile with W=1 on an x86_64 diagnostic configuration (Rust disabled); this is not a full upstream kernel build.
- 37 source-extracted ASan/UBSan controls pass, with unpatched baseline and negative controls. These are not in-kernel concurrency tests.
- Equivalent backports pass the same controls on pinned 7.2.y, 6.18.y and 6.12.y snapshots. The 6.18.y and 6.12.y variants also compile the four native objects with W=1. No older-kernel hardware boot is claimed.

The firmware gate uses the selected image header. If setup reuses an already-resident image, this is not an independent read of that image's identity; the observed boot log matches the tested image. Please review this limitation before widening the match to other firmware or devices.

Stable consideration: this fixes a real firmware interoperability issue, but the change exceeds the usual 100-line-with-context stable guideline. Please assess stable suitability after upstream review. No introducing kernel commit has been established, so no speculative Fixes tag is added. The 6.18.y backport uses the older connection-feature layout. The 6.12.y backport also uses scalar quirks and checks queued duplicates before taking a reference, since queue_once() there returns zero for duplicates. Backport application/API differences and checks are documented locally; no stable acceptance, older-kernel hardware test or public issue closure is claimed. Please do not queue an unreviewed backport directly.

 drivers/bluetooth/btmtk.c        | 29 ++++++++++++++++
 include/net/bluetooth/hci.h      |  6 ++++
 include/net/bluetooth/hci_sync.h |  1 +
 net/bluetooth/hci_event.c        |  8 +++++
 net/bluetooth/hci_sync.c         | 58 ++++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)
drivers/bluetooth/btmtk.c +29 -0
index 75483d823..cab5c4c36 100644
@@ -47,6 +47,24 @@ struct btmtk_global_desc {
        __le32 section_num;
 } __packed;
 
+static bool btmtk_needs_manual_dle(struct hci_dev *hdev, u32 dev_id,
+                                  const struct btmtk_patch_header *hdr)
+{
+       static const u8 affected_build[16] = "20260724143815";
+       struct btmtk_data *data;
+
+       if (hdev->bus != HCI_USB || dev_id != 0x7922)
+               return false;
+
+       data = hci_get_priv(hdev);
+       if (!data->udev)
+               return false;
+
+       return le16_to_cpu(data->udev->descriptor.idVendor) == 0x0489 &&
+              le16_to_cpu(data->udev->descriptor.idProduct) == 0xe0f6 &&
+              !memcmp(hdr->datetime, affected_build, sizeof(affected_build));
+}
+
 struct btmtk_section_map {
        __le32 sectype;
        __le32 secoffset;
@@ -219,6 +237,9 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        u32 section_num, dl_size, section_offset;
        u8 cmd[64];
 
+       /* Re-evaluate the firmware-specific workaround on every setup. */
+       hci_clear_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+
        err = request_firmware(&fw, fwname, &hdev->dev);
        if (err < 0) {
                bt_dev_err(hdev, "Failed to load firmware file (%d)", err);
@@ -347,6 +368,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        /* Wait a few moments for firmware activation done */
        usleep_range(100000, 120000);
 
+       /* This firmware accepts maximum suggested defaults but needs an
+        * explicit per-link request to negotiate a larger TX data length.
+        */
+       if (btmtk_needs_manual_dle(hdev, dev_id, hdr)) {
+               hci_set_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN);
+               bt_dev_info(hdev, "Using explicit LE data length requests");
+       }
+
 err_release_fw:
        release_firmware(fw);
 
include/net/bluetooth/hci.h +6 -0
index 1c992e875..513ca226d 100644
@@ -340,6 +340,12 @@ enum {
         */
        HCI_QUIRK_BROKEN_LE_CODED,
 
+       /* The controller needs an explicit LE Set Data Length request for
+        * each central-role connection despite accepting suggested defaults.
+        * Set during the vendor setup callback for affected firmware only.
+        */
+       HCI_QUIRK_NEEDS_LE_SET_DATA_LEN,
+
        /*
         * When this quirk is set, the HCI_OP_READ_ENC_KEY_SIZE command is
         * skipped during an HCI_EV_ENCRYPT_CHANGE event. This is required
include/net/bluetooth/hci_sync.h +1 -0
index 59cb918d1..5a37d3e50 100644
@@ -194,3 +194,4 @@ 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);
+int hci_le_set_data_len(struct hci_conn *conn);
net/bluetooth/hci_event.c +8 -0
index 56ad10ab9..d78f330e3 100644
@@ -6875,6 +6875,14 @@ static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, void *data,
                                conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_CODED;
                                conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_CODED;
                        }
+
+                       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
index 7ac26daba..f919249e9 100644
@@ -8152,3 +8152,61 @@ int hci_le_set_phy(struct hci_conn *conn, u8 tx_phys, u8 rx_phys)
 
        return (err == -EEXIST) ? 0 : err;
 }
+
+static void le_set_data_len_complete(struct hci_dev *hdev, void *data, int err)
+{
+       struct hci_conn *conn = data;
+
+       bt_dev_dbg(hdev, "err %d", err);
+       if (err && err != -ECANCELED && err != -ENODEV)
+               bt_dev_warn(hdev, "Failed to set LE data length (%d)", err);
+       hci_conn_put(conn);
+}
+
+static int hci_le_set_data_len_sync(struct hci_dev *hdev, void *data)
+{
+       struct hci_conn *conn = data;
+       struct hci_cp_le_set_data_len cp;
+
+       hci_dev_lock(hdev);
+
+       if (!hci_conn_valid(hdev, conn) || conn->type != LE_LINK ||
+           conn->role != HCI_ROLE_MASTER ||
+           (conn->state != BT_CONNECTED && conn->state != BT_CONFIG)) {
+               hci_dev_unlock(hdev);
+               return -ECANCELED;
+       }
+
+       /* Use the current suggested defaults, including later host changes. */
+       if (!hci_test_quirk(hdev, HCI_QUIRK_NEEDS_LE_SET_DATA_LEN) ||
+           !(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_dev_unlock(hdev);
+               return 0;
+       }
+
+       cp.handle = cpu_to_le16(conn->handle);
+       cp.tx_len = cpu_to_le16(hdev->le_def_tx_len);
+       cp.tx_time = cpu_to_le16(hdev->le_def_tx_time);
+
+       hci_dev_unlock(hdev);
+
+       return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_DATA_LEN,
+                                    sizeof(cp), &cp, HCI_CMD_TIMEOUT);
+}
+
+int hci_le_set_data_len(struct hci_conn *conn)
+{
+       struct hci_dev *hdev = conn->hdev;
+       int err;
+
+       err = hci_cmd_sync_queue_once(hdev, hci_le_set_data_len_sync,
+                                     hci_conn_get(conn),
+                                     le_set_data_len_complete);
+       if (err)
+               hci_conn_put(conn);
+
+       return (err == -EEXIST) ? 0 : err;
+}
Quoted 1 line

base-commit: 185c11232d5f586489bb3b74e6bcc7a6560ddd40

Perhaps before we go into the whole trouble of adding a quirk we should check with MediaTek folks if there is a fix planned for this, since this is actually a firmware bug. If there isn't one and a fix would take time to be validated, I'd proceed with the quirk but I don't think gating it on a specific build is a good idea; there might be other firmware releases affected by this, unless MediaTek can confirm this is exclusive to a single image in which case we should treat it as a regression.

--
Luiz Augusto von Dentz

#4 lore raw
In reply to Kyle Pepper

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/1187540/

---Test result---

Test Summary:

CheckPatch                    PASS      1.50 seconds
VerifyFixes                   PASS      0.05 seconds
VerifySignedoff               PASS      0.06 seconds
GitLint                       PASS      0.20 seconds
SubjectPrefix                 PASS      0.05 seconds
BuildKernel                   PASS      29.77 seconds
CheckAllWarning               PASS      34.17 seconds
CheckSparse                   WARNING   36.80 seconds
BuildKernel32                 PASS      30.00 seconds
CheckKernelLLVM               PASS      35.68 seconds
TestRunnerSetup               PASS      714.76 seconds
TestRunner_l2cap-tester       PASS      12.61 seconds
TestRunner_iso-tester         PASS      10.75 seconds
TestRunner_bnep-tester        PASS      3.06 seconds
TestRunner_mgmt-tester        PASS      87.48 seconds
TestRunner_rfcomm-tester      PASS      4.39 seconds
TestRunner_sco-tester         PASS      5.58 seconds
TestRunner_ioctl-tester       PASS      4.59 seconds
TestRunner_mesh-tester        PASS      5.43 seconds
TestRunner_smp-tester         PASS      4.28 seconds
TestRunner_userchan-tester    PASS      3.13 seconds
TestRunner_6lowpan-tester     PASS      4.34 seconds
IncrementalBuild              PASS      28.44 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/958

---
Regards,
Linux Bluetooth

#5 lore raw

PATCH v2 1/1 Bluetooth: request LE data length for MT7922

In reply to Kyle Pepper

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

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.

Assisted-by OpenCode:gpt-6.1-sol
Assisted-by Codex

---
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
index 1b3dab0d1..1869815cc 100644
@@ -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
index efb85c781..85a4931e5 100644
@@ -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
index 509ec4161..eab827dfa 100644
@@ -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
index b6c7f9a9f..7ef2c4d19 100644
@@ -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

#6 lore raw

RE: [v2] Bluetooth: request LE data length for MT7922

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/1220149/

---Test result---

Test Summary:

CheckPatch                    FAIL      1.57 seconds
VerifyFixes                   PASS      0.07 seconds
VerifySignedoff               PASS      0.06 seconds
GitLint                       FAIL      0.22 seconds
SubjectPrefix                 PASS      0.06 seconds
BuildKernel                   PASS      31.10 seconds
CheckAllWarning               PASS      35.08 seconds
CheckSparse                   WARNING   38.01 seconds
BuildKernel32                 PASS      30.75 seconds
CheckKernelLLVM               PASS      34.15 seconds
TestRunnerSetup               PASS      739.31 seconds
TestRunner_l2cap-tester       PASS      14.60 seconds
TestRunner_iso-tester         PASS      14.98 seconds
TestRunner_bnep-tester        PASS      3.13 seconds
TestRunner_mgmt-tester        PASS      88.79 seconds
TestRunner_rfcomm-tester      PASS      4.43 seconds
TestRunner_sco-tester         PASS      5.58 seconds
TestRunner_ioctl-tester       PASS      4.63 seconds
TestRunner_mesh-tester        PASS      4.41 seconds
TestRunner_smp-tester         PASS      4.34 seconds
TestRunner_userchan-tester    PASS      3.18 seconds
TestRunner_6lowpan-tester     PASS      4.40 seconds
IncrementalBuild              PASS      28.52 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v2] Bluetooth: request LE data length for MT7922
WARNING: Non-standard signature: Assisted-by:
#113:

Assisted-by OpenCode:gpt-6.1-sol

ERROR: Unrecognized email address: 'OpenCode:gpt-6.1-sol' #113:

Assisted-by OpenCode:gpt-6.1-sol

WARNING: Non-standard signature: Assisted-by:
#114:

Assisted-by Codex

ERROR: Unrecognized email address: 'Codex'
#114:

Assisted-by Codex

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/15014629.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:
[v2] Bluetooth: request LE data length for MT7922

3: B2 Line has trailing whitespace: "Hi Luiz, "
6: B2 Line has trailing whitespace: "ahead and prepared this v2 quirk patch that " 8: 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/1205

---
Regards,
Linux Bluetooth