-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloading firmware to usb device fails #1022
Comments
From the PCap, it looks to be a timing issue (maybe too much latency due to the USBIP protocol). Everything works fine up to line 639 of the capture, but then (after > 0.3 s of "nothing") Linux starts aborting all transfers, even though there were no errors up to this point. |
Thanks for taking a look. I tried increasing the timeouts in the linux driver, as well as reducing the transfer sizes (down to only 64 payload bytes). Neither has changed the behavior, unfortunately. |
Another thing is that if I detach the device from wsl after the transfers start failing, windows gives me the "usb device has malfunctioned" popup (and it must be physically replugged). This somewhat seems to make sense, but surprising that usb bus reset doesn't actually reset the device. |
That sounds like a "partial firmware upload". I guess the device is stuck at that point. |
Windows version: Microsoft Windows [Version 10.0.22631.4037]
I'm using local build of wsl2 kernel 6.6:
Using the config in
Microsoft/config-wsl
, with added support for mediatek wifi devices, and embedding firmware files in kernel image (to get around the issue of wsl2 kernel not looking in distro's/lib/firmware
for fw files).the wsl2 kernel dmesg looks like
usbipd output + pcap is here:
usbipd_issue.zip
the same issue occurs whether the device is plugged into superspeed port or not.
the linux-side code that's failing is here: https://github.com/microsoft/WSL2-Linux-Kernel/blob/149cbd13f7c04e5a9343532590866f31b5844c70/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c#L119
...notably, this code in wsl2 kernel isn't up to date with mainline:
wsl2: https://github.com/microsoft/WSL2-Linux-Kernel/commits/linux-msft-wsl-6.6.y/drivers/net/wireless/mediatek/mt76/mt76x2
linux: https://github.com/torvalds/linux/commits/master/drivers/net/wireless/mediatek/mt76/mt76x2
although, not sure if I should try current mainline kernel, or try to backport the driver to wsl2 kernel v6.6 (or if i'm hitting some issue in usbipd)
the adapter works OK with windows. (and on other native linux hosts, although it's been some years since I've used it on such machine)
The text was updated successfully, but these errors were encountered: