morrownr / 7612u

Linux Support for USB WiFi Adapters that are based on the MT7612U Chipset
73 stars 9 forks source link

mt76x2u vendor request failed #17

Open draxdeveloper opened 1 year ago

draxdeveloper commented 1 year ago

After a random time, my MediaTek Inc. MT7612U get really slow. When this happens, if I try to do a lsusb it's just hangs And if I reboot, it's get stuck spamming this message:

mt76x2u 3-4:1.0: vendor request req:07 off:0430 failed:-71

I really don't know what to do, it's works but eventually will have that issue and I always forced to do a hard reset.

morrownr commented 1 year ago

What distro and kernel version are you using?

draxdeveloper commented 1 year ago

Operating System: Kubuntu 22.10 KDE Plasma Version: 5.25.5 KDE Frameworks Version: 5.98.0 Qt Version: 5.15.6 Kernel Version: 5.19.0-29-generic (64-bit) Graphics Platform: X11 Processors: 6 × AMD Ryzen 5 3500X 6-Core Processor Memory: 15.6 GiB of RAM Graphics Processor: AMD Radeon RX 560 Series

morrownr commented 1 year ago

I have a system that runs Kubuntu 22.10. Let do some testing to see what I can figure out.

draxdeveloper commented 1 year ago

Ok, TY :)

draxdeveloper commented 1 year ago

https://patchwork.kernel.org/project/linux-wireless/patch/8d0116580f2c5eafaea29acb2cbbc348ff853f5b.1667920478.git.lorenzo@kernel.org/

Someone suggested this patch in ask ubuntu. But I don't know how to do it (and how to undo it if it's needed)

morrownr commented 1 year ago

But I don't know how to do it (and how to undo it if it's needed)

I can help with that but first, before we make a mess, let me analyze the situation and make a recommendation.

morrownr commented 1 year ago

Here is my recommendation:

2023-02-05

Purpose: To test drivers on or with kernels beyond what is currently included in the release versions of Ubuntu.

Upgrading the Linux Kernel on Ubuntu based amd64 systems

Note: Turn secure mode off before installing. These kernels do not support secure mode.

You will need to make a directory to hold some downloaded files, Since we are downloading a 6.1 kernel I use:

~/src/6.1

... anywhere in your home directory should work.

Go to:

https://kernel.ubuntu.com/~kernel-ppa/mainline/

Note: This guide is an example for kernel 6.1.9 Please make adjustments for other kernels.

Download into a clean directory: (no other .deb files)

linux-headers-6.1.9-060109_6.1.9-060109.202302010835_all.deb
linux-headers-6.1.9-060109-generic_6.1.9-060109.202302010835_amd64.deb
linux-image-unsigned-6.1.9-060109-generic_6.1.9-060109.202302010835_amd64.deb
linux-modules-6.1.9-060109-generic_6.1.9-060109.202302010835_amd64.deb

To install:

sudo dpkg -i *.deb

Once back at the command line interface, reboot.

You can use grup during boot to decide which kernel to boot. The default is the most modern kernel installed.


To remove:

Note: To remove a kernel you installed this way, you will need to boot the computer to a different kernel.

sudo apt remove linux-headers-6.1.9*
sudo apt remove linux-modules-6.1.9*
sudo apt remove linux-image-unsigned-6.1.9*

Note: Once complete, reboot and the default kernel will now be the most modern kernel still on your system. To select another kernel version to boot, use the grub menu.

Happy Compiling!

draxdeveloper commented 1 year ago

Secure mode as in secure boot?

morrownr commented 1 year ago

Yes

draxdeveloper commented 1 year ago

Updated... Didn't had the USB issue yet, but it's really slow. It's not keep in a slow speed but it's instable so it's goes from ~6mb to ~120mb

draxdeveloper commented 1 year ago

Update... Did the upgrade 6.1.9-060109-generic But, had the same issue again. (vendor request failed) Also, since today the speed are most of time below 10mb

draxdeveloper commented 1 year ago

image Don't know if this helps, but this is my USB list, almost all my USB are 3.0 with the exception of two.

this is my USBs image As you can see, I have 6 USB ports (and other two that are not 3.0, don't know if even is 2.0)... But, just two of then are listed as 3.0 and it's not the ones connected to the MOBO (I tested all of them).

morrownr commented 1 year ago

Hmmm... this might turn into fun. Not!

Let me drag out the laptop I bought last year. It is the only system I have that is anywhere close to as modern as your setup. My big bad dev box is 10+ years old but hold on before you laugh... i7 quad core with 12 MB of ram.

Do you have any usb related settings in the bios?

USB3 is not mankind's greatest invention. I've seen plenty of USB3 problems but this is a new one on me.

draxdeveloper commented 1 year ago

Hum... I will have to check

draxdeveloper commented 1 year ago

image image image

draxdeveloper commented 1 year ago

Do you think if I disable the XHCI handoff can solve the issue? I actually have no idea what exactly does but it's seems kind off "disable" the USB 3? Or maybe the legacy support would do the other way around? (I think)

morrownr commented 1 year ago

Good questions. You could try one at a time to see if you see any improvement.

draxdeveloper commented 1 year ago

disabling XHCI handoff seems to do a improvement, but I am not sure yet. So I will update if the issue come back.

If this is the issue, my theory is that the kernel do handle HXCI and in the settings says that it's for OS that don't handle it, this causing a conflict and probably some modern MOBO don't even have this support (or maybe older? Don't know)

draxdeveloper commented 1 year ago

In fact, now it's reaching at least over 80 and even 150 (the speed that should be)

morrownr commented 1 year ago

Keep the setting and see how it performs over time.

draxdeveloper commented 1 year ago

So, it's a bit unstable but it's way better

morrownr commented 1 year ago

That could be Scatter-Gather. There are instructions to turn it off in the README.

draxdeveloper commented 1 year ago

No, it was already disabled: image Tomorrow I will try to disable the legacy, it's seems it's important to boot from usb but I can enable it again if needed

draxdeveloper commented 1 year ago

New update:

Got the vendor request again, it's seems less frequent but it's still a issue. I really have no idea what is causing it. There is any log that I can do to help?

draxdeveloper commented 1 year ago

also, this seems to be an issue to others... Don't know how similar it is thought:

https://github.com/openwrt/mt76/issues/687

Maybe if we can know the hardware of each one it will be easier to pinpoint the error

draxdeveloper commented 1 year ago

Update: I checked my dmesg and found this lines:

fev 11 15:24:14.299850 mimi kernel: usb 1-5: new high-speed USB device number 2 using xhci_hcd
fev 11 15:24:14.471846 mimi kernel: usb 1-5: New USB device found, idVendor=0e8d, idProduct=2870, bcdDevice= 0.01
fev 11 15:24:14.472085 mimi kernel: usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
fev 11 15:24:14.472254 mimi kernel: usb 1-5: Product: Љ
fev 11 15:24:14.472416 mimi kernel: usb 1-5: Manufacturer: Љ
fev 11 15:24:14.472540 mimi kernel: usb 1-5: SerialNumber: Љ
fev 11 15:24:14.654461 mimi kernel: usb 1-5: USB disconnect, device number 2
fev 11 15:24:14.731844 mimi kernel: usbcore: registered new interface driver usb-storage
fev 11 15:24:14.747839 mimi kernel: usbcore: registered new interface driver uas
fev 11 15:24:14.935839 mimi kernel: usb 1-5: new full-speed USB device number 3 using xhci_hcd
fev 11 15:24:15.095840 mimi kernel: usb 1-5: device descriptor read/64, error -71
fev 11 15:24:15.335839 mimi kernel: usb 1-5: device descriptor read/64, error -71
fev 11 15:24:15.575835 mimi kernel: usb 1-5: new full-speed USB device number 4 using xhci_hcd
fev 11 15:24:15.731837 mimi kernel: usb 1-5: device descriptor read/64, error -71
fev 11 15:24:15.971838 mimi kernel: usb 1-5: device descriptor read/64, error -71
fev 11 15:24:16.083840 mimi kernel: usb usb1-port5: attempt power cycle
fev 11 15:24:16.507847 mimi kernel: usb 1-5: new full-speed USB device number 5 using xhci_hcd
fev 11 15:24:16.531836 mimi kernel: usb 1-5: Device not responding to setup address.
fev 11 15:24:16.767840 mimi kernel: usb 1-5: Device not responding to setup address.
fev 11 15:24:16.979842 mimi kernel: usb 1-5: device not accepting address 5, error -71
fev 11 15:24:17.107840 mimi kernel: usb 1-5: new full-speed USB device number 6 using xhci_hcd
fev 11 15:24:17.131838 mimi kernel: usb 1-5: Device not responding to setup address.
fev 11 15:24:17.371836 mimi kernel: usb 1-5: Device not responding to setup address.
fev 11 15:24:17.587843 mimi kernel: usb 1-5: device not accepting address 6, error -71
fev 11 15:24:17.587912 mimi kernel: usb usb1-port5: unable to enumerate USB device
fev 11 15:24:42.975849 mimi kernel: usb 3-3: USB disconnect, device number 3
fev 11 15:24:43.323839 mimi kernel: usb 3-3: new high-speed USB device number 5 using xhci_hcd
fev 11 15:24:43.475842 mimi kernel: usb 3-3: New USB device found, idVendor=04e8, idProduct=6863, bcdDevice= 4.00
fev 11 15:24:43.476085 mimi kernel: usb 3-3: New USB device strings: Mfr=7, Product=8, SerialNumber=9
fev 11 15:24:43.476262 mimi kernel: usb 3-3: Product: SAMSUNG_Android
fev 11 15:24:43.476424 mimi kernel: usb 3-3: Manufacturer: SAMSUNG
fev 11 15:24:43.476582 mimi kernel: usb 3-3: SerialNumber: R9XR30F2D9W
fev 11 15:24:43.643843 mimi kernel: usbcore: registered new interface driver cdc_ether

Searching around about the error 71 people are saying it's energy related Then there is this old instruction: https://urukrama.wordpress.com/2009/01/27/usb-drive-not-recognised-error-71/ But there is no /etc/modprobe.d/options file

draxdeveloper commented 1 year ago

Update:

Tried this:

Turned off the computer Unplugged everything

Did journalctl -o short-precise -k -b -1

No USB issues for now but internet still unstable. Generally when I test after connecting it gives a burst and starting to get slower. After that still do bursts but the peak is lower (around 30mb)

morrownr commented 1 year ago

internet still unstable

Can you elaborate on this? Unstable can mean a lot of things. I need to know exactly what you are looking at that causes you to say this.

I still have not tested on my modern USB 3.1 port laptop that runs Kubuntu so let me do some testing on it.

draxdeveloper commented 1 year ago

Most of time the connection is slow or really slow, eventually it's get a decent speed but far from the expected one

lab37 commented 1 year ago

Not only 7612u, when 7612/7921 and other usb3 mediatek card plug in a usb3 interface, many problems will arise。 It's may not the problem of xhci_hcd.
7601u(usb2.0) using usb3.0 and xhci is ok realtek card using usb3.0 and xhci is ok maybe the problem is with mediatek driver (when speed >1000). Or there is a problem with the hardware of the network card

morrownr commented 1 year ago

Not only 7612u, when 7612/7921 and other usb3 mediatek card plug in a usb3 interface, many problems will arise.

This is not my experience and I do test on a wide variety of hardware. There are specific cases where USB3 chipsets are buggy. My favorite example is the RasPi4B. The rtl8812bu chipset based adapters have problems with this USB3 chipset but if you plug the adapter into a USB2 port, all problems go away but you are stuck with slower speeds. That may or may not be a problem. It depends on the use case.

Below is a speed test that I recently conducted:

https://github.com/morrownr/USB-WiFi/blob/main/home/Speed_Comparison_Test.md

The takeaway from the speed test above is that all of the tested adapters and chipsets can have good performance in the right conditions. Extension cables are notorious for causing problems. Powered hubs can cause problems. Buggy USB3 chipsets or drivers can cause problems. Buy from retailers that accept returns.

maybe the problem is with mediatek driver

Generally speaking, the Mediatek drivers are solid and mostly feature complete. The Realtek drivers are a challenge to maintain and a pain for those that are not technically inclined to install but mostly do a good job of the features they support (for the drivers maintained here).

I've been testing on a system that is close to what the OP has, a system with only gen 3.1 USB3 ports, and I'm not seeing any problems. The problem he is seeing could be fixed with a bios upgrade, a driver upgrade or maybe not.

Often, slow or inconsistent speeds are blamed on hardware when the real problem is congestion. WiFi is designed to be a sharing technology so the performance you see depends on the number of other APs in your area and how busy they are at any specific time. If you have to know how to test the channels to see which channels will provide the best service, that is what to do.

@morrownr

draxdeveloper commented 1 year ago

Updated the bios and still having the vendor request issue. I know the issue is on the USB, but I don't know for sure if it's the hardware side since other wifi work (some of them) but only is the old USB 2.0 of my case, but this USB is not good and when I plug the mt76x2u on the usb 2.0 it's don't work or if it's works can't find the 5.0 connection. Now I will try to format my Kubuntu and see if there is some weird, unknown issue happening.

draxdeveloper commented 1 year ago

image image So, I found a issue. Those are the device names. I have two adapters plugged MediaTek Inc. MT7612U 802.11a/b/g/n/ac Wireless Adapter TP-Link TL-WN722N v2/v3 [Realtek RTL8188EUS] Now, wlx it's a name for realtek, I forgot the name the device (will update later with the right name) but I tested it on my notebook and it's working just fine. But, the device name it's not that one, it's start with wld I think, something like that. In conclusion... It's seems a driver issue. Since my bios it's updated and my kernel it's updated I will try to reinstall my distro

morrownr commented 1 year ago

So, I found a issue. Those are the device names.

I found an issue the other day and I just stumbled across something that fixed it. Well, maybe not the proper fix but...

To disable predictable network interface names on many distros:

Boot with the kernel parameter net.ifnames=0.

sudo nano /etc/default/grub

Add net.ifnames=0 to the GRUB_CMDLINE_LINUX_DEFAULT= line as such:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash net.ifnames=0"

Remember to run the following after saving.

sudo update-grub  
sudo reboot
morrownr commented 1 year ago

Also, when messing with connections. you should always forget connections to clean things up.