wifi driver: mt7601u not work on 16.04

Bug #1716301 reported by chenzero
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Medium
Unassigned
usb-modeswitch-data (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In the beginning, when the adapter is pluged in, it's mounted as a disk including driver files for Windows, and
$> lsusb
Bus 003 Device 010: ID 148f:2878 Ralink Technology, Corp.

after eject the disk,
$> lsusb
Bus 003 Device 011: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter

I tried following 3 drivers:
1) the default mt7601u included in the kernel: 4.4.0-91-generic
after eject the disk,
$> lsmod|grep mt
mt7601u 102400 0
mac80211 737280 1 mt7601u
cfg80211 565248 2 mac80211,mt7601u
binfmt_misc 20480 1
$> modinfo mt7601u
filename: /lib/modules/4.4.0-91-generic/kernel/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
srcversion: E8B632D369E0C2A9F1CF7D8
alias: usb:v7392p7710d*dc*dsc*dp*ic*isc*ip*in*
......
depends: mac80211,cfg80211
intree: Y
vermagic: 4.4.0-91-generic SMP mod_unload modversions

$> dmesg
// begin----------------------------------------
[ 4581.094119] usb 3-4: USB disconnect, device number 6
[ 4584.872751] usb 3-4: new high-speed USB device number 7 using xhci_hcd
[ 4585.001408] usb 3-4: New USB device found, idVendor=148f, idProduct=2878
[ 4585.001413] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4585.001416] usb 3-4: Product: Љ
[ 4585.001418] usb 3-4: Manufacturer: Љ
[ 4585.001753] usb-storage 3-4:1.0: USB Mass Storage device detected
[ 4585.001873] scsi host6: usb-storage 3-4:1.0
[ 4586.001122] scsi 6:0:0:0: CD-ROM MediaTek Flash autorun 0.01 PQ: 0 ANSI: 0 CCS
[ 4586.001978] sr 6:0:0:0: [sr0] scsi3-mmc drive: 52x/52x cd/rw xa/form2 cdda tray
[ 4586.002529] sr 6:0:0:0: Attached scsi CD-ROM sr0
[ 4586.002716] sr 6:0:0:0: Attached scsi generic sg1 type 5
[ 4619.658385] ISO 9660 Extensions: Microsoft Joliet Level 3
[ 4619.691737] ISOFS: changing to secondary root
[ 4691.563347] usb 3-4: USB disconnect, device number 7
[ 4693.638315] usb 3-4: new high-speed USB device number 8 using xhci_hcd
[ 4693.766896] usb 3-4: New USB device found, idVendor=148f, idProduct=2878
[ 4693.766901] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4693.766903] usb 3-4: Product: Љ
[ 4693.766905] usb 3-4: Manufacturer: Љ
[ 4693.767338] usb-storage 3-4:1.0: USB Mass Storage device detected
[ 4693.768063] scsi host7: usb-storage 3-4:1.0
[ 4694.766737] scsi 7:0:0:0: CD-ROM MediaTek Flash autorun 0.01 PQ: 0 ANSI: 0 CCS
[ 4694.767423] sr 7:0:0:0: [sr0] scsi3-mmc drive: 52x/52x cd/rw xa/form2 cdda tray
[ 4694.767908] sr 7:0:0:0: Attached scsi CD-ROM sr0
[ 4694.768147] sr 7:0:0:0: Attached scsi generic sg1 type 5
[ 4728.418255] ISO 9660 Extensions: Microsoft Joliet Level 3
[ 4728.427856] ISOFS: changing to secondary root
[ 4733.824182] sr 7:0:0:0: [sr0] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 4733.824190] sr 7:0:0:0: [sr0] tag#0 CDB: Start/Stop Unit 1b 00 00 00 02 00
[ 4733.824218] usb 3-4: USB disconnect, device number 8
[ 4733.824281] sr 7:0:0:0: [sr0] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 4733.824291] sr 7:0:0:0: [sr0] tag#0 CDB: Prevent/Allow Medium Removal 1e 00 00 00 00 00
[ 4734.099901] usb 3-4: new high-speed USB device number 9 using xhci_hcd
[ 4734.238749] usb 3-4: New USB device found, idVendor=148f, idProduct=7601
[ 4734.238754] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4734.238757] usb 3-4: Product: 802.11 n WLAN
[ 4734.238772] usb 3-4: Manufacturer: MediaTek
[ 4734.238775] usb 3-4: SerialNumber: 1.0
[ 4735.432096] usb 3-4: reset high-speed USB device number 9 using xhci_hcd
[ 4735.562543] mt7601u 3-4:1.0: ASIC revision: 76010001 MAC revision: 76010500
[ 4735.563089] mt7601u 3-4:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
[ 4739.011624] mt7601u 3-4:1.0: Vendor request req:07 off:09a8 failed:-110
[ 4742.131399] mt7601u 3-4:1.0: Vendor request req:02 off:09a8 failed:-110
[ 4745.251254] mt7601u 3-4:1.0: Vendor request req:07 off:0734 failed:-110
[ 4748.371056] mt7601u 3-4:1.0: Vendor request req:42 off:0230 failed:-110
[ 4751.490880] mt7601u 3-4:1.0: Vendor request req:07 off:0080 failed:-110
[ 4754.610694] mt7601u 3-4:1.0: Vendor request req:02 off:0080 failed:-110
[ 4757.730501] mt7601u 3-4:1.0: Vendor request req:02 off:0080 failed:-110
[ 4757.730548] mt7601u: probe of 3-4:1.0 failed with error -110
[ 4757.730870] usbcore: registered new interface driver mt7601u
// end ----------------------------------------

$> sudo ifconfig -a // do not list any new interface

2) DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2
this driver is downloaded from MediaTek:
https://www.mediatek.com/products/broadbandWifi/mt7601u
to compile, need to patch some source code
file: rt_linux.h
typedef struct _OS_FS_INFO_
{
//int fsuid;
//int fsgid;
kuid_t fsuid;
kgid_t fsgid;
mm_segment_t fs;
} OS_FS_INFO;

config.mk
add following line after line:225
WFLAGS += -Wno-error=date-time

After compile,
cp the RT2870STA.dat to /etc/Wireless/RT2870STA/ as the readme in the driver,
$> sudo insmod mt7601Usta.ko
$> dmesg
// begin -------------------------------------------
[ 3534.318919] #
[ 3534.398911] #
[ 3534.478911] #
[ 3534.558903] #
[ 3534.563894] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=IN, Req=0x7, Idx=0x1000,pAd->Flags=0x0
[ 3534.638897] #
[ 3534.718885] #
[ 3534.798891] #
[ 3534.878884] #
[ 3534.958882] #
[ 3535.038905] #
[ 3535.118870] #
[ 3535.198853] #
[ 3535.278861] #
[ 3535.358847] #
[ 3535.363822] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=IN, Req=0x7, Idx=0x1000,pAd->Flags=0x0
[ 3535.438850] #
[ 3535.518846] #
[ 3535.598850] #
[ 3535.678839] #
[ 3535.758833] #
[ 3535.838830] #
[ 3535.918824] #
[ 3535.998824] #
[ 3536.078816] #
[ 3536.158809] #
[ 3536.163798] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=IN, Req=0x7, Idx=0x1000,pAd->Flags=0x0
[ 3536.163811] WaitForAsicReady(0xffffffff):AsicNotReady!
[ 3536.238800] #
[ 3536.318800] #
[ 3536.398793] #
[ 3536.478791] #
[ 3536.558785] #
[ 3536.638771] #
[ 3536.718777] #
[ 3536.798772] #
[ 3536.878762] #
[ 3536.958764] #
[ 3536.963762] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=IN, Req=0x7, Idx=0x24,pAd->Flags=0x0
[ 3536.963765] NVM is EFUSE
[ 3536.963767] Efuse Size=0x2d [Range:2d0-2fc]
[ 3536.963769] Endpoint(8) is for In-band Command
[ 3536.963770] Endpoint(4) is for WMM0 AC0
[ 3536.963772] Endpoint(5) is for WMM0 AC1
[ 3536.963773] Endpoint(6) is for WMM0 AC2
[ 3536.963774] Endpoint(7) is for WMM0 AC3
[ 3536.963776] Endpoint(9) is for WMM1 AC0
[ 3536.963777] Endpoint(84) is for Data-In
[ 3536.963778] Endpoint(85) is for Command Rsp
[ 3536.963781] Allocate a net device with private data size=0!
[ 3536.963802] Allocate net device ops success!
[ 3536.963805] The name of the new ra interface is ra0...
[ 3536.963807] RtmpOSNetDevAttach()--->
[ 3536.964094] <---RtmpOSNetDevAttach(), ret=0
[ 3536.964097] <===rt2870_probe()!
[ 3536.964225] usbcore: registered new interface driver rt2870
[ 3536.964448] ===>rt_ioctl_giwrange
[ 3536.964457] INFO::Network is down!
[ 3536.964545] INFO::Network is down!
[ 3536.973329] ModemManager[6460]: segfault at 0 ip 0000000000431ab3 sp 00007ffd5bd86680 error 4 in ModemManager[400000+103000]
// end -------------------------------------------

3) the driver on https://github.com/art567/mt7601usta.git
the compile and installation steps for this driver are almost same with the 2nd driver.
I also can not get it work.

The attached file is the result generated by the script:
https://ubuntuforums.org/showthread.php?t=370108

Could you help on how to get Ralink MT7601U work?
Thank you very much!

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-4.4.0-91-generic 4.4.0-91.114
ProcVersionSignature: Ubuntu 4.4.0-91.114-generic 4.4.76
Uname: Linux 4.4.0-91-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: chenzero 2055 F.... pulseaudio
CurrentDesktop: Unity
Date: Mon Sep 11 10:12:32 2017
HibernationDevice: RESUME=UUID=04e41a79-f6de-4baf-adb5-675287dc2da1
InstallationDate: Installed on 2016-09-28 (347 days ago)
InstallationMedia: Ubuntu 14.04.5 LTS "Trusty Tahr" - Release amd64 (20160803)
IwConfig:
 lo no wireless extensions.

 eth1 no wireless extensions.
MachineType: Gigabyte Technology Co., Ltd. To be filled by O.E.M.
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-91-generic.efi.signed root=UUID=f4f53ad3-0e42-46e5-a9f2-679314bf74bf ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-4.4.0-91-generic N/A
 linux-backports-modules-4.4.0-91-generic N/A
 linux-firmware 1.157.11
RfKill:

SourcePackage: linux
UpgradeStatus: Upgraded to xenial on 2017-04-21 (142 days ago)
dmi.bios.date: 04/17/2014
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: FD
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: B75M-D3V
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrFD:bd04/17/2014:svnGigabyteTechnologyCo.,Ltd.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnGigabyteTechnologyCo.,Ltd.:rnB75M-D3V:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To be filled by O.E.M.
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
chenzero (chenzero) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Did this issue start happening after an update/upgrade? Was there a prior kernel version where you were not having this particular problem?

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.13 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
chenzero (chenzero) wrote :

I bought this adapter just few days ago and did not have a system upgrade in recently week.

I tried the 4.13 kernel, the dmesg output is almost same:
    Vendor request failed with -110.
Please see the attached file: 4.13.txt

Thanks !

tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Does 148f:7601 only appear after the disk gets ejected?

Revision history for this message
chenzero (chenzero) wrote :

Yes, it's first mounted as a readonly USB disk, including driver files for Windows.
and lsusb shows:
Bus 003 Device 002: ID 148f:2878 Ralink Technology, Corp.

after eject disk, it shows:
Bus 003 Device 003: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Ok, after some digging, the kernel mode modeswitch was deprecated long time along.

The data for this dongle is added 20170120:

20170120:
    Added devices: [03f0:032a] HP LaserJet Professional P1102w, [03f0:9d1d]
    HP lt4120, [0586:2030] ZyXel WAH1004/WAH3004, [148f:2878] RaLink
    MT7601U, [19d2:0033] ZTE MF636DB, [19d2:0090] ZTE MU330, [2001:00a7]
    D-Link DWM-157 C1, [2001:a809] D-Link DWM-157 A1, [2001:ab00] D-Link
    DWM-222, [22de:6802] WeTelecom WM-D200A
    Corrected/appended configs: [1004:6190] LG AD600, [19d2:1595] ZTE MF710
    (Vietnam), [22de:6803] WeTelecom WM-D300
    (collected and compiled by Lars Melin)

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Add the following to /lib/udev/rules.d/40-usb_modeswitch.rules:

# RaLink MT7601U
ATTR{idVendor}=="148f", ATTR{idProduct}=="2878", RUN+="usb_modeswitch '/%k'"

And see if the wifi driver still failed to work.

Revision history for this message
chenzero (chenzero) wrote :

@Kai-Heng Feng,
I guess adding that line in the /lib/udev/rules.d/40-usb_modeswitch.rules is
to automatically switch the adpater to wireless card mode, however, after added that line,
and tried restart service udev (sudo service udev restart), the adpater is still first mounted
as usb storage disk (yes, lsusb only show 148f:2878, I must click an icon on the Launch Bar to eject the disk, and lsusb changed to 148f:7601.

I even tried the line:
 ATTR{idVendor}=="148f", ATTR{idProduct}=="2878", RUN+="usb_modeswitch '%b/%k'"
because most other lines in that file using %b/%k
however, both no have any change( still first mount as usb disk)

Thanks for your help!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Okay, you also need to add more data to /usr/share/usb_modeswitch/configPack.tar.gz.

$ cat 148f\:2878
# RaLink MT7601U
TargetVendor=0x148f
TargetProduct=0x7601
StandardEject=1

Revision history for this message
chenzero (chenzero) wrote :

This time, the adapter is first recognized as 148f:7601.
and the dmesg output is some different.

Although still can not find any interface by "ifconfig -a", and can not select wifi in the "Network Manager", it's promosing to let the adapter work, at least the GMS modem work now.

Please see the attached 17-09-26.txt

Thanks!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Now please go back to comment #3 to test kernel itself (again).

Revision history for this message
chenzero (chenzero) wrote :

I tried kernel 4.13. however, no much diff with kernel 4.4.0-91.
I must mention that in both kernel, no ALAWAYS the adapter is automatically recoginized as 148f:7601, sometimes, it still mounted as 148f:2878, sometimes, it's 7601. ( I found the pattern is: unplug the adapter, wait a relative long time, e.g: 1 or 2 minutes, plug the adapter, then it's 7601. if immediately plug in the adapter, say just wait 10 seconds, mostly, it's mounted as usb stroage disk and will not change to 7601).

I can use following command to switch mode, with errors, but mode changed to 7601.

chenzero@chenzero:/usr/share/usb_modeswitch$ sudo usb_modeswitch -v 148f -p 2878 -V 148f -P 7601 -K
Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 016 on bus 001
Current configuration number is 1
Use interface number 0
Use endpoints 0x08 (out) and 0x84 (in)
Error: could not get description string "manufacturer"
Error: could not get description string "product"

USB description data (for identification)
-------------------------
Manufacturer:
     Product:
  Serial No.: not provided
-------------------------
Sending standard EJECT sequence
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x08 for message sending ...
Trying to send message 1 to endpoint 0x08 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Response successfully read (13 bytes).
Trying to send message 2 to endpoint 0x08 ...
 OK, message successfully sent
Read the response to message 2 (CSW) ...
 Response reading failed (error -1)
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!

Please see the attached 09-26.2.txt

Thanks!

Revision history for this message
chenzero (chenzero) wrote :

I just fell a little strange that is , why some info log in mt7801u is not printed,
e.g: in 09-26.2.txt, no any log about mt7601u. however, in mt7801u code, it printed those info....

[ 127.095245] mt7601u 1-1.4:1.0: ASIC revision: 76010001 MAC revision: 76010500
[ 127.146876] mt7601u 1-1.4:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____

and I sometimes still can see on kernel 4.13 or 4.4.0-91
  Vendor request failed with -110.

what's the differences between replying on system to automatically switch mode and I manually eject the disk , or if I run command
sudo usb_modeswitch -v 148f -p 2878 -V 148f -P 7601 -K

Thanks !

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Weird. Can you try Artful live image?

Revision history for this message
chenzero (chenzero) wrote :

What do you mean "Artful live image" ?
do you mean boot computer with the latest release ISO ?
Ubuntu 17.04 ISO on the page: https://www.ubuntu.com/download/desktop

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
chenzero (chenzero) wrote :

I tried the Artful image.
on the Artful image, it doesn't need to change any settings, the adapter is automatically recognized as 148f:7601, however, the same vendor request -110 error in the dmesg log.

Please see the attached artful-image.txt

Thanks!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Can you add "mt7601u.dyndbg=+p" to your kernel parameter and attach dmesg here? Thanks.

Revision history for this message
chenzero (chenzero) wrote :

I tried on kernel 4.13. that's,

add "mt7601u.dyndbg=+p" into grub.cfg, so the lines are :
menuentry {
     .....
     linux /boot/vmlinuz-4.13.0-041300-generic root=UUID=f4f53ad3-0e42-46e5-a9f2-679314bf74bf ro quiet splash $vt_handoff mt7601u.dyndbg=+p
     initrd /boot/initrd.img-4.13.0-041300-generic
}
reboot,

$ cat /proc/cmdline // the output shows that param is add
BOOT_IMAGE=/boot/vmlinuz-4.13.0-041300-generic root=UUID=f4f53ad3-0e42-46e5-a9f2-679314bf74bf ro quiet splash vt.handoff=7 mt7601u.dyndbg=+p

It seems that no much differences in the dmesg log.
Please see the attached kernel-param.txt

BTW, I also tried to add "mt7601u.dyndbg=+p" in the /etc/sysctl.conf, reboot, however, it seems this doesn't have effect because "sudo sysctl -a|grep mt" doesn't show the parameter.

Regards

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please use the kernel here: http://people.canonical.com/~khfeng/lp1716301/

I add a timeout parameter for mt7601u. The default timeout is 300ms.

Now you can try something like "mt7601u.timeout=1000".

Revision history for this message
chenzero (chenzero) wrote :

Hi, I am not sure where to add this timeout ?
in the /etc/sysctl.conf, or in the /boot/grub/grub.cfg
Thanks!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

You can use modprobe conf to do that:

$ sudo -s
# echo "options mt7601u timeout=1000" >> /etc/modprobe.d/mt7601u.conf

Revision history for this message
chenzero (chenzero) wrote :

Test result on kernel 4.14
1. same vendor request failed with -110
2. I notice that the Wire network(yes, Wire network) is also not work on 4.14. on kernel 4.4.0-91 (the kernel my mostly used), it's work

Please see the attached 4.14.txt
Thanks!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Can you try values even larger? e.g. 3000, 10000.

Revision history for this message
chenzero (chenzero) wrote :

I tried the timeout value: 10000
Please see the attached: 4.14-long-timeout.txt
Thanks

Revision history for this message
chenzero (chenzero) wrote :

forget to mention test result:
same vendor request failed with -110 event long timeout

BTW, this looks like this is a bad adapter, however, I tried this adapter in Win10, it definitely can work.
In Windows, it must install dirver files from another company named Tplink, but from lsusb, its chip is from Ralink, whether the Tplink driver in Win10 might use some different vendor specific request ? I meant, Tplink driver uses some different request to implement some function, however, Tplink still uses Ralink USB id(146f:7601), so, if this, timeout (-110) will occur.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Okay, I think it'll be better to debug yourself, it's hard to debug without physical hardware access.

Looks like probe failed in __mt7601u_dma_fw().
You probably need to print some debug information to find out at which point the function fails.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

The device probably requires a delay between modeswitch, it's pure guesswork though. Please try kernel here:
http://people.canonical.com/~khfeng/lp1716301-delay-quirk/

Revision history for this message
chenzero (chenzero) wrote :

Sorry the late.
Test Result on the new kernel:
same vendor request failed -110

Please see the attached: 4.14-delay-modeswitch.txt

BTW, do you know any tool that can monitor the USB traffic? if have this kind of tool, I can capture some log on Win10 to find where is the problem.

Thanks!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

You can use usbmon and Wireshark.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

BTW, is mt7601u also a GSM modem?

Revision history for this message
chenzero (chenzero) wrote :

I am not sure if mt7601u is GMS modem or not, however, I guess Yes, because it's the only device related to wireless on my computer

Thanks. I will try usbmon or Wireshark later.

Revision history for this message
chenzero (chenzero) wrote :

A log:mt7601-1.pcapng caputured by Wireshark on Windows.

the adpater is connected on Port 4.
USBPcapCMD.exe output:
//----------------------------------
1 \\.\USBPcap1
  \??\USB#ROOT_HUB20#4&282dcf3f&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
    [Port 1] Generic USB Hub
      .....
      [Port 4] TP-LINK Wireless USB Adapter
//----------------------------------

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in usb-modeswitch-data (Ubuntu):
status: New → Confirmed
Revision history for this message
Thomas P. (tom.p) wrote :

Tried kernel 4.13.10 to no avail. Seems my adapter is slightly different. It does not show up as disk. Instead it is recognized as WLAN device immediately. Error msg is also different. Pls see attached file dmesg_kernel_4.13.10 and let me know if you need more information or want my to test further.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Both of you plugged mt7601u into EHCI (USB 2.0) port.

Can you try plugging it into an XHCI (USB 3.0) port?

Revision history for this message
Thomas P. (tom.p) wrote :

Attached dmesg output from a USB 3.0 system with kernel 4.4.0.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Yea I can see same error.

Can you try latest mainline kernel?

Revision history for this message
Thomas P. (tom.p) wrote :

Luckily I could convince the owner of the system that testing this kernel wouldn't do any harm.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Try if kernel parameter "usbcore.autosuspend=-1" helps.

The reset after probing is fishy here,
[ 308.512689] usb 1-1: reset high-speed USB device number 5 using xhci_hcd

Revision history for this message
Thomas P. (tom.p) wrote :

$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.14.0-041400rc7-generic root=UUID=7c46b69f-ad98-4f49-93ac-2e5a68fbd6dc ro quiet splash usbcore.autosuspend=-1 vt.handoff=7

seems this didn't change anything

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Forgot to ask an important question, did the device work on on earlier Ubuntu Release, e.g. Precise & Trusty?

Revision history for this message
Thomas P. (tom.p) wrote :

Bought the device some days ago. Had no chance to test earlier Ubuntu releases.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please try kernel here, I added some quirks for the device,
http://people.canonical.com/~khfeng/lp1716301-corequirks/

Revision history for this message
Thomas P. (tom.p) wrote :

Thanks for all your efforts.

$ uname -a
Linux video-box 4.13.0-17-generic #20~lp1716301+corequirks SMP Mon Nov 6 04:37:44 EST 2017 x86_64 x86_64 x86_64 GNU/Linux
$ dmesg > dmesg_4.13.0-17.20~lp1716301+corequirks.txt

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

So it didn't work.

Apparently someone found ways to workaround this issue:
https://github.com/kuba-moo/mt7601u/issues/64

Revision history for this message
Thomas P. (tom.p) wrote :

Unfortunately the workaround from the previous post did not work for me. Do still get the same error.

Revision history for this message
Alexander Renn (alexander-renn) wrote :

The Windows driver that's on an adapter's embedded virtual CD contains FW_7662.bin (79216 bytes). I tried replacing the /lib/firmware/mt7601u.bin with that firmware. Driver loads the firmware onto the device:
mt7601u 1-3:1.0: Firmware Version: 0.0.00 Build: 1 Build time: 201411280941____

But then I get the same error:
mt7601u 1-3:1.0: Vendor request req:02 off:0a44 failed:-110

Revision history for this message
Thomas P. (tom.p) wrote :

Retried with recent instructions from mrgromov in post https://github.com/kuba-moo/mt7601u/issues/64 and got it to work.
Would it be possible to create a fix or is this particular device buggy?

Revision history for this message
Fox Liu (tianxiang1989) wrote :

In ubuntu 14.04,kernel 4.4.0-109-generic also has this issue,I tried https://github.com/kuba-moo/mt7601u/issues/64 but is not work.lsusb show Bus 003 Device 005: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter,which model is TP-link w725n (Free drive).I have tried many ways but still can't resolve it,however it works fine in Virtual box win7 system.

dmesg:
...
[ 263.432849] usb 3-8: reset high-speed USB device number 9 using xhci_hcd
[ 263.563174] mt7601u 3-8:1.0: ASIC revision: 76010001 MAC revision: 76010500
[ 263.776962] mt7601u 3-8:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201308222153____
[ 267.245013] mt7601u 3-8:1.0: Vendor request req:07 off:09a8 failed:-110
[ 270.365290] mt7601u 3-8:1.0: Vendor request req:02 off:09a8 failed:-110
[ 273.489665] mt7601u 3-8:1.0: Vendor request req:07 off:0734 failed:-110
[ 276.609922] mt7601u 3-8:1.0: Vendor request req:42 off:0230 failed:-110
[ 279.734233] mt7601u 3-8:1.0: Vendor request req:07 off:0080 failed:-110
[ 282.854578] mt7601u 3-8:1.0: Vendor request req:02 off:0080 failed:-110
[ 285.974818] mt7601u 3-8:1.0: Vendor request req:02 off:0080 failed:-110
[ 285.974859] mt7601u: probe of 3-8:1.0 failed with error -110

Revision history for this message
Vicente Oyanedel (vichoko) wrote :

The solution described here worked for me in Ubuntu 16.04 and 18.04:
https://github.com/kuba-moo/mt7601u/issues/64#issuecomment-352250127

I will reference it here:

Originally written by ingate.
Thanks to aleksander and Nidroide.
Tested on Ubuntu 14.04 (kernel 4.4), Ubuntu 17.10 (kernel 4.13) and Ubuntu 18.04 (4.15.0-36-generic)

1. Download corresponding kernel source from kernel.org. For example: if you have 4.4.0-104-generic download version 4.4.
2. From archive unpack just folder drivers/net/wireless/mediatek/mt7601u
3. Edit phy.c. Find function mt7601u_init_cal and comment out call mt7601u_mcu_calibrate(dev, MCU_CAL_RXIQ, 0); like so:

// ret = mt7601u_mcu_calibrate(dev, MCU_CAL_RXIQ, 0);
// if (ret)
// return ret;
// ret = mt7601u_mcu_calibrate(dev, MCU_CAL_DPD, dev->dpd_temp);
// if (ret)
// return ret;

Find function mt7601u_phy_recalibrate_after_assoc and comment out call mt7601u_mcu_calibrate(dev, MCU_CAL_DPD, dev->curr_temp); like so:

void mt7601u_phy_recalibrate_after_assoc(struct mt7601u_dev *dev)
{
// mt7601u_mcu_calibrate(dev, MCU_CAL_DPD, dev->curr_temp);

    mt7601u_rxdc_cal(dev);
}

4. Build module: make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
5. Remove device
6. sudo rmmod mt7601u
7. sudo insmod ./mt7601u.ko
8. Insert device
9. Check there are no errors in dmesg and interface appeared in ip link, check connection stability.
10. To make change persistent till next kernel upgrade: backup original module and replace with compiled. To find out where is original module run modinfo mt7601u (view string filename: /lib/modules/_KERNEL_VERSION_/kernel/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko).

Revision history for this message
Martin Pichna (mpichna) wrote :

Hello folks,

I've experienced same problem with usb wifi (Tenda U2), which has the same chip - mediatek mt7601u. The wifi dongle would not start and the kern.log reports same errors:

Vendor request req:02 off:0080 failed:-110

I tested this with multiple ubuntu versions - 16.0.4, 14.04 and 18.04. In all of these releases the behaviour is same. Fortunately I found a solution for this and created a small patch mcu.patch - the file that require patch is mcu.c. The patch file is attached.

Nevertheless the patch adds a module's parameter "vnd_reset" (by default set to 1 - preserve current behaviour). But after the module is patched and compiled, you can load the module like:

insmod mt7601u.ko vnd_reset=0

The above will bypass the problematic (for some dongles) function we call in the driver - mt7601u_vendor_reset().
By doing so, I was able to fix the issue for my usb dongle, it works now like a charm.

I'd like to ask Ubuntu community if this patch can be applied across all active ubuntu branches, so anyone who has issues like this can try to load the module with "vnd_reset=0" parameter and see if that fixes issues. By porting this extension to the driver, we'll avoid that the driver has to be re-compiled with a new kernel version.

thanks, martin

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please upstream the patch first so we can backport it.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch for the driver" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Brad Figg (brad-figg)
tags: added: cscc
Revision history for this message
Thomas P. (tom.p) wrote :

Seems the fix was not accepted/applied. Just tried latest 18.04, 19.04 and finally 19.10 with kernel 5.3.0-26-generic #28-Ubuntu

 usb 1-3: new high-speed USB device number 2 using ehci-pci
 usb 1-3: New USB device found, idVendor=148f, idProduct=7601, bcdDevice= 0.00
 usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 usb 1-3: Product: 802.11 n WLAN
 usb 1-3: Manufacturer: MediaTek
 usb 1-3: SerialNumber: 1.0
 mtp-probe: checking bus 1, device 2: "/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3"
 mtp-probe: bus: 1, device: 2 was not an MTP device
 cfg80211: Loading compiled-in X.509 certificates for regulatory database
 cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
 usb 1-3: reset high-speed USB device number 2 using ehci-pci
 mt7601u 1-3:1.0: ASIC revision: 76010001 MAC revision: 76010500
 mt7601u 1-3:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
 mt7601u 1-3:1.0: EEPROM ver:0c fae:00
 usb 1-3: USB disconnect, device number 2
 mt7601u 1-3:1.0: rx urb failed: -71
 mt7601u 1-3:1.0: Error: submit URB dir:128 ep:1 failed:-19
 usbcore: registered new interface driver mt7601u
 usb 1-3: new high-speed USB device number 3 using ehci-pci
 usb 1-3: New USB device found, idVendor=148f, idProduct=7601, bcdDevice= 0.00
 usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 usb 1-3: Product: 802.11 n WLAN
 usb 1-3: Manufacturer: MediaTek
 usb 1-3: SerialNumber: 1.0
 usb 1-3: reset high-speed USB device number 3 using ehci-pci
 mt7601u 1-3:1.0: ASIC revision: 76010001 MAC revision: 76010500
 mt7601u 1-3:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
 mt7601u 1-3:1.0: EEPROM ver:0c fae:00
 mt7601u 1-3:1.0: rx urb failed: -71
 mt7601u 1-3:1.0: Error: MCU resp urb failed:-71
 mt7601u 1-3:1.0: Error: MCU resp evt:0 seq:5-4!
 mt7601u 1-3:1.0: rx urb failed: -71
 mt7601u 1-3:1.0: Error: MCU resp urb failed:-71
 mt7601u 1-3:1.0: Error: MCU resp evt:0 seq:5-4!
 mt7601u 1-3:1.0: rx urb failed: -71

Revision history for this message
Yanike (yanikegroup) wrote :

Tested and now my MT7601U USB Dongle (Ralink Technology, Corp. MT7601U Wireless Adapter) is working in Ubuntu 20.04 :)
https://askubuntu.com/questions/1205254/ralink-tech-mt7601u-wireless-adapter-on-xubuntu

You-Sheng Yang (vicamo)
tags: added: hwe-networking-wifi
Revision history for this message
Chris Guiver (guiverc) wrote (last edit ):

Thank you for reporting this bug to Ubuntu.

Ubuntu 16.04 (xenial) reached end-of-standard-support on April 29, 2021.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in.

(reverted; duplicate report https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1885985 shows focal)

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Changed in usb-modeswitch-data (Ubuntu):
status: Confirmed → Incomplete
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Changed in usb-modeswitch-data (Ubuntu):
status: Incomplete → Confirmed
tags: added: focal
To post a comment you must log in.