Setup:
- Raspberry Pi 5 - 8GB
- Sandisk Extreme Plus - 256 GB
- Alfa Networks AWUS036ACM USB WiFi adapter
Steps to reproduce:
- Install Raspberry Pi OS Lite with rpi-imager (Linux kernel 6.6 at time of writing)
- Connect to a WiFi access point with the WiFi adapter. It doesn't matter if you use a USB 2 or 3 port.
- Install nmap
- Run nmap in a loop:- Watch dmesg in another window
Workarounds:
- Disabling scatter-gather in the mt76_usb kernel driver alleviates the problem a little bit but does not fix it
- kernel 6.12 seems to work out okay so far
1024 runs is more than enough nmap to get it stuck. It normally only takes me 2-3 nmap runs to see the card get stuck. At some point, the terminal will be a little more unresponsive and you'll see errors like this in dmesg, where -110 is ETIMEDOUT:To recover, you can either reboot the pi or just remove the USB dongle and plug it back in.
I initially thought this was a problem with the mt76 driver code, but the closer I looked in the rpi-6.6.y source code the more it looked like it was some kind of mac80211 or USB issue. At some point, the tx queues get filled up and no more can be added but the ones already in there aren't being flushed. You can see this by watching the ieee80211 queues while running the test:While nmap is running, you'll see the tx queues filling up and as soon as you see the timeout the numbers just remain static.
These github issues show other people have had issues with this WiFi adapter on the a Raspberry Pi. This community is mostly reporting problems related to using these network adapters in access point mode, but I think the underlying issue is probably the same. I think it's just related to the amount of data that the pi has to process that causes the hangups. I also posted about this in #410 (at the very bottom, it's a loonnggggg thread). One suggestion that seems to make a meaningful difference is to disable scatter-gather in the kernel driver for the WiFi device. It helps, but I've still seen the WiFi device get stuck with scatter-gather disabled. It just takes a very long time!
https://github.com/morrownr/USB-WiFi/issues/410
https://github.com/morrownr/USB-WiFi/issues/417
I updated my Raspberry Pi to kernel 6.12 with rpi-update, and I haven't seen the same issue, although I will still be monitoring it. It seems like the NUMA changes viewtopic.php?t=379745 are probably what made the difference, although I do not know much about NUMA or networking code in the kernel.
- Raspberry Pi 5 - 8GB
- Sandisk Extreme Plus - 256 GB
- Alfa Networks AWUS036ACM USB WiFi adapter
Steps to reproduce:
- Install Raspberry Pi OS Lite with rpi-imager (Linux kernel 6.6 at time of writing)
- Connect to a WiFi access point with the WiFi adapter. It doesn't matter if you use a USB 2 or 3 port.
- Install nmap
- Run nmap in a loop:
Code:
for i in $(seq 1 1024); do echo "======================== RUN NUMBER $i ========================"; nmap 192.168.50.1/24; done
Workarounds:
- Disabling scatter-gather in the mt76_usb kernel driver alleviates the problem a little bit but does not fix it
- kernel 6.12 seems to work out okay so far
1024 runs is more than enough nmap to get it stuck. It normally only takes me 2-3 nmap runs to see the card get stuck. At some point, the terminal will be a little more unresponsive and you'll see errors like this in dmesg, where -110 is ETIMEDOUT:
Code:
[ 233.809457] mt76x2u 3-2:1.0: error: mt76x02u_mcu_wait_resp failed with -110
I initially thought this was a problem with the mt76 driver code, but the closer I looked in the rpi-6.6.y source code the more it looked like it was some kind of mac80211 or USB issue. At some point, the tx queues get filled up and no more can be added but the ones already in there aren't being flushed. You can see this by watching the ieee80211 queues while running the test:
Code:
watch -n 0.1 cat /sys/kernel/debug/ieee80211/*/mt76/*-queues
These github issues show other people have had issues with this WiFi adapter on the a Raspberry Pi. This community is mostly reporting problems related to using these network adapters in access point mode, but I think the underlying issue is probably the same. I think it's just related to the amount of data that the pi has to process that causes the hangups. I also posted about this in #410 (at the very bottom, it's a loonnggggg thread). One suggestion that seems to make a meaningful difference is to disable scatter-gather in the kernel driver for the WiFi device. It helps, but I've still seen the WiFi device get stuck with scatter-gather disabled. It just takes a very long time!
https://github.com/morrownr/USB-WiFi/issues/410
https://github.com/morrownr/USB-WiFi/issues/417
I updated my Raspberry Pi to kernel 6.12 with rpi-update, and I haven't seen the same issue, although I will still be monitoring it. It seems like the NUMA changes viewtopic.php?t=379745 are probably what made the difference, although I do not know much about NUMA or networking code in the kernel.
Statistics: Posted by TwoBottomBuns — Fri Mar 14, 2025 3:35 pm