morrownr / USB-WiFi

USB WiFi Adapter Information for Linux
2.79k stars 178 forks source link

Adapters with mt7921au chipset don't work with laptop's USB3 ports, work with its USB2 ports #505

Open bdantas opened 2 months ago

bdantas commented 2 months ago

I have an X230 ThinkPad. The laptop has USB2 and USB3 ports. Adapters with the mt7921au chipset (I've tested Netgear A8000 as well as EDUP EP-AX1672) only work when plugged into the laptop's USB2 ports.

Here is what dmesg says when device is plugged into USB3 port:

[  640.741219] mt7921u 4-2:1.0: Direct firmware load for mediatek/WIFI_RAM_CODE_MT7961_1.bin failed with error -2
[  640.741231] mt7921u 4-2:1.0: Falling back to sysfs fallback for: mediatek/WIFI_RAM_CODE_MT7961_1.bin
[  640.912574] mt7921u 4-2:1.0: Direct firmware load for mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin failed with error -2
[  640.912580] mt7921u 4-2:1.0: Falling back to sysfs fallback for: mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin
[  640.915593] mt7921u 4-2:1.0: HW/SW Version: 0x8a108a10, Build Time: 20231109190918a
[  641.923846] mt7921u 4-2:1.0: Failed to send patch
[  645.017124] mt7921u 4-2:1.0: Message 00000010 (seq 4) timeout
[  645.017140] mt7921u 4-2:1.0: Failed to release patch semaphore
[  648.217107] mt7921u 4-2:1.0: Message 00000010 (seq 5) timeout
[  648.217122] mt7921u 4-2:1.0: Failed to get patch semaphore
[  651.417126] mt7921u 4-2:1.0: Message 00000010 (seq 6) timeout
[  651.417136] mt7921u 4-2:1.0: Failed to get patch semaphore
[  654.617130] mt7921u 4-2:1.0: Message 00000010 (seq 7) timeout
[  654.617146] mt7921u 4-2:1.0: Failed to get patch semaphore
[  657.817055] mt7921u 4-2:1.0: Message 00000010 (seq 8) timeout
[  657.817070] mt7921u 4-2:1.0: Failed to get patch semaphore
[  661.017196] mt7921u 4-2:1.0: Message 00000010 (seq 9) timeout
[  661.017212] mt7921u 4-2:1.0: Failed to get patch semaphore
[  664.217109] mt7921u 4-2:1.0: Message 00000010 (seq 10) timeout
[  664.217125] mt7921u 4-2:1.0: Failed to get patch semaphore
[  667.417585] mt7921u 4-2:1.0: Message 00000010 (seq 11) timeout
[  667.417603] mt7921u 4-2:1.0: Failed to get patch semaphore
[  670.617116] mt7921u 4-2:1.0: Message 00000010 (seq 12) timeout
[  670.617135] mt7921u 4-2:1.0: Failed to get patch semaphore
[  673.817054] mt7921u 4-2:1.0: Message 00000010 (seq 13) timeout
[  673.817069] mt7921u 4-2:1.0: Failed to get patch semaphore
[  673.945675] mt7921u 4-2:1.0: hardware init failed

Here is what happens when I plug the same device into one of the laptop's USB2 ports:

[  721.524324] mt7921u 2-1.2:1.0: Direct firmware load for mediatek/WIFI_RAM_CODE_MT7961_1.bin failed with error -2
[  721.524343] mt7921u 2-1.2:1.0: Falling back to sysfs fallback for: mediatek/WIFI_RAM_CODE_MT7961_1.bin
[  721.737742] mt7921u 2-1.2:1.0: Direct firmware load for mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin failed with error -2
[  721.737751] mt7921u 2-1.2:1.0: Falling back to sysfs fallback for: mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin
[  721.740946] mt7921u 2-1.2:1.0: HW/SW Version: 0x8a108a10, Build Time: 20231109190918a
[  722.007678] mt7921u 2-1.2:1.0: Direct firmware load for mediatek/WIFI_RAM_CODE_MT7961_1.bin failed with error -2
[  722.007691] mt7921u 2-1.2:1.0: Falling back to sysfs fallback for: mediatek/WIFI_RAM_CODE_MT7961_1.bin
[  722.013302] mt7921u 2-1.2:1.0: WM Firmware Version: ____010000, Build Time: 20231109190959

I'm quite perplexed. I expected this device would work better when plugged into the USB3 port, not the other way around. Can any of you usb wifi gurus shed some light on this strangeness? Basic technical details are below. I'll be happy to provide whatever other details you need.

Thanks!


OS version: Tiny Core Linux 15 x86_64 Linux version: 6.6.8 USB adapter used for the above tests: Netgear A8000 Output of lsusb and lsusb -v is here Output of dmesg | grep xhci and dmesg | grep ehci is here

bdantas commented 2 months ago

P.S. Wifi adapters with other chipsets (e.g., mt7612u) work fine in these usb3 ports. Usb3 storage devices also work, with the expected speed. The problem with these ports seems specific to wifi adapters with mt7921au.

I think the solution, if I can find one, will have something to do with a usb3-related boot code that enables or disables a specific usb3 feature.

bdantas commented 2 months ago

A user reported identical errors ("Failed to get patch semaphore") in this post, using a different Mediatek chipset. That user did not find a solution as far as I can tell.

bdantas commented 2 months ago

I found other (rare) users with similar errors, all using various Mediatek chipsets.

My conclusion is that the mt76 driver fails to deliver the firmware payload to the adapter when it is connected to one of this laptop's usb3 ports. It seems there's a bug in how mt76 and usb/xhci interact in old hardware like this X230.

It seems my options to upgrade my laptop, look for an existing kernel patch that addresses this issue, or give up on using this adapter on my laptop. I'm going to take the easy way out and give up on the adapter. Sorry for the noise.

morrownr commented 2 months ago

@bdantas

Hold on. I'm going to reopen this issue unless you have a good reason to close it. You are not the only to one to see this. I need to do some testing to see what the problem is.

bdantas commented 2 months ago

I closed this prematurely out of frustration. I'll keep an adapter with this chipset around. If I can help with testing, just let me know. I can reliably reproduce the issue on my X230 ThinkPad.

gdluca commented 2 months ago

@bdantas

Already on the latest BIOS on your X230 ThinkPad? Just a thought.

morrownr commented 2 months ago

@bdantas

I can reliably reproduce the issue on my X230 ThinkPad.

I am going to test on a couple of systems but I am curious if I can get some specs on the systems where you are seeing this issue:

Laptop/Desktop/Mini/sbc? CPU, amd, intel, arm64? Age or processor generation? Distro?

bdantas commented 2 months ago

@gdluca - BIOS is coreboot. Here at details per dmidecode:

BIOS Information
    Vendor: coreboot
    Version: CBET4000 4.19-293-gdb4b71ff10-dirty
    Release Date: 02/06/2023
    ROM Size: 12 MB
    Characteristics:
        PCI is supported
        PC Card (PCMCIA) is supported
        BIOS is upgradeable
        Selectable boot is supported
        ACPI is supported
        Targeted content distribution is supported
    BIOS Revision: 4.19
    Firmware Revision: 0.0
morrownr commented 2 months ago

@bdantas

Good day. It a wonderful day. Yes, we have a lot of problems on this blue dot but we can work them.

Now to this mt7921au vs USB3 problem:

Thanks for the details. I am testing right now:

Test results so far: Plugged adapter in. Connected. Ran iperf3. and saw approx. 700 Mbps. No need to check if USB3 is active because USB2 cannot even come close to that speed. No problem noted.

Have you taken a look to see if users of coreboot are reporting issues with USB3? If coreboot has a forum, you might mention it. There are updated firmware files... as of last month so you might look at updating the firmware

I found other (rare) users with similar errors, all using various Mediatek chipsets.

I understand this but in the vast world of the internet, if you start looking for something, you can find it or things similar to it. I say this because it might be easy to blame Mediatek but I'd prefer to wait until we have some solid proof that there is a problem with something Mediatek is responsible for. Remember that in the world of USB WiFi, we depend on the wifi stack and the usb stack to work well. The opportunity for failure are greatly increased due to this fact. Also, USB3 is not mankind's greatest invention. USB2 is far more stable so you could run with USB2 for now if it gets the job done. Don't get frustrated. Let's take our time to work this. I will keep my eyes open and will do additional testing as I have time.

bdantas commented 2 months ago

@morrownr - Thank you very much for looking into this. I decided to keep the adapter around just for testing, as I'm very happy with the overall state of my network at this point.

Just two quick updates:

compicat commented 1 month ago

@morrownr @bdantas thanks for pointing out this issue. I also have system with you, corebooted x230. Adapter only works when i plug it in usb 2.0 input. Have you been able to find anything in order to solve this issue? I have fenvi ax1800 btw.

bdantas commented 1 month ago

@compicat - No, I did not find a solution for this problem and currently have no promising leads.

morrownr commented 1 month ago

@compicat

I have not run across a solution either. I cannot duplicate the issue here so am just watching. My opinion. based on observation, is that this is rare and is likely caused by something related to usb3 support and not wireless but I will keep watching.

MillenniumAlpha commented 1 month ago

I am also experiencing this, I would have never of known it would be the USB3 ports of all things. Unfortunately my mini pc only has USB3 ports.

morrownr commented 1 month ago

@MillenniumAlpha

There is another issue that I posted a while back offering some ideas on usb port related things. Give it a read:

https://github.com/morrownr/USB-WiFi/issues/508

That link to the issue in the Debian forum is interesting. Note how BIOS settings can be an issue.