* [PATCH 0/2] Bluetooth: Add MediaTek MT7927 (MT6639) support
@ 2026-03-05 16:04 Javier Tia
2026-03-05 16:05 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Javier Tia @ 2026-03-05 16:04 UTC (permalink / raw)
To: linux-bluetooth
Cc: =?utf-8?q?linux-mediatek=40lists=2Einfradead=2Eorg=2C_Marcel_Holtmann_=3Cmarcel=40holtmann=2Eorg=3E=2C_Luiz_Augusto_von_Dentz_=3Cluiz=2Edentz=40gmail=2Ecom=3E=2C_Matthias_Brugger_=3Cmatthias=2Ebgg=40gmail=2Ecom=3E=2C_AngeloGioacchino_Del_Regno_=3Cangelogioacchino=2Edelregno=40collabora=2Ecom=3E=2C_Jean-Fran=C3=A7ois_Marli=C3=A8re_=3Cfreelance=40marliere=2Efr=3E=2C_Paul_Menzel_=3Cpmenzel=40molgen=2Empg=2Ede=3E?=
This series adds Bluetooth support for the MediaTek MT7927 (Filogic 380)
combo WiFi 7 + BT 5.4 module. The BT subsystem uses hardware variant
0x6639 and connects via USB.
The MT7927 is shipping in motherboards and PCIe add-in cards from ASUS,
Gigabyte, Lenovo, and TP-Link since mid-2024. Without these patches,
users see "Unsupported hardware variant (00006639)" or the BT subsystem
hangs during firmware download.
Jean-François Marlière independently identified the same three root
causes and posted an analysis to the list in February [1], though the
patch diff was not included in that message. This series provides the
complete, split patches addressing the same issues.
The series consists of two patches:
[1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support
[2/2] Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639)
Three driver changes are needed for MT6639:
1. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of
"1_1" used by MT7925 and other variants. The firmware path is
mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin.
2. Section filtering: The firmware binary contains 9 sections, but only
sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related.
Sending WiFi/other sections causes an irreversible BT subsystem hang.
The filter is gated on dev_id == 0x6639 to avoid affecting other chips.
3. Firmware persistence: Firmware persists across BT soft power cycles
(WMT_FUNC_CTRL=0 does not clear it). Skip re-download on subsequent
setups to avoid a ~2.6s delay.
The firmware blob (BT_RAM_CODE_MT6639_2_1_hdr.bin) is being submitted
separately to linux-firmware via GitLab MR.
Tested on:
- ASUS ROG Crosshair X870E Hero (USB 0489:e13a)
- Arch Linux 6.19.6, BlueZ 5.82
The companion WiFi support for MT7927 (mt76/mt7925e driver) is being
submitted separately to linux-wireless.
[1] https://lore.kernel.org/linux-bluetooth/496b0f8505eb6ffb19fdbee6f963c62aa6790fba.camel@marliere.fr/
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096
Link: https://github.com/openwrt/mt76/issues/927
Javier Tia (2):
Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support
Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639)
drivers/bluetooth/btmtk.c | 32 ++++++++++++++++++++++++++++++--
drivers/bluetooth/btmtk.h | 1 +
drivers/bluetooth/btusb.c | 10 ++++++++++
3 files changed, 41 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support 2026-03-05 16:04 [PATCH 0/2] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia @ 2026-03-05 16:05 ` Javier Tia 2026-03-05 17:07 ` Luiz Augusto von Dentz ` (2 more replies) 2026-03-05 16:05 ` [PATCH 2/2] Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639) Javier Tia 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2 siblings, 3 replies; 19+ messages in thread From: Javier Tia @ 2026-03-05 16:05 UTC (permalink / raw) To: linux-bluetooth Cc: =?utf-8?q?linux-mediatek=40lists=2Einfradead=2Eorg=2C_Marcel_Holtmann_=3Cmarcel=40holtmann=2Eorg=3E=2C_Luiz_Augusto_von_Dentz_=3Cluiz=2Edentz=40gmail=2Ecom=3E=2C_Matthias_Brugger_=3Cmatthias=2Ebgg=40gmail=2Ecom=3E=2C_AngeloGioacchino_Del_Regno_=3Cangelogioacchino=2Edelregno=40collabora=2Ecom=3E=2C_Jean-Fran=C3=A7ois_Marli=C3=A8re_=3Cfreelance=40marliere=2Efr=3E=2C_Paul_Menzel_=3Cpmenzel=40molgen=2Empg=2Ede=3E?= The MediaTek MT7927 (Filogic 380) combo WiFi 7 + BT 5.4 module uses hardware variant 0x6639 for its Bluetooth subsystem. Without this patch, the chip fails with "Unsupported hardware variant (00006639)" or hangs during firmware download. Three changes are needed to support MT6639: 1. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of "1_1" used by MT7925 and other variants. The firmware path is mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin. 2. Section filtering: The MT6639 firmware binary contains 9 sections, but only sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related. Sending the remaining WiFi/other sections causes an irreversible BT subsystem hang requiring a full power cycle. This matches the Windows driver behavior observed via USB captures. 3. Firmware persistence: MT6639 firmware persists across BT soft power cycles (WMT_FUNC_CTRL=0 does not clear firmware). Skip re-download on subsequent setups to avoid a ~2.6s delay on each BT power toggle. Also add 0x6639 to the reset register (CONNV3) and firmware setup switch cases alongside the existing 0x7925 handling. Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Assisted-by: Claude Code <noreply@anthropic.com> [claude-opus-4-6] Signed-off-by: Javier Tia <floss@jetm.me> --- drivers/bluetooth/btmtk.c | 32 ++++++++++++++++++++++++++++++-- drivers/bluetooth/btmtk.h | 1 + 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 2507d587f28a..3821fde9e361 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -112,7 +112,11 @@ static void btmtk_coredump_notify(struct hci_dev *hdev, int state) void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver, u32 fw_flavor) { - if (dev_id == 0x7925) + if (dev_id == 0x6639) + snprintf(buf, size, + "mediatek/mt%04x/BT_RAM_CODE_MT%04x_2_%x_hdr.bin", + dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); + else if (dev_id == 0x7925) snprintf(buf, size, "mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin", dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); @@ -130,6 +134,7 @@ EXPORT_SYMBOL_GPL(btmtk_fw_get_filename); int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, wmt_cmd_sync_func_t wmt_cmd_sync) { + struct btmtk_data *data = hci_get_priv(hdev); struct btmtk_hci_wmt_params wmt_params; struct btmtk_patch_header *hdr; struct btmtk_global_desc *globaldesc = NULL; @@ -166,6 +171,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, section_offset = le32_to_cpu(sectionmap->secoffset); dl_size = le32_to_cpu(sectionmap->bin_info_spec.dlsize); + /* MT6639: only download sections where dlmode byte0 == 0x01, + * matching the Windows driver behavior which skips WiFi/other + * sections that would cause the chip to hang. + */ + if (data->dev_id == 0x6639 && dl_size > 0 && + (le32_to_cpu(sectionmap->bin_info_spec.dlmodecrctype) & 0xff) != 0x01) + continue; + if (dl_size > 0) { retry = 20; while (retry > 0) { @@ -852,7 +865,7 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) if (err < 0) return err; msleep(100); - } else if (dev_id == 0x7925) { + } else if (dev_id == 0x7925 || dev_id == 0x6639) { err = btmtk_usb_uhw_reg_read(hdev, MTK_BT_RESET_REG_CONNV3, &val); if (err < 0) return err; @@ -1339,9 +1352,20 @@ int btmtk_usb_setup(struct hci_dev *hdev) case 0x7925: case 0x7961: case 0x7902: + case 0x6639: btmtk_fw_get_filename(fw_bin_name, sizeof(fw_bin_name), dev_id, fw_version, fw_flavor); + /* MT6639: firmware persists across BT soft power cycles + * (shutdown only sends WMT_FUNC_CTRL=0). Skip re-download + * on subsequent setups to avoid ~2.6s delay. + */ + if (dev_id == 0x6639 && + test_bit(BTMTK_FIRMWARE_LOADED, &btmtk_data->flags)) { + bt_dev_info(hdev, "MT6639: firmware already loaded, skipping download"); + goto skip_fw_setup_79xx; + } + err = btmtk_setup_firmware_79xx(hdev, fw_bin_name, btmtk_usb_hci_wmt_sync); if (err < 0) { @@ -1352,6 +1376,10 @@ int btmtk_usb_setup(struct hci_dev *hdev) return err; } + if (dev_id == 0x6639) + set_bit(BTMTK_FIRMWARE_LOADED, &btmtk_data->flags); + +skip_fw_setup_79xx: /* It's Device EndPoint Reset Option Register */ err = btmtk_usb_uhw_reg_write(hdev, MTK_EP_RST_OPT, MTK_EP_RST_IN_OUT_OPT); diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h index adaf385626ee..6645bcadb523 100644 --- a/drivers/bluetooth/btmtk.h +++ b/drivers/bluetooth/btmtk.h @@ -8,6 +8,7 @@ #define FIRMWARE_MT7902 "mediatek/BT_RAM_CODE_MT7902_1_1_hdr.bin" #define FIRMWARE_MT7961 "mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin" #define FIRMWARE_MT7925 "mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin" +#define FIRMWARE_MT7927 "mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin" #define HCI_EV_WMT 0xe4 #define HCI_WMT_MAX_EVENT_SIZE 64 -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support 2026-03-05 16:05 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia @ 2026-03-05 17:07 ` Luiz Augusto von Dentz 2026-03-05 18:34 ` Bluetooth: Add MediaTek MT7927 (MT6639) support bluez.test.bot 2026-03-07 16:03 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Sean Wang 2 siblings, 0 replies; 19+ messages in thread From: Luiz Augusto von Dentz @ 2026-03-05 17:07 UTC (permalink / raw) To: Javier Tia; +Cc: linux-bluetooth Hi Javier, On Thu, Mar 5, 2026 at 11:33 AM Javier Tia <floss@jetm.me> wrote: > > The MediaTek MT7927 (Filogic 380) combo WiFi 7 + BT 5.4 module uses > hardware variant 0x6639 for its Bluetooth subsystem. Without this patch, > the chip fails with "Unsupported hardware variant (00006639)" or hangs > during firmware download. > > Three changes are needed to support MT6639: > > 1. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of > "1_1" used by MT7925 and other variants. The firmware path is > mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin. > > 2. Section filtering: The MT6639 firmware binary contains 9 sections, but > only sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related. > Sending the remaining WiFi/other sections causes an irreversible BT > subsystem hang requiring a full power cycle. This matches the Windows > driver behavior observed via USB captures. > > 3. Firmware persistence: MT6639 firmware persists across BT soft power > cycles (WMT_FUNC_CTRL=0 does not clear firmware). Skip re-download on > subsequent setups to avoid a ~2.6s delay on each BT power toggle. > > Also add 0x6639 to the reset register (CONNV3) and firmware setup switch > cases alongside the existing 0x7925 handling. > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 > Link: https://github.com/openwrt/mt76/issues/927 > Assisted-by: Claude Code <noreply@anthropic.com> [claude-opus-4-6] Ditto, we will probably some evidence this was actually tested on systems e.g. dmesg of the pre/post change, also in this case specifically we need a mediatek engineer to confim, with a Signed-off-by, that these changes works as intended. > Signed-off-by: Javier Tia <floss@jetm.me> > --- > drivers/bluetooth/btmtk.c | 32 ++++++++++++++++++++++++++++++-- > drivers/bluetooth/btmtk.h | 1 + > 2 files changed, 31 insertions(+), 2 deletions(-) > > diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c > index 2507d587f28a..3821fde9e361 100644 > --- a/drivers/bluetooth/btmtk.c > +++ b/drivers/bluetooth/btmtk.c > @@ -112,7 +112,11 @@ static void btmtk_coredump_notify(struct hci_dev *hdev, int state) > void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver, > u32 fw_flavor) > { > - if (dev_id == 0x7925) > + if (dev_id == 0x6639) > + snprintf(buf, size, > + "mediatek/mt%04x/BT_RAM_CODE_MT%04x_2_%x_hdr.bin", > + dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); > + else if (dev_id == 0x7925) > snprintf(buf, size, > "mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin", > dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); > @@ -130,6 +134,7 @@ EXPORT_SYMBOL_GPL(btmtk_fw_get_filename); > int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, > wmt_cmd_sync_func_t wmt_cmd_sync) > { > + struct btmtk_data *data = hci_get_priv(hdev); > struct btmtk_hci_wmt_params wmt_params; > struct btmtk_patch_header *hdr; > struct btmtk_global_desc *globaldesc = NULL; > @@ -166,6 +171,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, > section_offset = le32_to_cpu(sectionmap->secoffset); > dl_size = le32_to_cpu(sectionmap->bin_info_spec.dlsize); > > + /* MT6639: only download sections where dlmode byte0 == 0x01, > + * matching the Windows driver behavior which skips WiFi/other > + * sections that would cause the chip to hang. > + */ > + if (data->dev_id == 0x6639 && dl_size > 0 && > + (le32_to_cpu(sectionmap->bin_info_spec.dlmodecrctype) & 0xff) != 0x01) > + continue; > + > if (dl_size > 0) { > retry = 20; > while (retry > 0) { > @@ -852,7 +865,7 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) > if (err < 0) > return err; > msleep(100); > - } else if (dev_id == 0x7925) { > + } else if (dev_id == 0x7925 || dev_id == 0x6639) { > err = btmtk_usb_uhw_reg_read(hdev, MTK_BT_RESET_REG_CONNV3, &val); > if (err < 0) > return err; > @@ -1339,9 +1352,20 @@ int btmtk_usb_setup(struct hci_dev *hdev) > case 0x7925: > case 0x7961: > case 0x7902: > + case 0x6639: > btmtk_fw_get_filename(fw_bin_name, sizeof(fw_bin_name), dev_id, > fw_version, fw_flavor); > > + /* MT6639: firmware persists across BT soft power cycles > + * (shutdown only sends WMT_FUNC_CTRL=0). Skip re-download > + * on subsequent setups to avoid ~2.6s delay. > + */ > + if (dev_id == 0x6639 && > + test_bit(BTMTK_FIRMWARE_LOADED, &btmtk_data->flags)) { > + bt_dev_info(hdev, "MT6639: firmware already loaded, skipping download"); > + goto skip_fw_setup_79xx; > + } > + > err = btmtk_setup_firmware_79xx(hdev, fw_bin_name, > btmtk_usb_hci_wmt_sync); > if (err < 0) { > @@ -1352,6 +1376,10 @@ int btmtk_usb_setup(struct hci_dev *hdev) > return err; > } > > + if (dev_id == 0x6639) > + set_bit(BTMTK_FIRMWARE_LOADED, &btmtk_data->flags); > + > +skip_fw_setup_79xx: > /* It's Device EndPoint Reset Option Register */ > err = btmtk_usb_uhw_reg_write(hdev, MTK_EP_RST_OPT, > MTK_EP_RST_IN_OUT_OPT); > diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h > index adaf385626ee..6645bcadb523 100644 > --- a/drivers/bluetooth/btmtk.h > +++ b/drivers/bluetooth/btmtk.h > @@ -8,6 +8,7 @@ > #define FIRMWARE_MT7902 "mediatek/BT_RAM_CODE_MT7902_1_1_hdr.bin" > #define FIRMWARE_MT7961 "mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin" > #define FIRMWARE_MT7925 "mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin" > +#define FIRMWARE_MT7927 "mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin" > > #define HCI_EV_WMT 0xe4 > #define HCI_WMT_MAX_EVENT_SIZE 64 > -- > 2.53.0 > -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: Bluetooth: Add MediaTek MT7927 (MT6639) support 2026-03-05 16:05 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia 2026-03-05 17:07 ` Luiz Augusto von Dentz @ 2026-03-05 18:34 ` bluez.test.bot 2026-03-07 16:03 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Sean Wang 2 siblings, 0 replies; 19+ messages in thread From: bluez.test.bot @ 2026-03-05 18:34 UTC (permalink / raw) To: linux-bluetooth, floss [-- Attachment #1: Type: text/plain, Size: 4541 bytes --] 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/project/bluetooth/list/?series=1062069 ---Test result--- Test Summary: CheckPatch PENDING 0.49 seconds GitLint PENDING 0.46 seconds SubjectPrefix PASS 0.15 seconds BuildKernel PASS 26.02 seconds CheckAllWarning PASS 28.87 seconds CheckSparse WARNING 32.14 seconds BuildKernel32 PASS 25.35 seconds TestRunnerSetup PASS 567.94 seconds TestRunner_l2cap-tester PASS 29.42 seconds TestRunner_iso-tester FAIL 48.73 seconds TestRunner_bnep-tester PASS 6.44 seconds TestRunner_mgmt-tester FAIL 129.49 seconds TestRunner_rfcomm-tester PASS 9.54 seconds TestRunner_sco-tester FAIL 14.84 seconds TestRunner_ioctl-tester PASS 10.25 seconds TestRunner_mesh-tester FAIL 11.52 seconds TestRunner_smp-tester PASS 8.58 seconds TestRunner_userchan-tester PASS 6.87 seconds IncrementalBuild PENDING 0.53 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: CheckSparse - WARNING Desc: Run sparse tool with linux kernel Output: drivers/bluetooth/btmtk.c:1536:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1537:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1538:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1539:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1540:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1540:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1541:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1542:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1543:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1544:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1545:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1546:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4681:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4682:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4684:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4685:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4687:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4688:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4690:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4691:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4693:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4694:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4695:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4696:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4696:1: error: bad constant expression ############################## Test: TestRunner_iso-tester - FAIL Desc: Run iso-tester with test-runner Output: BUG: KASAN: slab-use-after-free in le_read_features_complete+0x7e/0x2b0 Total: 141, Passed: 141 (100.0%), Failed: 0, Not Run: 0 ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4 Failed Test Cases Read Exp Feature - Success Failed 0.114 seconds ############################## Test: TestRunner_sco-tester - FAIL Desc: Run sco-tester with test-runner Output: WARNING: possible circular locking dependency detected BUG: sleeping function called from invalid context at net/core/sock.c:3782 Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0 ############################## Test: TestRunner_mesh-tester - FAIL Desc: Run mesh-tester with test-runner Output: Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0 Failed Test Cases Mesh - Send cancel - 1 Timed out 1.819 seconds Mesh - Send cancel - 2 Timed out 1.994 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support 2026-03-05 16:05 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia 2026-03-05 17:07 ` Luiz Augusto von Dentz 2026-03-05 18:34 ` Bluetooth: Add MediaTek MT7927 (MT6639) support bluez.test.bot @ 2026-03-07 16:03 ` Sean Wang 2 siblings, 0 replies; 19+ messages in thread From: Sean Wang @ 2026-03-07 16:03 UTC (permalink / raw) To: Javier Tia Cc: linux-bluetooth, moderated list:ARM/Mediatek SoC support, Luiz Augusto von Dentz Hi Javier, On Thu, Mar 5, 2026 at 10:33 AM Javier Tia <floss@jetm.me> wrote: > > The MediaTek MT7927 (Filogic 380) combo WiFi 7 + BT 5.4 module uses > hardware variant 0x6639 for its Bluetooth subsystem. Without this patch, > the chip fails with "Unsupported hardware variant (00006639)" or hangs > during firmware download. > > Three changes are needed to support MT6639: > > 1. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of > "1_1" used by MT7925 and other variants. The firmware path is > mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin. > > 2. Section filtering: The MT6639 firmware binary contains 9 sections, but > only sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related. > Sending the remaining WiFi/other sections causes an irreversible BT > subsystem hang requiring a full power cycle. This matches the Windows > driver behavior observed via USB captures. > > 3. Firmware persistence: MT6639 firmware persists across BT soft power > cycles (WMT_FUNC_CTRL=0 does not clear firmware). Skip re-download on > subsequent setups to avoid a ~2.6s delay on each BT power toggle. > > Also add 0x6639 to the reset register (CONNV3) and firmware setup switch > cases alongside the existing 0x7925 handling. > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 > Link: https://github.com/openwrt/mt76/issues/927 > Assisted-by: Claude Code <noreply@anthropic.com> [claude-opus-4-6] > Signed-off-by: Javier Tia <floss@jetm.me> > --- > drivers/bluetooth/btmtk.c | 32 ++++++++++++++++++++++++++++++-- > drivers/bluetooth/btmtk.h | 1 + > 2 files changed, 31 insertions(+), 2 deletions(-) > > diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c > index 2507d587f28a..3821fde9e361 100644 > --- a/drivers/bluetooth/btmtk.c > +++ b/drivers/bluetooth/btmtk.c > @@ -112,7 +112,11 @@ static void btmtk_coredump_notify(struct hci_dev *hdev, int state) > void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver, > u32 fw_flavor) > { > - if (dev_id == 0x7925) > + if (dev_id == 0x6639) > + snprintf(buf, size, > + "mediatek/mt%04x/BT_RAM_CODE_MT%04x_2_%x_hdr.bin", > + dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); > + else if (dev_id == 0x7925) > snprintf(buf, size, > "mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin", > dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); > @@ -130,6 +134,7 @@ EXPORT_SYMBOL_GPL(btmtk_fw_get_filename); > int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, > wmt_cmd_sync_func_t wmt_cmd_sync) > { > + struct btmtk_data *data = hci_get_priv(hdev); > struct btmtk_hci_wmt_params wmt_params; > struct btmtk_patch_header *hdr; > struct btmtk_global_desc *globaldesc = NULL; > @@ -166,6 +171,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, > section_offset = le32_to_cpu(sectionmap->secoffset); > dl_size = le32_to_cpu(sectionmap->bin_info_spec.dlsize); > > + /* MT6639: only download sections where dlmode byte0 == 0x01, > + * matching the Windows driver behavior which skips WiFi/other > + * sections that would cause the chip to hang. > + */ BT and WiFi use separate firmware. I’m not sure why those WiFi sections are included in the binary. Another concern is whether it is appropriate to upload the firmware used in Windows to the linux-firmware repository, The firmware files are probably intended for dedicated OEMs. > + if (data->dev_id == 0x6639 && dl_size > 0 && > + (le32_to_cpu(sectionmap->bin_info_spec.dlmodecrctype) & 0xff) != 0x01) > + continue; > + > if (dl_size > 0) { > retry = 20; > while (retry > 0) { > @@ -852,7 +865,7 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) > if (err < 0) > return err; > msleep(100); > - } else if (dev_id == 0x7925) { > + } else if (dev_id == 0x7925 || dev_id == 0x6639) { > err = btmtk_usb_uhw_reg_read(hdev, MTK_BT_RESET_REG_CONNV3, &val); > if (err < 0) > return err; > @@ -1339,9 +1352,20 @@ int btmtk_usb_setup(struct hci_dev *hdev) > case 0x7925: > case 0x7961: > case 0x7902: > + case 0x6639: > btmtk_fw_get_filename(fw_bin_name, sizeof(fw_bin_name), dev_id, > fw_version, fw_flavor); > > + /* MT6639: firmware persists across BT soft power cycles > + * (shutdown only sends WMT_FUNC_CTRL=0). Skip re-download > + * on subsequent setups to avoid ~2.6s delay. > + */ This is common logic for the other mediatek chips. It only takes longer on the first power-on. > + if (dev_id == 0x6639 && > + test_bit(BTMTK_FIRMWARE_LOADED, &btmtk_data->flags)) { > + bt_dev_info(hdev, "MT6639: firmware already loaded, skipping download"); > + goto skip_fw_setup_79xx; > + } > + > err = btmtk_setup_firmware_79xx(hdev, fw_bin_name, > btmtk_usb_hci_wmt_sync); > if (err < 0) { > @@ -1352,6 +1376,10 @@ int btmtk_usb_setup(struct hci_dev *hdev) > return err; > } > > + if (dev_id == 0x6639) > + set_bit(BTMTK_FIRMWARE_LOADED, &btmtk_data->flags); If the firmware download is properly handled in btmtk_setup_firmware_79xx, we don't need the extra bit. > + > +skip_fw_setup_79xx: > /* It's Device EndPoint Reset Option Register */ > err = btmtk_usb_uhw_reg_write(hdev, MTK_EP_RST_OPT, > MTK_EP_RST_IN_OUT_OPT); > diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h > index adaf385626ee..6645bcadb523 100644 > --- a/drivers/bluetooth/btmtk.h > +++ b/drivers/bluetooth/btmtk.h > @@ -8,6 +8,7 @@ > #define FIRMWARE_MT7902 "mediatek/BT_RAM_CODE_MT7902_1_1_hdr.bin" > #define FIRMWARE_MT7961 "mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin" > #define FIRMWARE_MT7925 "mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin" > +#define FIRMWARE_MT7927 "mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin" > > #define HCI_EV_WMT 0xe4 > #define HCI_WMT_MAX_EVENT_SIZE 64 > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 2/2] Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639) 2026-03-05 16:04 [PATCH 0/2] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2026-03-05 16:05 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia @ 2026-03-05 16:05 ` Javier Tia 2026-03-05 17:00 ` Luiz Augusto von Dentz 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2 siblings, 1 reply; 19+ messages in thread From: Javier Tia @ 2026-03-05 16:05 UTC (permalink / raw) To: linux-bluetooth Cc: =?utf-8?q?linux-mediatek=40lists=2Einfradead=2Eorg=2C_Marcel_Holtmann_=3Cmarcel=40holtmann=2Eorg=3E=2C_Luiz_Augusto_von_Dentz_=3Cluiz=2Edentz=40gmail=2Ecom=3E=2C_Matthias_Brugger_=3Cmatthias=2Ebgg=40gmail=2Ecom=3E=2C_AngeloGioacchino_Del_Regno_=3Cangelogioacchino=2Edelregno=40collabora=2Ecom=3E=2C_Jean-Fran=C3=A7ois_Marli=C3=A8re_=3Cfreelance=40marliere=2Efr=3E=2C_Paul_Menzel_=3Cpmenzel=40molgen=2Empg=2Ede=3E?= Add USB device IDs for the Bluetooth interface of the MediaTek MT7927 (Filogic 380) combo WiFi 7 + BT 5.4 module. The BT side uses hardware variant 0x6639 and connects via USB. Known devices: - 0489:e13a - ASUS ROG Crosshair X870E Hero (Foxconn/Hon Hai) - 0489:e0fa - Lenovo Legion Pro 7 16ARX9 (Foxconn/Hon Hai) - 0489:e10f - Gigabyte Z790 AORUS MASTER X (Foxconn/Hon Hai) - 0489:e116 - TP-Link Archer TBE550E PCIe (Foxconn/Hon Hai) - 13d3:3588 - ASUS X870E-E / ProArt X870E-Creator (IMC/Azurewave) Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Assisted-by: Claude Code <noreply@anthropic.com> [claude-opus-4-6] Signed-off-by: Javier Tia <floss@jetm.me> --- drivers/bluetooth/btusb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index a5e44887a5b5..d5e990cf8ccd 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -751,6 +751,16 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe139), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe13a), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe0fa), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe10f), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe116), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x13d3, 0x3588), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 2/2] Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639) 2026-03-05 16:05 ` [PATCH 2/2] Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639) Javier Tia @ 2026-03-05 17:00 ` Luiz Augusto von Dentz 0 siblings, 0 replies; 19+ messages in thread From: Luiz Augusto von Dentz @ 2026-03-05 17:00 UTC (permalink / raw) To: Javier Tia; +Cc: linux-bluetooth Hi Javier, On Thu, Mar 5, 2026 at 11:33 AM Javier Tia <floss@jetm.me> wrote: > > Add USB device IDs for the Bluetooth interface of the MediaTek MT7927 > (Filogic 380) combo WiFi 7 + BT 5.4 module. The BT side uses hardware > variant 0x6639 and connects via USB. > > Known devices: > - 0489:e13a - ASUS ROG Crosshair X870E Hero (Foxconn/Hon Hai) > - 0489:e0fa - Lenovo Legion Pro 7 16ARX9 (Foxconn/Hon Hai) > - 0489:e10f - Gigabyte Z790 AORUS MASTER X (Foxconn/Hon Hai) > - 0489:e116 - TP-Link Archer TBE550E PCIe (Foxconn/Hon Hai) > - 13d3:3588 - ASUS X870E-E / ProArt X870E-Creator (IMC/Azurewave) Is the lsusb information for these devices present in the links? We normally require that to confirm these ID's are real/valid. > Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 > Link: https://github.com/openwrt/mt76/issues/927 > Assisted-by: Claude Code <noreply@anthropic.com> [claude-opus-4-6] Ok, this is especially valid if AI assisted, otherwise we would probably need to ensure the agent has access to every board to list its IDs, etc. Regarding the use of AI, there doesn't seem to be a global policy. However, for Bluetooth Im not inclined to accept any patches that hasn't been properly reviewed by the author, so if this was fully automated and not verified by a human and I definitely don't want my feedback to just be used as prompt to AI agents, I would do it myself and not waste my time writing a response. > Signed-off-by: Javier Tia <floss@jetm.me> > --- > drivers/bluetooth/btusb.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index a5e44887a5b5..d5e990cf8ccd 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -751,6 +751,16 @@ static const struct usb_device_id quirks_table[] = { > BTUSB_WIDEBAND_SPEECH }, > { USB_DEVICE(0x0489, 0xe139), .driver_info = BTUSB_MEDIATEK | > BTUSB_WIDEBAND_SPEECH }, > + { USB_DEVICE(0x0489, 0xe13a), .driver_info = BTUSB_MEDIATEK | > + BTUSB_WIDEBAND_SPEECH }, > + { USB_DEVICE(0x0489, 0xe0fa), .driver_info = BTUSB_MEDIATEK | > + BTUSB_WIDEBAND_SPEECH }, > + { USB_DEVICE(0x0489, 0xe10f), .driver_info = BTUSB_MEDIATEK | > + BTUSB_WIDEBAND_SPEECH }, > + { USB_DEVICE(0x0489, 0xe116), .driver_info = BTUSB_MEDIATEK | > + BTUSB_WIDEBAND_SPEECH }, > + { USB_DEVICE(0x13d3, 0x3588), .driver_info = BTUSB_MEDIATEK | > + BTUSB_WIDEBAND_SPEECH }, > { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | > BTUSB_WIDEBAND_SPEECH }, > { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | > -- > 2.53.0 > -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support 2026-03-05 16:04 [PATCH 0/2] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2026-03-05 16:05 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia 2026-03-05 16:05 ` [PATCH 2/2] Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639) Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:13 ` [PATCH v3 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia ` (8 more replies) 2 siblings, 9 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Ryan Gilbert, Jose Tiburcio Ribeiro Netto, Llewellyn Curran, Chapuis Dario, Evgeny Kapusta, Nitin Gurram, Thibaut FRANCOIS, Ivan Lubnin This series adds Bluetooth support for the MediaTek MT7927 (Filogic 380) combo WiFi 7 + BT 5.4 module. The BT subsystem uses hardware variant 0x6639 and connects via USB. The MT7927 is shipping in motherboards and PCIe add-in cards from ASUS, Gigabyte, Lenovo, MSI, and TP-Link since mid-2024. Without these patches, users see "Unsupported hardware variant (00006639)" or the BT subsystem hangs during firmware download. The series consists of eight patches: [1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support [2/8] Bluetooth: btmtk: fix ISO interface setup for single alt setting [3/8] Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero [4/8] Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 [5/8] Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X [6/8] Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max [7/8] Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E [8/8] Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator Three driver changes are needed for MT6639 (patch 1): 1. CHIPID workaround: On some boards the BT USB MMIO register reads 0x0000 for dev_id. Force dev_id to 0x6639 only when the USB VID/PID matches a known MT6639 device, avoiding misdetection if a future chip also reads zero. This follows the WiFi-side pattern. 2. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of "1_1" used by MT7925 and other variants. The firmware path is mediatek/mt7927/BT_RAM_CODE_MT6639_2_1_hdr.bin, using the mt7927 directory to match the WiFi firmware convention. The filename will likely change to use MT7927 once MediaTek submits a dedicated Linux firmware binary. 3. Section filtering: The firmware binary contains 9 sections, but only sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related. Sending WiFi/other sections causes an irreversible BT subsystem hang. Patch 2 fixes the ISO interface setup for devices that expose only a single alternate setting (alt 0) on the ISO endpoint. Without this fix, btmtk_usb_claim_iso_intf() fails with EINVAL, causing ~20 second initialization delays on 13d3:3588 devices. Tested on: - ASUS ROG Crosshair X870E Hero (USB 0489:e13a) - ASUS ROG STRIX X870E-E (USB 13d3:3588) - ASUS ROG STRIX B850-E GAMING WIFI (USB 0489:e13a) - Gigabyte Z790 AORUS MASTER X (USB 0489:e10f) - Lenovo Legion Pro 7 16ARX9 (USB 0489:e0fa) - MSI MEG X870E ACE MAX (USB 0489:e110) - TP-Link Archer TBE550E PCIe (USB 0489:e116) The firmware blob is being submitted separately to linux-firmware via GitLab MR !946. The firmware path has been updated to mediatek/mt7927/ per maintainer feedback. Changes in v3 (suggested by Sean Wang): - Scoped CHIPID workaround to a static VID/PID table of known MT6639 USB devices instead of mapping all zero-CHIPID cases to 0x6639 - Changed firmware path from mediatek/mt6639/ to mediatek/mt7927/ to match the WiFi firmware convention and avoid confusion - Added MODULE_FIRMWARE(FIRMWARE_MT7927) for initramfs firmware discovery - Added Tested-by for 0489:e110 (Nitin Gurram) Changes in v2: - Split USB device IDs into per-device commits as requested (Luiz) - Added 0489:e110 (MSI X870E Ace Max, new hardware report) - Added ISO interface fix for single alt setting (13d3:3588 devices) - Added Tested-by trailers for all USB IDs - Added USB descriptor output to all per-device commits - Removed BTMTK_FIRMWARE_LOADED skip logic (Sean Wang) Link to v2: https://lore.kernel.org/linux-bluetooth/20260325-mt7927-bt-support-v2-0-b892a3252880@jetm.me/T/#t Link to v1: https://lore.kernel.org/linux-bluetooth/177272816248.352280.12453518046823439297@jetm.me/ Signed-off-by: Javier Tia <floss@jetm.me> --- Javier Tia (8): Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Bluetooth: btmtk: fix ISO interface setup for single alt setting Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator drivers/bluetooth/btmtk.c | 56 ++++++++++++++++++++++++++++++++++++++++++++--- drivers/bluetooth/btmtk.h | 1 + drivers/bluetooth/btusb.c | 12 ++++++++++ 3 files changed, 66 insertions(+), 3 deletions(-) --- base-commit: 50003ce2085a7f7dacf2426065d1a69c84b5b963 change-id: 20260305-mt7927-bt-support-6589a50c961f Best regards, -- Javier Tia <floss@jetm.me> ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:44 ` [v3,1/8] " bluez.test.bot 2026-03-26 22:13 ` [PATCH v3 2/8] Bluetooth: btmtk: fix ISO interface setup for single alt setting Javier Tia ` (7 subsequent siblings) 8 siblings, 1 reply; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Ryan Gilbert The MediaTek MT7927 (Filogic 380) combo WiFi 7 + BT 5.4 module uses hardware variant 0x6639 for its Bluetooth subsystem. Without this patch, the chip fails with "Unsupported hardware variant (00006639)" or hangs during firmware download. Three changes are needed to support MT6639: 1. CHIPID workaround: On some boards the BT USB MMIO register reads 0x0000 for dev_id, causing the driver to skip the 0x6639 init path. Force dev_id to 0x6639 only when the USB VID/PID matches a known MT6639 device, avoiding misdetection if a future chip also reads zero. This follows the WiFi-side pattern that uses PCI device IDs to scope the same workaround. 2. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of "1_1" used by MT7925 and other variants. The firmware path is mediatek/mt7927/BT_RAM_CODE_MT6639_2_1_hdr.bin, using the mt7927 directory to match the WiFi firmware convention. The filename will likely change to use MT7927 once MediaTek submits a dedicated Linux firmware binary. 3. Section filtering: The MT6639 firmware binary contains 9 sections, but only sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related. Sending the remaining WiFi/other sections causes an irreversible BT subsystem hang requiring a full power cycle. This matches the Windows driver behavior observed via USB captures. Also add 0x6639 to the reset register (CONNV3) and firmware setup switch cases alongside the existing 0x7925 handling. Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Reported-by: Ryan Gilbert <xelnaga@gmail.com> Signed-off-by: Javier Tia <floss@jetm.me> --- drivers/bluetooth/btmtk.c | 53 +++++++++++++++++++++++++++++++++++++++++++++-- drivers/bluetooth/btmtk.h | 1 + 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 2507d587f28a..3f12f2ab6369 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -25,6 +25,22 @@ /* It is for mt79xx iso data transmission setting */ #define MTK_ISO_THRESHOLD 264 +/* Known MT6639 (MT7927) Bluetooth USB devices. + * Used to scope the zero-CHIPID workaround to real MT6639 hardware, + * since some boards return 0x0000 from the MMIO chip ID register. + */ +static const struct { + u16 vendor; + u16 product; +} btmtk_mt6639_devs[] = { + { 0x0489, 0xe13a }, /* ASUS ROG Crosshair X870E Hero */ + { 0x0489, 0xe0fa }, /* Lenovo Legion Pro 7 16ARX9 */ + { 0x0489, 0xe10f }, /* Gigabyte Z790 AORUS MASTER X */ + { 0x0489, 0xe110 }, /* MSI X870E Ace Max */ + { 0x0489, 0xe116 }, /* TP-Link Archer TBE550E */ + { 0x13d3, 0x3588 }, /* ASUS ROG STRIX X870E-E */ +}; + struct btmtk_patch_header { u8 datetime[16]; u8 platform[4]; @@ -112,7 +128,11 @@ static void btmtk_coredump_notify(struct hci_dev *hdev, int state) void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver, u32 fw_flavor) { - if (dev_id == 0x7925) + if (dev_id == 0x6639) + snprintf(buf, size, + "mediatek/mt7927/BT_RAM_CODE_MT%04x_2_%x_hdr.bin", + dev_id & 0xffff, (fw_ver & 0xff) + 1); + else if (dev_id == 0x7925) snprintf(buf, size, "mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin", dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); @@ -130,6 +150,7 @@ EXPORT_SYMBOL_GPL(btmtk_fw_get_filename); int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, wmt_cmd_sync_func_t wmt_cmd_sync) { + struct btmtk_data *data = hci_get_priv(hdev); struct btmtk_hci_wmt_params wmt_params; struct btmtk_patch_header *hdr; struct btmtk_global_desc *globaldesc = NULL; @@ -166,6 +187,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, section_offset = le32_to_cpu(sectionmap->secoffset); dl_size = le32_to_cpu(sectionmap->bin_info_spec.dlsize); + /* MT6639: only download sections where dlmode byte0 == 0x01, + * matching the Windows driver behavior which skips WiFi/other + * sections that would cause the chip to hang. + */ + if (data->dev_id == 0x6639 && dl_size > 0 && + (le32_to_cpu(sectionmap->bin_info_spec.dlmodecrctype) & 0xff) != 0x01) + continue; + if (dl_size > 0) { retry = 20; while (retry > 0) { @@ -852,7 +881,7 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) if (err < 0) return err; msleep(100); - } else if (dev_id == 0x7925) { + } else if (dev_id == 0x7925 || dev_id == 0x6639) { err = btmtk_usb_uhw_reg_read(hdev, MTK_BT_RESET_REG_CONNV3, &val); if (err < 0) return err; @@ -1322,6 +1351,24 @@ int btmtk_usb_setup(struct hci_dev *hdev) fw_flavor = (fw_flavor & 0x00000080) >> 7; } + if (!dev_id) { + u16 vid = le16_to_cpu(btmtk_data->udev->descriptor.idVendor); + u16 pid = le16_to_cpu(btmtk_data->udev->descriptor.idProduct); + int i; + + for (i = 0; i < ARRAY_SIZE(btmtk_mt6639_devs); i++) { + if (vid == btmtk_mt6639_devs[i].vendor && + pid == btmtk_mt6639_devs[i].product) { + dev_id = 0x6639; + break; + } + } + + if (dev_id) + bt_dev_info(hdev, "MT6639: CHIPID=0x0000 with VID=%04x PID=%04x, using 0x6639", + vid, pid); + } + btmtk_data->dev_id = dev_id; err = btmtk_register_coredump(hdev, btmtk_data->drv_name, fw_version); @@ -1339,6 +1386,7 @@ int btmtk_usb_setup(struct hci_dev *hdev) case 0x7925: case 0x7961: case 0x7902: + case 0x6639: btmtk_fw_get_filename(fw_bin_name, sizeof(fw_bin_name), dev_id, fw_version, fw_flavor); @@ -1516,3 +1564,4 @@ MODULE_FIRMWARE(FIRMWARE_MT7668); MODULE_FIRMWARE(FIRMWARE_MT7922); MODULE_FIRMWARE(FIRMWARE_MT7961); MODULE_FIRMWARE(FIRMWARE_MT7925); +MODULE_FIRMWARE(FIRMWARE_MT7927); diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h index adaf385626ee..d95d023b6adc 100644 --- a/drivers/bluetooth/btmtk.h +++ b/drivers/bluetooth/btmtk.h @@ -8,6 +8,7 @@ #define FIRMWARE_MT7902 "mediatek/BT_RAM_CODE_MT7902_1_1_hdr.bin" #define FIRMWARE_MT7961 "mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin" #define FIRMWARE_MT7925 "mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin" +#define FIRMWARE_MT7927 "mediatek/mt7927/BT_RAM_CODE_MT6639_2_1_hdr.bin" #define HCI_EV_WMT 0xe4 #define HCI_WMT_MAX_EVENT_SIZE 64 -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* RE: [v3,1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support 2026-03-26 22:13 ` [PATCH v3 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia @ 2026-03-26 22:44 ` bluez.test.bot 0 siblings, 0 replies; 19+ messages in thread From: bluez.test.bot @ 2026-03-26 22:44 UTC (permalink / raw) To: linux-bluetooth, floss [-- Attachment #1: Type: text/plain, Size: 2833 bytes --] 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/project/bluetooth/list/?series=1073200 ---Test result--- Test Summary: CheckPatch PENDING 0.25 seconds GitLint PENDING 0.25 seconds SubjectPrefix PASS 0.99 seconds BuildKernel PASS 26.86 seconds CheckAllWarning PASS 30.12 seconds CheckSparse PASS 29.18 seconds BuildKernel32 PASS 25.81 seconds TestRunnerSetup PASS 573.60 seconds TestRunner_l2cap-tester PASS 27.82 seconds TestRunner_iso-tester FAIL 38.78 seconds TestRunner_bnep-tester PASS 6.40 seconds TestRunner_mgmt-tester FAIL 116.99 seconds TestRunner_rfcomm-tester PASS 9.56 seconds TestRunner_sco-tester FAIL 14.26 seconds TestRunner_ioctl-tester PASS 10.17 seconds TestRunner_mesh-tester FAIL 12.46 seconds TestRunner_smp-tester PASS 8.67 seconds TestRunner_userchan-tester PASS 6.74 seconds IncrementalBuild PENDING 0.51 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: TestRunner_iso-tester - FAIL Desc: Run iso-tester with test-runner Output: BUG: KASAN: slab-use-after-free in le_read_features_complete+0x7e/0x2b0 Total: 141, Passed: 141 (100.0%), Failed: 0, Not Run: 0 ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4 Failed Test Cases Read Exp Feature - Success Failed 0.115 seconds ############################## Test: TestRunner_sco-tester - FAIL Desc: Run sco-tester with test-runner Output: WARNING: possible circular locking dependency detected BUG: sleeping function called from invalid context at net/core/sock.c:3782 Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0 ############################## Test: TestRunner_mesh-tester - FAIL Desc: Run mesh-tester with test-runner Output: Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0 Failed Test Cases Mesh - Send cancel - 1 Timed out 2.750 seconds Mesh - Send cancel - 2 Timed out 1.995 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 2/8] Bluetooth: btmtk: fix ISO interface setup for single alt setting 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2026-03-26 22:13 ` [PATCH v3 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:13 ` [PATCH v3 3/8] Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero Javier Tia ` (6 subsequent siblings) 8 siblings, 0 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Ryan Gilbert Some MT6639 Bluetooth USB interfaces (e.g. IMC Networks 13d3:3588 on ASUS ROG STRIX X870E-E and ProArt X870E-Creator boards) expose only a single alternate setting (alt 0) on the ISO interface. The driver unconditionally requests alt setting 1, which fails with EINVAL on these devices, causing a ~20 second initialization delay and no LE audio support. Check the number of available alternate settings before selecting one. If only alt 0 exists, use it; otherwise request alt 1 as before. Link: https://github.com/jetm/mediatek-mt7927-dkms/pull/39 Signed-off-by: Javier Tia <floss@jetm.me> Reported-by: Ryan Gilbert <xelnaga@gmail.com> Tested-by: Ryan Gilbert <xelnaga@gmail.com> --- drivers/bluetooth/btmtk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 3f12f2ab6369..95b09b1ea78f 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -1029,7 +1029,8 @@ static int __set_mtk_intr_interface(struct hci_dev *hdev) if (!btmtk_data->isopkt_intf) return -ENODEV; - err = usb_set_interface(btmtk_data->udev, MTK_ISO_IFNUM, 1); + err = usb_set_interface(btmtk_data->udev, MTK_ISO_IFNUM, + (intf->num_altsetting > 1) ? 1 : 0); if (err < 0) { bt_dev_err(hdev, "setting interface failed (%d)", -err); return err; -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 3/8] Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2026-03-26 22:13 ` [PATCH v3 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia 2026-03-26 22:13 ` [PATCH v3 2/8] Bluetooth: btmtk: fix ISO interface setup for single alt setting Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:13 ` [PATCH v3 4/8] Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 Javier Tia ` (5 subsequent siblings) 8 siblings, 0 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Jose Tiburcio Ribeiro Netto Add USB device ID 0489:e13a (Foxconn/Hon Hai) for the MediaTek MT7927 (Filogic 380) Bluetooth interface found on the ASUS ROG Crosshair X870E Hero WiFi motherboard. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=05 Cnt=04 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e13a Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb ... I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Signed-off-by: Javier Tia <floss@jetm.me> Tested-by: Jose Tiburcio Ribeiro Netto <jnetto@mineiro.io> --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index a5e44887a5b5..58309af0f7a2 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -751,6 +751,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe139), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe13a), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 4/8] Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia ` (2 preceding siblings ...) 2026-03-26 22:13 ` [PATCH v3 3/8] Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:13 ` [PATCH v3 5/8] Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X Javier Tia ` (4 subsequent siblings) 8 siblings, 0 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Llewellyn Curran Add USB device ID 0489:e0fa (Foxconn/Hon Hai) for the MediaTek MT7927 (Filogic 380) Bluetooth interface found on the Lenovo Legion Pro 7 16ARX9 laptop. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=05 Cnt=04 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0fa Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb ... I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Signed-off-by: Javier Tia <floss@jetm.me> Tested-by: Llewellyn Curran <melinko2003@gmail.com> --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 58309af0f7a2..2c9ca3d6016b 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -753,6 +753,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe13a), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe0fa), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 5/8] Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia ` (3 preceding siblings ...) 2026-03-26 22:13 ` [PATCH v3 4/8] Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:13 ` [PATCH v3 6/8] Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max Javier Tia ` (3 subsequent siblings) 8 siblings, 0 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Chapuis Dario, Evgeny Kapusta Add USB device ID 0489:e10f (Foxconn/Hon Hai) for the MediaTek MT7927 (Filogic 380) Bluetooth interface found on the Gigabyte Z790 AORUS MASTER X motherboard. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=05 Cnt=04 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e10f Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb ... I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Signed-off-by: Javier Tia <floss@jetm.me> Tested-by: Chapuis Dario <chapuisdario4@gmail.com> Tested-by: Evgeny Kapusta <3193631@gmail.com> --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 2c9ca3d6016b..d60798331bb3 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -755,6 +755,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe0fa), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe10f), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 6/8] Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia ` (4 preceding siblings ...) 2026-03-26 22:13 ` [PATCH v3 5/8] Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:13 ` [PATCH v3 7/8] Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E Javier Tia ` (2 subsequent siblings) 8 siblings, 0 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Nitin Gurram Add USB device ID 0489:e110 (Foxconn/Hon Hai) for the MediaTek MT7927 (Filogic 380) Bluetooth interface found on the MSI X870E Ace Max motherboard. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=05 Cnt=04 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e110 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb ... I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Signed-off-by: Javier Tia <floss@jetm.me> Tested-by: Nitin Gurram <nitin.reddy88@gmail.com> --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index d60798331bb3..96882e9b831c 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -757,6 +757,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe10f), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe110), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 7/8] Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia ` (5 preceding siblings ...) 2026-03-26 22:13 ` [PATCH v3 6/8] Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-26 22:13 ` [PATCH v3 8/8] Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator Javier Tia 2026-03-27 17:58 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Luiz Augusto von Dentz 8 siblings, 0 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Thibaut FRANCOIS Add USB device ID 0489:e116 (Foxconn/Hon Hai) for the MediaTek MT7927 (Filogic 380) Bluetooth interface found on the TP-Link Archer TBE550E PCIe adapter. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=05 Cnt=04 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e116 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb ... I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Signed-off-by: Javier Tia <floss@jetm.me> Tested-by: Thibaut FRANCOIS <tibo@humeurlibre.fr> --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 96882e9b831c..55a000540439 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -759,6 +759,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe110), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe116), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 8/8] Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia ` (6 preceding siblings ...) 2026-03-26 22:13 ` [PATCH v3 7/8] Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E Javier Tia @ 2026-03-26 22:13 ` Javier Tia 2026-03-27 17:58 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Luiz Augusto von Dentz 8 siblings, 0 replies; 19+ messages in thread From: Javier Tia @ 2026-03-26 22:13 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Jose Tiburcio Ribeiro Netto, Ivan Lubnin Add USB device ID 13d3:3588 (IMC Networks/Azurewave) for the MediaTek MT7927 (Filogic 380) Bluetooth interface found on the ASUS ROG STRIX X870E-E GAMING WIFI and ASUS ProArt X870E-Creator WiFi motherboards. Note: boards with this USB ID report only one ISO alternate setting (alt 0), causing a non-fatal "setting interface failed (22)" during setup. Bluetooth still functions but initialization takes ~19 seconds instead of ~2.6 seconds. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3588 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Signed-off-by: Javier Tia <floss@jetm.me> Tested-by: Jose Tiburcio Ribeiro Netto <jnetto@mineiro.io> Tested-by: Ivan Lubnin <lubnin.ivan@gmail.com> --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 55a000540439..45ef0d008bce 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -761,6 +761,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe116), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x13d3, 0x3588), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14e), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe14f), .driver_info = BTUSB_MEDIATEK | -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia ` (7 preceding siblings ...) 2026-03-26 22:13 ` [PATCH v3 8/8] Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator Javier Tia @ 2026-03-27 17:58 ` Luiz Augusto von Dentz 8 siblings, 0 replies; 19+ messages in thread From: Luiz Augusto von Dentz @ 2026-03-27 17:58 UTC (permalink / raw) To: Javier Tia Cc: Marcel Holtmann, Matthias Brugger, AngeloGioacchino Del Regno, linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Ryan Gilbert, Jose Tiburcio Ribeiro Netto, Llewellyn Curran, Chapuis Dario, Evgeny Kapusta, Nitin Gurram, Thibaut FRANCOIS, Ivan Lubnin Hi Javier, On Thu, Mar 26, 2026 at 6:13 PM Javier Tia <floss@jetm.me> wrote: > > This series adds Bluetooth support for the MediaTek MT7927 (Filogic 380) > combo WiFi 7 + BT 5.4 module. The BT subsystem uses hardware variant > 0x6639 and connects via USB. > > The MT7927 is shipping in motherboards and PCIe add-in cards from ASUS, > Gigabyte, Lenovo, MSI, and TP-Link since mid-2024. Without these patches, > users see "Unsupported hardware variant (00006639)" or the BT subsystem > hangs during firmware download. > > The series consists of eight patches: > > [1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support > [2/8] Bluetooth: btmtk: fix ISO interface setup for single alt setting > [3/8] Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero > [4/8] Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 > [5/8] Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X > [6/8] Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max > [7/8] Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E > [8/8] Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator > > Three driver changes are needed for MT6639 (patch 1): > > 1. CHIPID workaround: On some boards the BT USB MMIO register reads > 0x0000 for dev_id. Force dev_id to 0x6639 only when the USB VID/PID > matches a known MT6639 device, avoiding misdetection if a future > chip also reads zero. This follows the WiFi-side pattern. > > 2. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of > "1_1" used by MT7925 and other variants. The firmware path is > mediatek/mt7927/BT_RAM_CODE_MT6639_2_1_hdr.bin, using the mt7927 > directory to match the WiFi firmware convention. The filename will > likely change to use MT7927 once MediaTek submits a dedicated > Linux firmware binary. > > 3. Section filtering: The firmware binary contains 9 sections, but only > sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related. > Sending WiFi/other sections causes an irreversible BT subsystem hang. > > Patch 2 fixes the ISO interface setup for devices that expose only a > single alternate setting (alt 0) on the ISO endpoint. Without this fix, > btmtk_usb_claim_iso_intf() fails with EINVAL, causing ~20 second > initialization delays on 13d3:3588 devices. > > Tested on: > - ASUS ROG Crosshair X870E Hero (USB 0489:e13a) > - ASUS ROG STRIX X870E-E (USB 13d3:3588) > - ASUS ROG STRIX B850-E GAMING WIFI (USB 0489:e13a) > - Gigabyte Z790 AORUS MASTER X (USB 0489:e10f) > - Lenovo Legion Pro 7 16ARX9 (USB 0489:e0fa) > - MSI MEG X870E ACE MAX (USB 0489:e110) > - TP-Link Archer TBE550E PCIe (USB 0489:e116) > > The firmware blob is being submitted separately to linux-firmware via > GitLab MR !946. The firmware path has been updated to mediatek/mt7927/ > per maintainer feedback. > > Changes in v3 (suggested by Sean Wang): > - Scoped CHIPID workaround to a static VID/PID table of known MT6639 > USB devices instead of mapping all zero-CHIPID cases to 0x6639 > - Changed firmware path from mediatek/mt6639/ to mediatek/mt7927/ to > match the WiFi firmware convention and avoid confusion > - Added MODULE_FIRMWARE(FIRMWARE_MT7927) for initramfs firmware discovery > - Added Tested-by for 0489:e110 (Nitin Gurram) > > Changes in v2: > - Split USB device IDs into per-device commits as requested (Luiz) > - Added 0489:e110 (MSI X870E Ace Max, new hardware report) > - Added ISO interface fix for single alt setting (13d3:3588 devices) > - Added Tested-by trailers for all USB IDs > - Added USB descriptor output to all per-device commits > - Removed BTMTK_FIRMWARE_LOADED skip logic (Sean Wang) > > Link to v2: https://lore.kernel.org/linux-bluetooth/20260325-mt7927-bt-support-v2-0-b892a3252880@jetm.me/T/#t > Link to v1: https://lore.kernel.org/linux-bluetooth/177272816248.352280.12453518046823439297@jetm.me/ > > Signed-off-by: Javier Tia <floss@jetm.me> > --- > Javier Tia (8): > Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support > Bluetooth: btmtk: fix ISO interface setup for single alt setting > Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero > Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 > Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X > Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max > Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E > Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator > > drivers/bluetooth/btmtk.c | 56 ++++++++++++++++++++++++++++++++++++++++++++--- > drivers/bluetooth/btmtk.h | 1 + > drivers/bluetooth/btusb.c | 12 ++++++++++ > 3 files changed, 66 insertions(+), 3 deletions(-) > --- > base-commit: 50003ce2085a7f7dacf2426065d1a69c84b5b963 > change-id: 20260305-mt7927-bt-support-6589a50c961f > > Best regards, > -- > Javier Tia <floss@jetm.me> https://sashiko.dev/#/patchset/20260326-mt7927-bt-support-v3-0-fa7ebd424323%40jetm.me First one is more concerning since it may mean it can lead to crashes with SDIO driver, the other comment may actually need to be addressed separately, perhaps WBS handling needs to be fixed on this family of controllers. -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support @ 2026-03-25 23:30 Javier Tia 2026-03-26 0:19 ` Bluetooth: Add MediaTek MT7927 (MT6639) support bluez.test.bot 0 siblings, 1 reply; 19+ messages in thread From: Javier Tia @ 2026-03-25 23:30 UTC (permalink / raw) To: Marcel Holtmann, Luiz Augusto von Dentz, Matthias Brugger, AngeloGioacchino Del Regno Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek, Ryan Gilbert The MediaTek MT7927 (Filogic 380) combo WiFi 7 + BT 5.4 module uses hardware variant 0x6639 for its Bluetooth subsystem. Without this patch, the chip fails with "Unsupported hardware variant (00006639)" or hangs during firmware download. Three changes are needed to support MT6639: 1. CHIPID workaround: On some boards the BT USB MMIO register reads 0x0000 for dev_id, causing the driver to skip the 0x6639 init path. Force dev_id to 0x6639 when it reads zero, matching the equivalent WiFi-side workaround that forces chip=0x7927. 2. Firmware naming: MT6639 uses firmware version prefix "2_1" instead of "1_1" used by MT7925 and other variants. The firmware path is mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin. 3. Section filtering: The MT6639 firmware binary contains 9 sections, but only sections with (dlmodecrctype & 0xff) == 0x01 are Bluetooth-related. Sending the remaining WiFi/other sections causes an irreversible BT subsystem hang requiring a full power cycle. This matches the Windows driver behavior observed via USB captures. Also add 0x6639 to the reset register (CONNV3) and firmware setup switch cases alongside the existing 0x7925 handling. Link: https://bugzilla.kernel.org/show_bug.cgi?id=221096 Link: https://github.com/openwrt/mt76/issues/927 Reported-by: Ryan Gilbert <xelnaga@gmail.com> Signed-off-by: Javier Tia <floss@jetm.me> --- drivers/bluetooth/btmtk.c | 23 +++++++++++++++++++++-- drivers/bluetooth/btmtk.h | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 2507d587f28a..13c6e45deede 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -112,7 +112,11 @@ static void btmtk_coredump_notify(struct hci_dev *hdev, int state) void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver, u32 fw_flavor) { - if (dev_id == 0x7925) + if (dev_id == 0x6639) + snprintf(buf, size, + "mediatek/mt%04x/BT_RAM_CODE_MT%04x_2_%x_hdr.bin", + dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); + else if (dev_id == 0x7925) snprintf(buf, size, "mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin", dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); @@ -130,6 +134,7 @@ EXPORT_SYMBOL_GPL(btmtk_fw_get_filename); int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, wmt_cmd_sync_func_t wmt_cmd_sync) { + struct btmtk_data *data = hci_get_priv(hdev); struct btmtk_hci_wmt_params wmt_params; struct btmtk_patch_header *hdr; struct btmtk_global_desc *globaldesc = NULL; @@ -166,6 +171,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, section_offset = le32_to_cpu(sectionmap->secoffset); dl_size = le32_to_cpu(sectionmap->bin_info_spec.dlsize); + /* MT6639: only download sections where dlmode byte0 == 0x01, + * matching the Windows driver behavior which skips WiFi/other + * sections that would cause the chip to hang. + */ + if (data->dev_id == 0x6639 && dl_size > 0 && + (le32_to_cpu(sectionmap->bin_info_spec.dlmodecrctype) & 0xff) != 0x01) + continue; + if (dl_size > 0) { retry = 20; while (retry > 0) { @@ -852,7 +865,7 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) if (err < 0) return err; msleep(100); - } else if (dev_id == 0x7925) { + } else if (dev_id == 0x7925 || dev_id == 0x6639) { err = btmtk_usb_uhw_reg_read(hdev, MTK_BT_RESET_REG_CONNV3, &val); if (err < 0) return err; @@ -1322,6 +1335,11 @@ int btmtk_usb_setup(struct hci_dev *hdev) fw_flavor = (fw_flavor & 0x00000080) >> 7; } + if (!dev_id) { + bt_dev_info(hdev, "MT6639: raw CHIPID=0x0000, forcing chip=0x6639"); + dev_id = 0x6639; + } + btmtk_data->dev_id = dev_id; err = btmtk_register_coredump(hdev, btmtk_data->drv_name, fw_version); @@ -1339,6 +1357,7 @@ int btmtk_usb_setup(struct hci_dev *hdev) case 0x7925: case 0x7961: case 0x7902: + case 0x6639: btmtk_fw_get_filename(fw_bin_name, sizeof(fw_bin_name), dev_id, fw_version, fw_flavor); diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h index adaf385626ee..6645bcadb523 100644 --- a/drivers/bluetooth/btmtk.h +++ b/drivers/bluetooth/btmtk.h @@ -8,6 +8,7 @@ #define FIRMWARE_MT7902 "mediatek/BT_RAM_CODE_MT7902_1_1_hdr.bin" #define FIRMWARE_MT7961 "mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin" #define FIRMWARE_MT7925 "mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin" +#define FIRMWARE_MT7927 "mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin" #define HCI_EV_WMT 0xe4 #define HCI_WMT_MAX_EVENT_SIZE 64 -- 2.53.0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* RE: Bluetooth: Add MediaTek MT7927 (MT6639) support 2026-03-25 23:30 [PATCH v2 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia @ 2026-03-26 0:19 ` bluez.test.bot 0 siblings, 0 replies; 19+ messages in thread From: bluez.test.bot @ 2026-03-26 0:19 UTC (permalink / raw) To: linux-bluetooth, floss [-- Attachment #1: Type: text/plain, Size: 2833 bytes --] 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/project/bluetooth/list/?series=1072604 ---Test result--- Test Summary: CheckPatch PENDING 0.37 seconds GitLint PENDING 0.24 seconds SubjectPrefix PASS 0.94 seconds BuildKernel PASS 26.23 seconds CheckAllWarning PASS 28.82 seconds CheckSparse PASS 28.82 seconds BuildKernel32 PASS 25.62 seconds TestRunnerSetup PASS 566.89 seconds TestRunner_l2cap-tester PASS 27.97 seconds TestRunner_iso-tester FAIL 31.99 seconds TestRunner_bnep-tester PASS 6.26 seconds TestRunner_mgmt-tester FAIL 117.55 seconds TestRunner_rfcomm-tester PASS 9.47 seconds TestRunner_sco-tester FAIL 14.20 seconds TestRunner_ioctl-tester PASS 10.32 seconds TestRunner_mesh-tester FAIL 11.41 seconds TestRunner_smp-tester PASS 8.53 seconds TestRunner_userchan-tester PASS 6.65 seconds IncrementalBuild PENDING 0.52 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: TestRunner_iso-tester - FAIL Desc: Run iso-tester with test-runner Output: BUG: KASAN: slab-use-after-free in le_read_features_complete+0x7e/0x2b0 Total: 141, Passed: 141 (100.0%), Failed: 0, Not Run: 0 ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4 Failed Test Cases Read Exp Feature - Success Failed 0.108 seconds ############################## Test: TestRunner_sco-tester - FAIL Desc: Run sco-tester with test-runner Output: WARNING: possible circular locking dependency detected BUG: sleeping function called from invalid context at net/core/sock.c:3782 Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0 ############################## Test: TestRunner_mesh-tester - FAIL Desc: Run mesh-tester with test-runner Output: Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0 Failed Test Cases Mesh - Send cancel - 1 Timed out 1.858 seconds Mesh - Send cancel - 2 Timed out 1.995 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-03-27 17:58 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-05 16:04 [PATCH 0/2] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2026-03-05 16:05 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia 2026-03-05 17:07 ` Luiz Augusto von Dentz 2026-03-05 18:34 ` Bluetooth: Add MediaTek MT7927 (MT6639) support bluez.test.bot 2026-03-07 16:03 ` [PATCH 1/2] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Sean Wang 2026-03-05 16:05 ` [PATCH 2/2] Bluetooth: btusb: Add USB device IDs for MediaTek MT7927 (MT6639) Javier Tia 2026-03-05 17:00 ` Luiz Augusto von Dentz 2026-03-26 22:13 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Javier Tia 2026-03-26 22:13 ` [PATCH v3 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia 2026-03-26 22:44 ` [v3,1/8] " bluez.test.bot 2026-03-26 22:13 ` [PATCH v3 2/8] Bluetooth: btmtk: fix ISO interface setup for single alt setting Javier Tia 2026-03-26 22:13 ` [PATCH v3 3/8] Bluetooth: btusb: Add MT7927 ID for ASUS ROG Crosshair X870E Hero Javier Tia 2026-03-26 22:13 ` [PATCH v3 4/8] Bluetooth: btusb: Add MT7927 ID for Lenovo Legion Pro 7 16ARX9 Javier Tia 2026-03-26 22:13 ` [PATCH v3 5/8] Bluetooth: btusb: Add MT7927 ID for Gigabyte Z790 AORUS MASTER X Javier Tia 2026-03-26 22:13 ` [PATCH v3 6/8] Bluetooth: btusb: Add MT7927 ID for MSI X870E Ace Max Javier Tia 2026-03-26 22:13 ` [PATCH v3 7/8] Bluetooth: btusb: Add MT7927 ID for TP-Link Archer TBE550E Javier Tia 2026-03-26 22:13 ` [PATCH v3 8/8] Bluetooth: btusb: Add MT7927 ID for ASUS X870E / ProArt X870E-Creator Javier Tia 2026-03-27 17:58 ` [PATCH v3 0/8] Bluetooth: Add MediaTek MT7927 (MT6639) support Luiz Augusto von Dentz -- strict thread matches above, loose matches on Subject: below -- 2026-03-25 23:30 [PATCH v2 1/8] Bluetooth: btmtk: Add MT6639 (MT7927) Bluetooth support Javier Tia 2026-03-26 0:19 ` Bluetooth: Add MediaTek MT7927 (MT6639) support bluez.test.bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox