Skip to content

[PW_SID:1054128] Bluetooth: btusb: Add support for MediaTek MT7902#3309

Open
BluezTestBot wants to merge 12 commits intoworkflowfrom
1054128
Open

[PW_SID:1054128] Bluetooth: btusb: Add support for MediaTek MT7902#3309
BluezTestBot wants to merge 12 commits intoworkflowfrom
1054128

Conversation

@BluezTestBot
Copy link
Owner

This patch adds USB IDs for the AzureWave/MediaTek MT7902 Bluetooth
module.
The device IDs included are:

  • 13d3:3579
  • 13d3:3580
  • 13d3:3594
  • 13d3:3596

Signed-off-by: OnlineLearningTutorials kush.kulshrestha.5@gmail.com

drivers/bluetooth/btmtk.c | 1 +
drivers/bluetooth/btusb.c | 10 ++++++++++
2 files changed, 11 insertions(+)

Maiquel Paiva and others added 12 commits February 9, 2026 14:36
Add a check for the user-provided length in mgmt_mesh_add() against
the size of the param buffer. This prevents a heap buffer overflow
if the user provides a length larger than the destination buffer.

Fixes: b338d91 ("Bluetooth: Implement support for Mesh")
Cc: stable@vger.kernel.org
Signed-off-by: Maiquel Paiva <maiquelpaiva@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
…short

Test L2CAP/ECFC/BV-26-C expect the response to L2CAP_ECRED_CONN_REQ with
and MTU value < L2CAP_ECRED_MIN_MTU (64) to be L2CAP_CR_LE_INVALID_PARAMS
rather than L2CAP_CR_LE_UNACCEPT_PARAMS.

Also fix not including the correct number of CIDs in the response since
the spec requires all CIDs being rejected to be included in the
response.

Link: bluez/bluez#1868
Fixes: 15f02b9 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
There is no point in having the label since all it does is return the
value in the 'err' variable. Instead make every goto return directly
and remove the label.

Signed-off-by: Dongyang Jin <jindongyang@kylinos.cn>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When TX timestamping is enabled via SO_TIMESTAMPING, SKBs may be queued
into sk_error_queue and will stay there until consumed. If userspace never
gets to read the timestamps, or if the controller is removed unexpectedly,
these SKBs will leak.

Fix by adding skb_queue_purge() calls for sk_error_queue in affected
bluetooth destructors. RFCOMM does not currently use sk_error_queue.

Fixes: 134f4b3 ("Bluetooth: add support for skb TX SND/COMPLETION timestamping")
Reported-by: syzbot+7ff4013eabad1407b70a@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=7ff4013eabad1407b70a
Cc: stable@vger.kernel.org
Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If retries are exhausted, driver should not do futher operation.
During mt79xx firmware download process, if the retry count reaches0,
driver will return an -EIO error and release the firmware resources.

Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
To prevent abnormal controller states, it is necessary to check
status in another part of the mt79xx firmware setup. During this
process, receiving the 'BTMTK_WMT_PATCH_PROGRESS' status is unexpected.
If this occurs, it should be treated as an error, and driver must be
prevented from continuing execution.

Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add a new flag 'BTMTK_FIRMWARE_DL_RETRY'.
If an error occurs during mt79xx firmware download process, this flag
will be set and cleared after a reset. If the flag is already set and
firmware still cannot be loaded successfully after a reset, no further
reset attempts will be made. In other words, if there is a problem during
firmware download, only one reset will be attempted.

Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The setup process previously combined error handling and retry gating
under one condition. As a result, the final failed attempt exited
without performing cleanup.

Update the failure path to always perform power and port cleanup on
setup failure, and reopen the port only when retrying.

Fixes: 9e80587 ("Bluetooth: hci_qca: Enhance retry logic in qca_setup")
Signed-off-by: Jinwang Li <jinwang.li@oss.qualcomm.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Whenever new chipset support is added to the driver code,
we ended up adding chipset name to the last of the switch case
arising code readability issue because of improper sorting of
the chipset names in various places of the code.

Refactor code such a way that new chipset can be added easily
in the code without compromising code readability.

Signed-off-by: Vivek Sahu <vivek.sahu@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Similar to 03dba9c ("Bluetooth: L2CAP: Fix not responding with
L2CAP_CR_LE_ENCRYPTION") the result code L2CAP_CR_LE_ENCRYPTION shall
be used when BT_SECURITY_MEDIUM is set since that means security mode 2
which mean it doesn't require authentication which results in
qualification test L2CAP/ECFC/BV-32-C failing.

Link: bluez/bluez#1871
Fixes: 15f02b9 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This patch adds workflow files for ci:

[sync.yml]
 - The workflow file for scheduled work
 - Sync the repo with upstream repo and rebase the workflow branch
 - Review the patches in the patchwork and creates the PR if needed

[ci.yml]
 - The workflow file for CI tasks
 - Run CI tests when PR is created

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
This patch adds USB IDs for the AzureWave/MediaTek MT7902 Bluetooth
module.
The device IDs included are:
- 13d3:3579
- 13d3:3580
- 13d3:3594
- 13d3:3596

Signed-off-by: OnlineLearningTutorials <kush.kulshrestha.5@gmail.com>
@github-actions
Copy link

CheckPatch
Desc: Run checkpatch.pl script
Duration: 0.28 seconds
Result: PENDING

@github-actions
Copy link

GitLint
Desc: Run gitlint
Duration: 0.23 seconds
Result: PENDING

@github-actions
Copy link

SubjectPrefix
Desc: Check subject contains "Bluetooth" prefix
Duration: 0.11 seconds
Result: PASS

@github-actions
Copy link

BuildKernel
Desc: Build Kernel for Bluetooth
Duration: 27.27 seconds
Result: PASS

@github-actions
Copy link

CheckAllWarning
Desc: Run linux kernel with all warning enabled
Duration: 31.01 seconds
Result: PASS

@github-actions
Copy link

CheckSparse
Desc: Run sparse tool with linux kernel
Duration: 34.01 seconds
Result: WARNING
Output:

drivers/bluetooth/btmtk.c:1508:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1509:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1510:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1511:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1512:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1512:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1513:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1514:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1515:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1516:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1517:1: error: bad constant expressiondrivers/bluetooth/btmtk.c:1518:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4669:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4670:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4672:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4673:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4675:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4676:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4678:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4679: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:4683:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4684:1: error: bad constant expressiondrivers/bluetooth/btusb.c:4684:1: error: bad constant expression

@github-actions
Copy link

BuildKernel32
Desc: Build 32bit Kernel for Bluetooth
Duration: 26.34 seconds
Result: PASS

@github-actions
Copy link

TestRunnerSetup
Desc: Setup kernel and bluez for test-runner
Duration: 572.87 seconds
Result: PASS

@github-actions
Copy link

TestRunner_l2cap-tester
Desc: Run l2cap-tester with test-runner
Duration: 29.91 seconds
Result: PASS

@github-actions
Copy link

TestRunner_iso-tester
Desc: Run iso-tester with test-runner
Duration: 92.73 seconds
Result: PASS

@github-actions
Copy link

TestRunner_bnep-tester
Desc: Run bnep-tester with test-runner
Duration: 6.38 seconds
Result: PASS

@github-actions
Copy link

TestRunner_mgmt-tester
Desc: Run mgmt-tester with test-runner
Duration: 118.59 seconds
Result: FAIL
Output:

Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4

Failed Test Cases
Read Exp Feature - Success                           Failed       0.110 seconds

@github-actions
Copy link

TestRunner_rfcomm-tester
Desc: Run rfcomm-tester with test-runner
Duration: 9.48 seconds
Result: PASS

@github-actions
Copy link

TestRunner_sco-tester
Desc: Run sco-tester with test-runner
Duration: 14.78 seconds
Result: FAIL
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

@github-actions
Copy link

TestRunner_ioctl-tester
Desc: Run ioctl-tester with test-runner
Duration: 10.30 seconds
Result: PASS

@github-actions
Copy link

TestRunner_mesh-tester
Desc: Run mesh-tester with test-runner
Duration: 11.41 seconds
Result: FAIL
Output:

Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    1.796 seconds
Mesh - Send cancel - 2                               Timed out    1.999 seconds

@github-actions
Copy link

TestRunner_smp-tester
Desc: Run smp-tester with test-runner
Duration: 8.81 seconds
Result: PASS

@github-actions
Copy link

TestRunner_userchan-tester
Desc: Run userchan-tester with test-runner
Duration: 6.81 seconds
Result: PASS

@github-actions
Copy link

IncrementalBuild
Desc: Incremental build with the patches in the series
Duration: 0.43 seconds
Result: PENDING

@github-actions github-actions bot force-pushed the workflow branch 4 times, most recently from d9bf53f to 011703c Compare February 23, 2026 20:50
@github-actions github-actions bot force-pushed the workflow branch 5 times, most recently from f27164a to e9dd054 Compare March 2, 2026 21:39
@github-actions github-actions bot force-pushed the workflow branch 3 times, most recently from ab1b299 to 0bcc21a Compare March 6, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants