ShadowBlip / rz608-fix

Fix RZ608/MT7921K wifi modules in linux kernels 5.13 - 5.16.2
GNU General Public License v3.0
22 stars 4 forks source link

Lenovo Thinkbook with Manjaro - device not found for Wifi Settings #2

Closed matthiasbaldi closed 1 year ago

matthiasbaldi commented 1 year ago

Hi

First of all, thank you for writing this fix. I have a new Lenovo Thinkbook with a Mediathek mt7921e Wifi 6 chip in it (MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter). But it seems that the device get not detected. After a journey of searching around I found your repository here.

The device it self got detected but I think the driver was not found correctly. I installed your fix as you described it in the Readme. But after a restart there is no change. I tried it several times and with two kernel versions.

The default kernel (current) is: 5.15.81-1-MANJARO

image

The Manjaro settings application is listing the device like posted below: image

Did I something wrong? Or may there is a problem with these particular devices? Or is there maybe an issue with the current version of this fix?

What do you think? Thank you.

pastaq commented 1 year ago

I think there are two issues here. First, the AUR package is intended for newer kernels so it doesn't install everything you would need for 5.15, you'll need to clone the repo and run the installer.

The second issue is that this appears to be a new revision of the hardware (MT1922/RZ616) and may require adding an alias to the driver manually. If you can help me gather some data and test it I'll update the repo to install an alias for that automatically.

So the first thing that we'll need is a verbose lscpi run with sudo sudo lspci -v

Then we can use that to identify the PCI address and query it with udvadm.

udevadm info -p /sys/devices/pci0000\:00/<pcibus>

In these examples I've reduced the number of entries for brevity. On my system with the RZ608:

$ sudo lscpi -v

00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge (prog-if 00 [Normal decode])
    Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1453
    Flags: bus master, fast devsel, latency 0, IRQ 27, IOMMU group 2
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    I/O behind bridge: [disabled] [32-bit]
    Memory behind bridge: [disabled] [32-bit]
    Prefetchable memory behind bridge: e0300000-e04fffff [size=2M] [32-bit]
    Capabilities: <access denied>
    Kernel driver in use: pcieport

00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge (prog-if 00 [Normal decode])
    Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1453
    Flags: bus master, fast devsel, latency 0, IRQ 28, IOMMU group 3
    Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
    I/O behind bridge: [disabled] [32-bit]
    Memory behind bridge: fea00000-feafffff [size=1M] [32-bit]
    Prefetchable memory behind bridge: [disabled] [64-bit]
    Capabilities: <access denied>
    Kernel driver in use: pcieport

01:00.0 Network controller: MEDIATEK Corp. MT7921K (RZ608) Wi-Fi 6E 80MHz
    Subsystem: MEDIATEK Corp. MT7921K (RZ608) Wi-Fi 6E 80MHz
    Flags: bus master, fast devsel, latency 0, IRQ 74, IOMMU group 7
    Memory at e0300000 (64-bit, prefetchable) [size=1M]
    Memory at e0400000 (64-bit, prefetchable) [size=16K]
    Memory at e0404000 (64-bit, prefetchable) [size=4K]
    Capabilities: [80] Express Endpoint, MSI 00
    Capabilities: [e0] MSI: Enable+ Count=1/32 Maskable+ 64bit+
    Capabilities: [f8] Power Management version 3
    Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 <?>
    Capabilities: [108] Latency Tolerance Reporting
    Capabilities: [110] L1 PM Substates
    Capabilities: [200] Advanced Error Reporting
    Kernel driver in use: mt7921e
    Kernel modules: mt7921e, wl

From there we can see the first two entries are PCIe bridges, and the third is the network device. The first word for each shows a truncated PCI address.

Using this information, and some tab completion to fill in the gaps, we can locate the wifi chip. You'll see everything is prepended with 0000:

 $ udevadm info -p /devices/pci0000:00/0000:00:02.2/0000:01:00.0/
 P: /devices/pci0000:00/0000:00:02.2/0000:01:00.0
M: 0000:01:00.0
R: 0
U: pci
V: mt7921e
E: DEVPATH=/devices/pci0000:00/0000:00:02.2/0000:01:00.0
E: SUBSYSTEM=pci
E: DRIVER=mt7921e
E: PCI_CLASS=28000
E: PCI_ID=14C3:0608
E: PCI_SUBSYS_ID=14C3:0608
E: PCI_SLOT_NAME=0000:01:00.0
E: MODALIAS=pci:v000014C3d00000608sv000014C3sd00000608bc02sc80i00
E: USEC_INITIALIZED=11710178057
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Network controller
E: ID_VENDOR_FROM_DATABASE=MEDIATEK Corp.
E: ID_MODEL_FROM_DATABASE=MT7921K (RZ608) Wi-Fi 6E 80MHz

So first step is getting me that info. This is no guarantee that this will work as it is a different chip. I'll so some research and see if I can't find a pending patch for this chip.

pastaq commented 1 year ago

Looks like it landed in 5.16. It may just work if you update your kernel. 5.19 and 6.0 are available in the manjaro settings manager program.

https://github.com/torvalds/linux/commit/688088728bd3226ef24a2986e2fac2ae01cfbdd9

matthiasbaldi commented 1 year ago

Hi

Thanks for your answer. I ready tried the 19.x kernel, even before I hit your repository and downgrades it again. But I didnt get it running on either kernel version. I can try it again and also test the 6.0.9 kernel, also I will provide you the asked information.

Could it be, that this particular chip is a special thing from Lenovo?

pastaq commented 1 year ago

Well, if we're going to have any chance of this working we'll need to have a kernel after that patch as a starting point. From there we need to figure out why it's not loading.

matthiasbaldi commented 1 year ago

So, I was not able to switch the kernel again - the system ended up pretty bricked 🤐 Because I have to do some work with it I tried shortly an Ubuntu 22.10 which is using the 5.19er kernel and there the WLAN is working form the beginning (installation process). So I think you are right. The drivers are already included and they should work on a newer kernel.

matthiasbaldi commented 1 year ago

@pastaq Hi again

Good feedback from the Manjaro front. I got today the info that Manjaro 22 is finally out... I missed that somehow. So I tried it today in the evening and now everything works as expected. They use the 6.1 kernel now.

Thanks for the supp 👍

pastaq commented 1 year ago

NP. Glad you got it working.