public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Chris Lu <chris.lu@mediatek.com>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	Sasha Levin <sashal@kernel.org>,
	marcel@holtmann.org, luiz.dentz@gmail.com,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 7.0-6.12] Bluetooth: btusb: MT7922: Add VID/PID 0489/e174
Date: Mon, 20 Apr 2026 09:20:14 -0400	[thread overview]
Message-ID: <20260420132314.1023554-220-sashal@kernel.org> (raw)
In-Reply-To: <20260420132314.1023554-1-sashal@kernel.org>

From: Chris Lu <chris.lu@mediatek.com>

[ Upstream commit 1f2ac009d3e06380400618e777c858e582872efa ]

Add VID 0489 & PID e174 for MediaTek MT7922 USB Bluetooth chip.

The information in /sys/kernel/debug/usb/devices about the Bluetooth
device is listed as the below.

T:  Bus=06 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0489 ProdID=e174 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
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 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=  64 Ivl=125us
E:  Ad=0a(O) Atr=03(Int.) MxPS=  64 Ivl=125us
I:* If#= 2 Alt= 1 #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

Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Good. The patch would insert the `0xe174` entry right after the `0xe170`
entry (line 704-705), which is exactly the position shown in the diff.
The context lines match perfectly. Now I have all the information needed
for the analysis.

---

## PHASE 1: COMMIT MESSAGE FORENSICS

**Step 1.1: PARSE THE SUBJECT LINE**
Record: [Bluetooth: btusb] [Add] [VID/PID 0489/e174 for MediaTek MT7922
USB Bluetooth chip]

**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
- Signed-off-by: Chris Lu <chris.lu@mediatek.com> — author, MediaTek
  employee
- Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> —
  Bluetooth subsystem maintainer
- No Fixes: tag (expected for device ID additions)
- No Reported-by: tag (not a bug fix, so expected)
- No Cc: stable tag (expected — that's why we're reviewing)

Record: Author is from MediaTek (chip vendor). Merged by the Bluetooth
subsystem maintainer.

**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
The commit body provides the USB device descriptor dump from
`/sys/kernel/debug/usb/devices`, confirming this is a real MediaTek
MT7922 Bluetooth USB device (Vendor=0489, ProdID=e174,
Manufacturer=MediaTek Inc., Product=Wireless_Device). The device runs at
USB 2.0 High Speed (480 Mbps) and has 3 interfaces typical of a
Bluetooth HCI device.

Record: No bug described — this is a device ID addition enabling
hardware support. The device is verified to exist and be manufactured by
MediaTek.

**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: This is not a hidden bug fix. It is a straightforward device ID
addition to enable Bluetooth on hardware with this specific VID/PID.

## PHASE 2: DIFF ANALYSIS - LINE BY LINE

**Step 2.1: INVENTORY THE CHANGES**
- Files changed: `drivers/bluetooth/btusb.c` only
- Lines added: +2 (one `USB_DEVICE` table entry spanning 2 lines)
- Lines removed: 0
- Function modified: None — this adds to the static `quirks_table[]`
  array
- Scope: single-file, single-table-entry addition

Record: [1 file, +2/-0 lines] [quirks_table[] static data only] [Trivial
single-entry addition]

**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
- BEFORE: Device with VID 0489 / PID e174 is not recognized by btusb
  driver, so Bluetooth doesn't work on this hardware
- AFTER: Device is matched by `usb_device_id` table with `BTUSB_MEDIATEK
  | BTUSB_WIDEBAND_SPEECH` flags, enabling the existing MediaTek
  Bluetooth support path

Record: Purely a data table entry; no logic changes.

**Step 2.3: IDENTIFY THE BUG MECHANISM**
Category: (h) Hardware workaround / Device ID addition. Without this
entry, the btusb driver doesn't bind to the device, and the user's
Bluetooth hardware is completely non-functional.

Record: [Device ID addition] [Enables existing MT7922 driver code for a
new PID variant]

**Step 2.4: ASSESS THE FIX QUALITY**
- Obviously correct: Yes — identical pattern to dozens of other entries
  in the same table
- Minimal: Yes — 2 lines, data-only
- Regression risk: Zero — only affects devices with this specific
  VID/PID
- No API changes, no logic changes, no locking changes

Record: [Perfect quality — trivial table entry] [Zero regression risk]

## PHASE 3: GIT HISTORY INVESTIGATION

**Step 3.1: BLAME THE CHANGED LINES**
The neighboring entry `0xe170` was added by Chris Lu (same author) in
commit `5a6700a31c953` on 2025-10-15. The MT7922A device section has
entries going back to 2023. The BTUSB_MEDIATEK driver support has been
present since at least v6.10.

Record: MT7922 support exists in tree since v6.10. This is just another
PID variant for the same chip family.

**Step 3.2: FOLLOW THE FIXES: TAG**
No Fixes: tag — expected for a device ID addition.

**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Recent btusb.c commits are heavily dominated by device ID additions
(e0e2, e0e4, e0f1, e0f2, e0f5, e0f6, e102, e152, e153, e170, plus IDs
from other vendors). This is a pattern of ongoing hardware enablement
for the MT7922 family.

Record: Standalone commit. No prerequisites beyond existing MT7922
support.

**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Chris Lu at MediaTek is a regular contributor to the Bluetooth/btusb
subsystem. He authored the e170 entry, the e135 (MT7920) entry, and a
kernel crash fix for MediaTek ISO interfaces. He clearly works on
Bluetooth at MediaTek.

Record: Author is a domain expert from the chip vendor.

**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
The only prerequisite is MT7922 support via BTUSB_MEDIATEK, which has
been present since v6.10 (commit `8c0401b7308cb`). The entry `0xe170`
(the sibling right before) exists in the current tree. The patch applies
cleanly — the diff context matches the current file exactly.

Record: No dependencies beyond base MT7922 support already in stable
trees (v6.10+).

## PHASE 4: MAILING LIST AND EXTERNAL RESEARCH

**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Found via web search: The patch was submitted as `[PATCH v1]` and then
`[PATCH RESEND v1]` on the linux-mediatek mailing list in January 2026.
The RESEND indicates initial posting may not have received attention.
The mailing list archive at lists.infradead.org confirms the exact same
diff.

Record: [https://lists.infradead.org/pipermail/linux-
mediatek/2026-January/103452.html] [v1 + RESEND v1] [No concerns or NAKs
visible]

**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Merged by Luiz Augusto von Dentz (Bluetooth subsystem maintainer at
Intel), as indicated by his Signed-off-by.

Record: Bluetooth subsystem maintainer merged this.

**Step 4.3-4.5:** Not applicable — no bug report (this is hardware
enablement), no series dependencies.

## PHASE 5: CODE SEMANTIC ANALYSIS

**Step 5.1-5.5:** The change is purely to the `quirks_table[]` static
data array. No functions are modified. The USB_DEVICE macro expands to
match criteria for the USB core's device matching infrastructure. When a
device with VID=0x0489/PID=0xe174 is plugged in, the btusb driver will
bind to it using the BTUSB_MEDIATEK code path. This code path is well-
tested through dozens of other MT7922 variants.

Record: No function changes. Data-only addition to existing, well-tested
USB device matching infrastructure.

## PHASE 6: CROSS-REFERENCING AND STABLE TREE ANALYSIS

**Step 6.1: DOES THE BUGGY CODE EXIST IN STABLE TREES?**
The MT7922 BTUSB_MEDIATEK support exists since v6.10. The
`quirks_table[]` and the entire MT7922 code path exist in all current
active stable trees from v6.10 onward. For older stable trees (v6.6,
v6.1), the base MT7922 support may not be present, so the device ID
alone wouldn't help there.

Record: Applicable to stable trees v6.10+, v6.12+, and future LTS
branches.

**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
The diff context matches the current tree perfectly. The entry goes
right after 0xe170 and before 0x04ca entries. The patch will apply
cleanly.

Record: Clean apply expected.

**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY IN STABLE**
No prior fix for this specific VID/PID exists.

## PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT

**Step 7.1:** Subsystem: Bluetooth (drivers/bluetooth/). Criticality:
IMPORTANT — Bluetooth is essential on laptops and IoT devices.

**Step 7.2:** btusb.c is very actively developed with frequent device ID
additions. The MT7922 is a popular WiFi/Bluetooth combo chip used in
many laptops.

## PHASE 8: IMPACT AND RISK ASSESSMENT

**Step 8.1: WHO IS AFFECTED**
Users with laptops/devices containing a MediaTek MT7922 Bluetooth chip
with the specific VID/PID 0489:e174. Without this patch, Bluetooth is
completely non-functional for these users.

**Step 8.2: TRIGGER CONDITIONS**
Trigger: simply having this hardware. Every boot, every time.

**Step 8.3: FAILURE MODE**
Without the patch: Bluetooth hardware is completely non-functional
(driver doesn't bind). With the patch: full Bluetooth functionality.

**Step 8.4: RISK-BENEFIT RATIO**
- BENEFIT: HIGH — enables Bluetooth for real hardware users
- RISK: VERY LOW — 2-line data-only change, cannot affect any other
  device
- Ratio: Excellent — maximum benefit, minimum risk

## PHASE 9: FINAL SYNTHESIS

**Step 9.1: EVIDENCE COMPILATION**
FOR backporting:
- Classic device ID addition — an explicit exception category that is
  always YES
- Only 2 lines added, data-only (zero code changes)
- Zero regression risk (only matches this specific VID/PID)
- Author is from MediaTek (chip vendor), merged by subsystem maintainer
- Real hardware that users have (USB device dump provided)
- Identical pattern to dozens of existing entries
- MT7922 driver support exists in stable trees (v6.10+)

AGAINST backporting:
- None

**Step 9.2: STABLE RULES CHECKLIST**
1. Obviously correct? YES — trivial table entry
2. Fixes a real bug? YES — enables hardware for real users
3. Important issue? YES — without it, Bluetooth is completely broken on
   this hardware
4. Small and contained? YES — 2 lines
5. No new features/APIs? CORRECT — no new features
6. Can apply to stable? YES — clean apply

**Step 9.3: EXCEPTION CATEGORY**
This is a **Device ID addition to an existing driver** — one of the
explicit exception categories that is automatically YES for stable.

## Verification

- [Phase 1] Parsed tags: Signed-off-by from Chris Lu (MediaTek) and Luiz
  Augusto von Dentz (Bluetooth maintainer)
- [Phase 2] Diff analysis: +2 lines, single USB_DEVICE entry in
  quirks_table[], data-only
- [Phase 3] git blame: neighboring entry 0xe170 added by same author in
  5a6700a31c953 (Oct 2025)
- [Phase 3] MT7922 base support in commit 8c0401b7308cb, present since
  v6.10
- [Phase 3] git merge-base: confirmed MT7922 support in v6.10 and v6.12,
  NOT in v6.6 or v6.1
- [Phase 4] Web search: found mailing list post at lists.infradead.org
  confirming RESEND v1 submission Jan 2026
- [Phase 4] Mailing list archive: identical diff confirmed, no NAKs or
  objections
- [Phase 5] No functions modified — purely static data table change
- [Phase 6] Patch applies cleanly — verified context lines match current
  tree exactly (lines 704-706)
- [Phase 6] BTUSB_MEDIATEK appears 70 times in btusb.c — well-tested
  code path
- [Phase 8] Risk: zero (only affects devices with VID=0x0489,
  PID=0xe174)

This is a textbook device ID addition to an existing, well-tested
driver. It enables Bluetooth on real MediaTek MT7922 hardware for users
who have this specific VID/PID variant. The change is 2 lines of data-
only additions with zero regression risk.

**YES**

 drivers/bluetooth/btusb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 5c535f3ab7228..aeba026bdb427 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -703,6 +703,8 @@ static const struct usb_device_id quirks_table[] = {
 						     BTUSB_WIDEBAND_SPEECH },
 	{ USB_DEVICE(0x0489, 0xe170), .driver_info = BTUSB_MEDIATEK |
 						     BTUSB_WIDEBAND_SPEECH },
+	{ USB_DEVICE(0x0489, 0xe174), .driver_info = BTUSB_MEDIATEK |
+						     BTUSB_WIDEBAND_SPEECH },
 	{ USB_DEVICE(0x04ca, 0x3804), .driver_info = BTUSB_MEDIATEK |
 						     BTUSB_WIDEBAND_SPEECH },
 	{ USB_DEVICE(0x04ca, 0x38e4), .driver_info = BTUSB_MEDIATEK |
-- 
2.53.0


  parent reply	other threads:[~2026-04-20 13:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260420132314.1023554-1-sashal@kernel.org>
2026-04-20 13:16 ` [PATCH AUTOSEL 6.18] Bluetooth: hci_sync: annotate data-races around hdev->req_status Sasha Levin
2026-04-20 13:16 ` [PATCH AUTOSEL 7.0-6.12] Bluetooth: btusb: Add new VID/PID 13d3/3579 for MT7902 Sasha Levin
2026-04-20 13:17 ` [PATCH AUTOSEL 7.0-6.12] Bluetooth: btusb: MediaTek MT7922: Add VID 0489 & PID e11d Sasha Levin
2026-04-20 13:17 ` [PATCH AUTOSEL 7.0-6.12] Bluetooth: btusb: Add Lite-On 04ca:3807 for MediaTek MT7921 Sasha Levin
2026-04-20 13:18 ` [PATCH AUTOSEL 7.0-6.12] Bluetooth: btmtk: add MT7902 MCU support Sasha Levin
2026-04-20 13:18 ` [PATCH AUTOSEL 7.0-6.1] Bluetooth: btmtk: improve mt79xx firmware setup retry flow Sasha Levin
2026-04-20 13:20 ` Sasha Levin [this message]
2026-04-20 13:20 ` [PATCH AUTOSEL 7.0-5.10] Bluetooth: L2CAP: CoC: Disconnect if received packet size exceeds MPS Sasha Levin
2026-04-20 13:21 ` [PATCH AUTOSEL 7.0-5.10] Bluetooth: btbcm: Add entry for BCM4343A2 UART Bluetooth Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260420132314.1023554-220-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=chris.lu@mediatek.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox