jurobystricky / Netgear-A6210

AC1200 High Gain WiFi USB Adapter Linux kernel driver
291 stars 155 forks source link

Odroid XU4 ERROR in Alloc Bulk buffer for HTTxContext RTMPFreeTxRxRingMemory #95

Open haoyangw opened 6 years ago

haoyangw commented 6 years ago

Opening an issue here in case anyone else using Odroid XU3/XU4 faces this issue and was as frustrated/felt as hopeless as I did and wants a solution. So I bought a Netgear A6210(chip is MT7612U) and tried to plug it into my Odroid XU4 running Ubuntu 16.04.3, Linux Kernel 4.9.61-73(was running Kernel v4.14.9-94 but downgraded because of vfs_read issues). Of course, it didn't work(because A6210/MT7612U is not officially supported) and while googling for drivers I found this git repo and this, and got to work compiling/installing it. Actually I compiled @genodeftest's code, and installed that with make install. I believe the issues should be the same for this repo's code because genodeftest's code is based on this. Now after a reboot, rather than seeing WiFi working(seeing WiFi networks), I'm still stuck with Ethernet, and after some googling I did a lsmod, and saw that the module was loaded(I could see an entry 'mt7612u_sta', which is this module). I then did a dmesg to find out what happened. Here's a snipplet of some distinct parts of the error: driver version: 3.0.0.1 (Dec 31 2017 18:16:57) . [ 11.706280] <-- ERROR in Alloc Bulk buffer for HTTxContext! [ 11.706285] ---> RTMPFreeTxRxRingMemory [ 11.706296] <--- RTMPFreeTxRxRingMemory [ 11.706300] ERROR mt766u_sta: [ 11.706304] Failed to allocate memory - TxRxRing Now to be honest, this isn't very helpful because it doesn't actually hint what the solution should/would be. So after some googling, I found someone with a similar problem here, and here. Based on some suggestions(near the bottom of the page of the first link), I decided to change the coherent_pool kernel parameter, by setting coherent_pool=4M. Here's how(add that line at the end of the long string of bootargs). And then I reboot, and voila, WiFi works now! :) For me the driver works really well, I've ran it for almost an hour and no dropped packets yet(based on ifconfig). I've attached the full module load error from dmesg below if it helps the dev(s). And now for some help regarding compiling this kernel module, since I haven't found a detailed tutorial for the Odroid/possibly others. Setting up your Odroid Ok before you compile this, or genodeftest's code, you'll need to setup your kernel headers and kernel source code. So you'll need linux-headers-<your kernel version>, and the source code for the version of the kernel you are currently running. I bolded this because you should ideally clone/download the exact version of the kernel source that you are running, and not just the latest version you can find. To find your currently-running kernel version, do uname -r. For example, mine is 4.9.61-73, so I would do apt-get install linux-headers-4.9.61-73. As for the kernel source, I cloned hardkernel's official kernel github repo here. Weirdly, for Odroid the build and source folders in the linux modules directory is missing so you'll need to create them yourself, here's how. Do a ln -s <kernel source directory> </lib/modules/<your kernel version>/build and a ln -s <kernel source directory> </lib/modules/<your kernel version>/source. For example, for me it was ln -s /home/haoyangw/linux-4.9 /lib/modules/4.9.61-73/build. Now, you'll need to prepare your kernel source for compiling this repo's module. Do a cd /lib/modules/<your kernel version>/build, and then execute the following commands. make odroidxu4_defconfig, then make prepare, then make scripts, and lastly make -j8 modules. The last step, make -j8 modules, will take quite long(about 20 mins) so be prepared. When it's done, copy the Module.symvers and .config files form the build(aka kernel source) directory into the source code of this repo. And then you can compile this repo as usual, with make and make install. Then just reboot, and if you have set the coherent_pool parameter already, the driver should work :) Hope you are successful as I am! mt7662u_sta_error.txt

haoyangw commented 6 years ago

Haven't tried upgrading back to Kernel v4.14.9-94 yet, if I find time I'll upgrade/update and update this issue again :)