Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 890764 - sys-kernel/gentoo-sources-5.15.80 mt7921e driver not working with mt7921k wifi adapter
Summary: sys-kernel/gentoo-sources-5.15.80 mt7921e driver not working with mt7921k wif...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-13 23:41 UTC by Stas
Modified: 2023-01-18 15:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
screenshot from installed Gentoo system (gentoo_mt7921k.jpg,162.20 KB, image/jpeg)
2023-01-13 23:41 UTC, Stas
Details
screenshot from installed Archlinux system (arch_mt7921k.jpg,166.11 KB, image/jpeg)
2023-01-13 23:43 UTC, Stas
Details
Config kernel Gentoo 5.15.80-gentoo (MSI_config_kernel,179.37 KB, text/plain)
2023-01-14 08:29 UTC, Stas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stas 2023-01-13 23:41:37 UTC
Created attachment 848410 [details]
screenshot from installed Gentoo system

Notebook "MSI Modern 14 B5M-231XRO".
The laptop is new!
Installed adapter MT7921K (RZ608) Wi-Fi 6E 80MHz...
When building the kernel, I configured the modules:
mac80211,mt76,mt76-connac-lib,cfg80211,mt7921e
The system booted successfully... BUT...!
The mt7921e module is assembled and there is no Wi-Fi interface!
I rebuilt the kernel several times, added extra modules .... but I don’t get the Wi-Fi adapter interface ...
Additionally, I assembled a driver for ALFA AWUS036ACM (MT7612U) - when connected to a laptop, it is successfully detected and works!
The laptop does not have other communication adapters other than Wifi and Bluetooth, so I used a USB-ethernet adapter to install and configure the laptop...
I took all the screenshots from another computer connected to the laptop via ssh.

I tried to boot from livecd Archlinux - the Wi-Fi adapter was determined, the interface is present! I even installed the Archlinux distribution itself and tested the adapter - everything works well!

I noticed some differences in the use of firmware for the module, but there are some of them - Archlinux additionally loads firmware for the mt7922 driver, while Gentoo does not!
Maybe that's the point?
Comment 1 Stas 2023-01-13 23:43:24 UTC
Created attachment 848412 [details]
screenshot from installed Archlinux system
Comment 2 Stas 2023-01-14 08:29:53 UTC
Created attachment 848442 [details]
Config kernel Gentoo 5.15.80-gentoo
Comment 3 Mike Gilbert gentoo-dev 2023-01-15 21:05:20 UTC
Some things to try:

1. Install sys-kernel/linux-firmware.

2. Install sys-kernel/gentoo-kernel or sys-kernel/gentoo-kernel-bin to get a kernel with most options/modules enabled.

3. Install a newer kernel version.
Comment 4 Mike Pagano gentoo-dev 2023-01-15 22:36:00 UTC
Please make sure you have linux-firmware installed as Mike asked.

Also, please attach the full dmesg after boot
Comment 5 Stas 2023-01-16 10:45:15 UTC
(In reply to Mike Pagano from comment #4)
> Please make sure you have linux-firmware installed as Mike asked.
> 
> Also, please attach the full dmesg after boot

linux-firmware was installed immediately, even at the stage of system installation!
Comment 6 Stas 2023-01-16 10:56:59 UTC
(In reply to Mike Gilbert from comment #3)
> Деякі речі, які варто спробувати:
> 
>  1. Встановіть прошивку sys-kernel/linux.
> 
>  2. Встановіть sys-kernel/gentoo-kernel або sys-kernel/gentoo-kernel-bin,
> щоб отримати ядро ​​з більшістю опцій/модулів.
> 
>  3. Встановіть новішу версію ядра.

linux-firmware was installed immediately, even at the stage of system installation!
Maybe I'm wrong, but the "Minimal Installation CD" contains the "gentoo-kernel-bin" kernel but no Wi-Fi interface either!
I've already thought about installing another kernel (v. 6*), but I'm running out of time... Maybe tomorrow...
Comment 7 Mike Pagano gentoo-dev 2023-01-16 17:17:36 UTC
(In reply to Stas from comment #6)
> (In reply to Mike Gilbert from comment #3)
> > Деякі речі, які варто спробувати:
> > 
> >  1. Встановіть прошивку sys-kernel/linux.
> > 
> >  2. Встановіть sys-kernel/gentoo-kernel або sys-kernel/gentoo-kernel-bin,
> > щоб отримати ядро ​​з більшістю опцій/модулів.
> > 
> >  3. Встановіть новішу версію ядра.
> 
> linux-firmware was installed immediately, even at the stage of system
> installation!
> Maybe I'm wrong, but the "Minimal Installation CD" contains the
> "gentoo-kernel-bin" kernel but no Wi-Fi interface either!
> I've already thought about installing another kernel (v. 6*), but I'm
> running out of time... Maybe tomorrow...

Dmesg please
Comment 8 Mike Pagano gentoo-dev 2023-01-16 21:11:37 UTC
What kernel was Arch running?  Can you try the latest 6.1.X with CONFIG_MT7921_COMMON enabled?
Comment 9 Stas 2023-01-18 14:34:06 UTC
Uninstalled Archlinux yesterday and installed Gentoo (~amd64) - (unstable branch)... 
Wifi adapter works!
Now, at the request of modinfo, I see the download of the firmware and patch for Mt7922 and Mt7961!
I almost did not change the kernel parameters!  It has changed a little with the change of kernel version and additional settings.
I think that there is an error in the assembly of the previous kernel, you need to check!
Comment 10 Mike Pagano gentoo-dev 2023-01-18 14:35:39 UTC
(In reply to Stas from comment #9)
> Uninstalled Archlinux yesterday and installed Gentoo (~amd64) - (unstable
> branch)... 
> Wifi adapter works!
> Now, at the request of modinfo, I see the download of the firmware and patch
> for Mt7922 and Mt7961!
> I almost did not change the kernel parameters!  It has changed a little with
> the change of kernel version and additional settings.
> I think that there is an error in the assembly of the previous kernel, you
> need to check!


Gentoo-sources is assembled by the user.  We just install sources. Not sure what you mean.
Comment 11 Stas 2023-01-18 15:11:51 UTC
What I mean is that there is no "CONFIG_MT7921_COMMON" config in the "5.15.80" kernel at all...
In the new kernel, "6.1.6", the parameter ""CONFIG_MT7921_COMMON" is already present
Therefore, the adapter on the "mt7921k" chipset cannot work in these cores!
It is assembled, the "mt7921e" module is loaded, but it does not work - there is no interface - at the "ip link" request, nothing is displayed except "lo"!
Comment 12 Stas 2023-01-18 15:19:00 UTC
In the new kernel, "6.1.6", the parameter ""CONFIG_MT7921_COMMON"" is already present...
Therefore, the interface works as it should - the interface is there, the adapter works:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:e0:4c:36:0e:6c brd ff:ff:ff:ff:ff:ff
    altname enp3s0f4u2
    inet 192.168.1.129/24 brd 192.168.1.255 scope global dynamic noprefixroute wan0
       valid_lft 345sec preferred_lft 270sec
    inet6 fe80::f846:2b06:13f3:cc14/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:c2:45:0b:34:45 brd ff:ff:ff:ff:ff:ff

Here the "wan0" interface is a usb-ethernet adapter...
wlan0 - This is the same MT7921K (RZ608)
Comment 13 Stas 2023-01-18 15:21:28 UTC
17:11:25 root@MSI linux [480]# modinfo mt7921e
filename:       /lib/modules/6.1.6-gentoo/kernel/drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko
license:        Dual BSD/GPL
author:         Lorenzo Bianconi <lorenzo@kernel.org>
author:         Sean Wang <sean.wang@mediatek.com>
firmware:       mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin
firmware:       mediatek/WIFI_RAM_CODE_MT7922_1.bin
firmware:       mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin
firmware:       mediatek/WIFI_RAM_CODE_MT7961_1.bin
alias:          pci:v000014C3d00000616sv*sd*bc*sc*i*
alias:          pci:v000014C3d00000608sv*sd*bc*sc*i*
alias:          pci:v000014C3d00007922sv*sd*bc*sc*i*
alias:          pci:v000014C3d00007961sv*sd*bc*sc*i*
depends:        mt76-connac-lib,mt76,mt7921-common
retpoline:      Y
intree:         Y
name:           mt7921e
vermagic:       6.1.6-gentoo SMP preempt mod_unload 
parm:           disable_aspm:disable PCI ASPM support (bool)
Comment 14 Stas 2023-01-18 15:27:15 UTC
(In reply to Mike Pagano from comment #10)
> (In reply to Stas from comment #9)
> > Uninstalled Archlinux yesterday and installed Gentoo (~amd64) - (unstable
> > branch)... 
> > Wifi adapter works!
> > Now, at the request of modinfo, I see the download of the firmware and patch
> > for Mt7922 and Mt7961!
> > I almost did not change the kernel parameters!  It has changed a little with
> > the change of kernel version and additional settings.
> > I think that there is an error in the assembly of the previous kernel, you
> > need to check!
> 
> 
> Gentoo-sources is assembled by the user.  We just install sources. Not sure
> what you mean.

So you don't fix the kernel, but maybe you need a patch from Gentoo for kernels that don't have the "CONFIG_MT7921_COMMON" config to be there?