Skip to content

Commit ad1f3e4

Browse files
committed
mediatek-mt7927-dkms: adopt upstream MT7927 series, release v2.13-1
The v2.12 WiFi patch set was a hand-adapted subset of MT7927 support. It carried only part of the PCIe bring-up, so on the TP-Link BE9300 (Foxconn 105b:e104) the probe path issued a CONN_ON_LPCTL register write that reached an unmapped offset and oopsed the kernel (#89). The kernel base (7.1.1) also predated Sean Wang's complete MT7927 series. Rebase the bundled mt76 source onto 7.1.3 and replace the ad-hoc patches with Sean Wang's reviewed MT7927 series from wireless-next, now that the 7.1 base carries its prerequisites and the whole series cherry-picks cleanly. This brings the full PCIe init path that resolves #89, adds MT7927 USB support, and pulls in the upstream mt7925 stability fixes that ride with it. Three ad-hoc TX-power patches drop because the series caches txpower_cur and reports per-vif-link power upstream; verified on 7.1.3 hardware that iw still reports 23 dBm, EHT 320 comes up on all bands at 1200 Mbit/s, Bluetooth is up, and dmesg is clean. Also number the generated DKMS patches sequentially by commit order and strip any "wifi: mt76: <subsys>:" subject prefix, so the Makefile's sorted glob applies them in git order instead of reusing stale numbers. Signed-off-by: Javier Tia <floss@jetm.me>
1 parent 341c875 commit ad1f3e4

45 files changed

Lines changed: 1663 additions & 1098 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.SRCINFO

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pkgbase = mediatek-mt7927-dkms
22
pkgdesc = DKMS Bluetooth (MT6639) and WiFi (MT7925e/MT7902) modules for MediaTek MT7927 Filogic 380
3-
pkgver = 2.12
4-
pkgrel = 2
3+
pkgver = 2.13
4+
pkgrel = 1
55
url = https://github.com/jetm/mediatek-mt7927-dkms
66
install = mediatek-mt7927-dkms.install
77
arch = x86_64
@@ -13,11 +13,11 @@ pkgbase = mediatek-mt7927-dkms
1313
provides = mediatek-mt7925-wifi-dkms
1414
conflicts = btusb-mt7925-dkms
1515
conflicts = btusb-mt7927-dkms
16-
source = https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.1.tar.xz
16+
source = https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.3.tar.xz
1717
source = extract_firmware.py
1818
source = dkms.conf
19-
sha256sums = 5215fa3541dc7e7f5bcd51bf7e57f169cec6fce508ca54e3dc85fdee14371d7d
19+
sha256sums = be41c068e88f5242a19bccdbffbe077b18c47b45f627e2325504b4fab79dd1dc
2020
sha256sums = 1eb7d542ed94a305e727e20671412d2e2a5793607a020742312a69dff9486b7b
21-
sha256sums = 1f5d87c492ce3b1b748e51eff101233a5710e3851a593cc4001c47ca77a7feaf
21+
sha256sums = 6e4400922bc68fd487b63574ad78d71ce91618f9c2e65069ba04765b9b19eafb
2222

2323
pkgname = mediatek-mt7927-dkms

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to the MediaTek MT7927 DKMS package are documented here.
55
Format: `v<pkgver>-<pkgrel>` where pkgver bumps for driver/patch changes
66
and pkgrel bumps for PKGBUILD packaging changes.
77

8+
## [2.13-1] - 2026-07-05
9+
10+
### Driver
11+
12+
- Rebase the bundled mt76 WiFi source onto the kernel 7.1.3 tarball (from 7.1.1)
13+
- Adopt Sean Wang's upstream MT7927 series from wireless-next, replacing the ad-hoc MT7927 patches with the reviewed upstream commits: is_connac3 conversion, MT7927 WFSYS reset, common DMA queue helpers, MT7927-specific PCIe DMA, BSS band sync, MBMC event handling, CNM ops, and full MT7927 PCIe support
14+
- Fix a probe-time kernel oops on the TP-Link BE9300 (Foxconn 105b:e104) card: the previous snapshot carried only a subset of the MT7927 PCIe bring-up, so a CONN_ON_LPCTL register write reached an unmapped offset. The complete upstream PCIe init path resolves it (Reported-by: xgeetx, #89)
15+
- Add MT7927 USB support (new; the driver was PCIe-only before)
16+
- Drop three ad-hoc TX-power patches (reported-3-dBm fix, AP-mode TX power, valid-BSS TX power): the upstream series now caches `txpower_cur` and reports per-vif-link power. Verified `iw` still reports the correct 23 dBm on 7.1.3 hardware
17+
- Pull in the upstream mt7925 stability fixes that ride with the series (link-specific STA removal, inactive-BSS deactivation tolerance, BA state kept in the primary WCID)
18+
19+
### Packaging
20+
21+
- Fix gen-dkms-patches.sh to number patches sequentially by commit order and strip any `wifi: mt76: <subsys>:` subject prefix, so the Makefile's sorted glob applies them in git order
22+
823
## [2.12-2] - 2026-06-25
924

1025
### Driver

PKGBUILD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
# Place the ZIP in this directory before running makepkg.
4747

4848
pkgname=mediatek-mt7927-dkms
49-
pkgver=2.12
50-
pkgrel=2
49+
pkgver=2.13
50+
pkgrel=1
5151
# Keywords: MT7927 MT7925 MT6639 MT7902 Filogic 380 WiFi 7 Bluetooth btusb mt7925e mt7921e
5252
pkgdesc="DKMS Bluetooth (MT6639) and WiFi (MT7925e/MT7902) modules for MediaTek MT7927 Filogic 380"
5353
arch=('x86_64')
@@ -67,16 +67,16 @@ _driver_filename='DRV_WiFi_MTK_MT7925_MT7927_TP_W11_64_V5603998_20250709R.zip'
6767
_driver_sha256='b377fffa28208bb1671a0eb219c84c62fba4cd6f92161b74e4b0909476307cc8'
6868

6969
# Kernel version the mt76 WiFi patches target
70-
_mt76_kver='7.1.1'
70+
_mt76_kver='7.1.3'
7171

7272
source=(
7373
"https://cdn.kernel.org/pub/linux/kernel/v${_mt76_kver%%.*}.x/linux-${_mt76_kver}.tar.xz"
7474
'extract_firmware.py'
7575
'dkms.conf'
7676
)
77-
sha256sums=('5215fa3541dc7e7f5bcd51bf7e57f169cec6fce508ca54e3dc85fdee14371d7d'
77+
sha256sums=('be41c068e88f5242a19bccdbffbe077b18c47b45f627e2325504b4fab79dd1dc'
7878
'1eb7d542ed94a305e727e20671412d2e2a5793607a020742312a69dff9486b7b'
79-
'1f5d87c492ce3b1b748e51eff101233a5710e3851a593cc4001c47ca77a7feaf')
79+
'6e4400922bc68fd487b63574ad78d71ce91618f9c2e65069ba04765b9b19eafb')
8080

8181
# Auto-download via ASUS CDN token API
8282
_download_driver_zip() {

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ cd mediatek-mt7927-dkms
138138
make download
139139
make sources
140140
sudo make install
141-
sudo dkms add mediatek-mt7927/2.12
142-
sudo dkms build mediatek-mt7927/2.12
143-
sudo dkms install mediatek-mt7927/2.12
141+
sudo dkms add mediatek-mt7927/2.13
142+
sudo dkms build mediatek-mt7927/2.13
143+
sudo dkms install mediatek-mt7927/2.13
144144
sudo modprobe -r mt7925e mt7921e btusb
145145
sudo modprobe mt7925e
146146
sudo modprobe btusb
@@ -300,7 +300,7 @@ least 10 seconds, then power back on. A CMOS reset also works but is more disrup
300300
**DKMS not built for current kernel:**
301301

302302
```bash
303-
sudo dkms install mediatek-mt7927/2.12
303+
sudo dkms install mediatek-mt7927/2.13
304304
```
305305

306306
**DKMS modules installed but not visible in `/usr/src/`:**

dkms.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PACKAGE_NAME="mediatek-mt7927"
2-
PACKAGE_VERSION="2.12"
2+
PACKAGE_VERSION="2.13"
33

44
# Auto-detect LLVM/Clang toolchain (e.g. CachyOS) from kernel config
55
_LLVM="$(grep -qs '^CONFIG_CC_IS_CLANG=y' ${kernel_source_dir}/.config && echo LLVM=1)"

gen-dkms-patches.sh

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,6 @@ fi
143143

144144
echo "Found ${#commits[@]} commits on $KERNEL_BRANCH (base: $base_ref)"
145145

146-
# Build subject-to-filename mapping from existing patches
147-
declare -A subject_to_file
148-
for patchfile in "$DKMS_DIR"/mt7927-wifi-*.patch; do
149-
[[ -f "$patchfile" ]] || continue
150-
subject=$(head -1 "$patchfile")
151-
subject_to_file["$subject"]="$(basename "$patchfile")"
152-
done
153-
154146
# Create temp workspace with git-tracked mt76 source
155147
work=$(mktemp -d)
156148
trap 'rm -rf "$work"' EXIT
@@ -211,19 +203,17 @@ for i in "${!commits[@]}"; do
211203
# Capture diff from the temp repo - these line numbers are exact
212204
dkms_diff=$(git diff -U1 HEAD~1..HEAD)
213205

214-
# Find existing patch file or generate new name
215-
if [[ -n "${subject_to_file[$subject]:-}" ]]; then
216-
outfile="${subject_to_file[$subject]}"
217-
else
218-
slug=$(echo "$subject" |
219-
sed 's/wifi: mt76: mt7925: //' |
220-
tr '[:upper:]' '[:lower:]' |
221-
tr ' ' '-' |
222-
sed 's/[^a-z0-9-]//g' |
223-
cut -c1-40 |
224-
sed 's/-$//')
225-
outfile="mt7927-wifi-${nn}-${slug}.patch"
226-
fi
206+
# Sequential name from commit subject. Number by commit position so the
207+
# Makefile's sorted glob applies patches in git order; strip any
208+
# "wifi: mt76: <subsys>: " prefix (mt7925, connac, mt792x, ...).
209+
slug=$(echo "$subject" |
210+
sed -E 's/^wifi: mt76: [a-z0-9]+: //' |
211+
tr '[:upper:]' '[:lower:]' |
212+
tr ' ' '-' |
213+
sed 's/[^a-z0-9-]//g' |
214+
cut -c1-40 |
215+
sed 's/-$//')
216+
outfile="mt7927-wifi-${nn}-${slug}.patch"
227217

228218
# Filter to specific patches if requested
229219
if ((${#patches_to_gen[@]} > 0)); then
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
wifi: mt76: mt7925: clean up DMA on probe failure
2+
3+
mt7925_pci_probe() initializes DMA before registering the device. If
4+
mt7925_register_device() fails, probe returns through err_free_irq without
5+
tearing down DMA state.
6+
7+
That leaves the TX NAPI instance enabled and skips the DMA queue cleanup
8+
that the normal remove path performs through mt7925e_unregister_device().
9+
Add a dedicated unwind label for failures after mt7925_dma_init() succeeds.
10+
11+
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
12+
Co-developed-by: Ijae Kim <ae878000@gmail.com>
13+
Signed-off-by: Ijae Kim <ae878000@gmail.com>
14+
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
15+
Link: https://patch.msgid.link/20260426143728.41534-1-pakmyeonghun@bagmyeonghun-ui-MacBookPro.local
16+
Signed-off-by: Felix Fietkau <nbd@nbd.name>
17+
(cherry picked from commit 9629f31f505d74e76ac0d7a9492fd06c0316fc5d)
18+
19+
79bc2a27ce6db401490057b11f2112ef8f7c2620
20+
diff --git a/mt7925/pci.c b/mt7925/pci.c
21+
index c416175..4883772 100644
22+
--- a/mt7925/pci.c
23+
+++ b/mt7925/pci.c
24+
@@ -417,3 +417,3 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
25+
if (ret)
26+
- goto err_free_irq;
27+
+ goto err_free_dma;
28+
29+
@@ -421,2 +421,4 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
30+
31+
+err_free_dma:
32+
+ mt792x_dma_cleanup(dev);
33+
err_free_irq:

mt7927-wifi-01-fix-stale-pointer-comparisons-in-changev.patch renamed to mt7927-wifi-02-fix-stale-pointer-comparisons-in-changev.patch

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ Tested-by: Ariel Rosenfeld <ariel.rosenfeld.750@gmail.com>
1818
Tested-by: Chapuis Dario <chapuisdario4@gmail.com>
1919
Tested-by: Thibaut François <tibo@humeurlibre.fr>
2020
Tested-by: 张旭涵 <Loong.0x00@gmail.com>
21+
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
2122
Signed-off-by: Javier Tia <floss@jetm.me>
23+
Link: https://patch.msgid.link/20260425195011.790265-2-sean.wang@kernel.org
24+
Signed-off-by: Felix Fietkau <nbd@nbd.name>
25+
(cherry picked from commit 9f1accf3069a0cd42c14ca6c7d44d5b17cc48a80)
2226

23-
065b239f75f3b586199aeec93f5f62750341c17c
27+
ba3b3623f19356d903084f6b7fe5f023e6d7c8e6
2428
diff --git a/mt7925/main.c b/mt7925/main.c
25-
index 73d3722..4d8ca04 100644
29+
index 79cc30a..6fa91d3 100644
2630
--- a/mt7925/main.c
2731
+++ b/mt7925/main.c
28-
@@ -2181,5 +2181,5 @@ free:
32+
@@ -2184,5 +2184,5 @@ free:
2933

3034
- if (mconf != &mvif->bss_conf)
3135
+ if (mconfs[link_id] != &mvif->bss_conf)

mt7927-wifi-02-add-320mhz-bandwidth-to-bssrlmtlv.patch renamed to mt7927-wifi-03-add-320mhz-bandwidth-to-bssrlmtlv.patch

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ Tested-by: Samu Toljamo <samu.toljamo@gmail.com>
2424
Tested-by: Ariel Rosenfeld <ariel.rosenfeld.750@gmail.com>
2525
Tested-by: Chapuis Dario <chapuisdario4@gmail.com>
2626
Tested-by: Thibaut François <tibo@humeurlibre.fr>
27+
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
2728
Signed-off-by: Javier Tia <floss@jetm.me>
29+
Link: https://patch.msgid.link/20260425195011.790265-3-sean.wang@kernel.org
30+
Signed-off-by: Felix Fietkau <nbd@nbd.name>
31+
(cherry picked from commit efc9a10d1de1763baecd2031c1c6dfe6aac9ac38)
2832

29-
e86a1917c31ecbb570ecb6c91cec6cf796de36d5
33+
1e01d67b1f00ab0fb33aabef49485cae98679d1f
3034
diff --git a/mt7925/mcu.c b/mt7925/mcu.c
3135
index 37cdf3e..016c534 100644
3236
--- a/mt7925/mcu.c

mt7927-wifi-03-handle-320mhz-bandwidth-in-rxv-and-txs.patch renamed to mt7927-wifi-04-handle-320mhz-bandwidth-in-rxv-and-txs.patch

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ Tested-by: Ariel Rosenfeld <ariel.rosenfeld.750@gmail.com>
1818
Tested-by: Chapuis Dario <chapuisdario4@gmail.com>
1919
Tested-by: Thibaut François <tibo@humeurlibre.fr>
2020
Tested-by: 张旭涵 <Loong.0x00@gmail.com>
21+
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
2122
Signed-off-by: Javier Tia <floss@jetm.me>
23+
Link: https://patch.msgid.link/20260425195011.790265-4-sean.wang@kernel.org
24+
Signed-off-by: Felix Fietkau <nbd@nbd.name>
25+
(cherry picked from commit 2237b7b332990f135c1f1550b45ac77b29bcbf7b)
2226

23-
106be8c27ee7f3193ab3b510205572428ea6b545
27+
8b4b721a4edf4a22117d85ef2bec03b9b2fedc9e
2428
diff --git a/mt7925/mac.c b/mt7925/mac.c
2529
index c47bd81..d681005 100644
2630
--- a/mt7925/mac.c

0 commit comments

Comments
 (0)