brektrou / rtl8821CU

Realtek RTL8811CU/RTL8821CU USB Wi-Fi adapter driver for Linux
GNU General Public License v2.0
1.58k stars 458 forks source link

"FP instruction issued in kernel mode with FP unit disabled" on armv7h #137

Closed Moarc closed 3 years ago

Moarc commented 3 years ago

Arch Linux ARM on an unsupported board, kernel 5.11.2-1-ARCH, arch ARMv7 (armv7l). Upon loading the module, it throws the error

[ 2453.884446] BUG: FP instruction issued in kernel mode with FP unit disabled
[ 2453.891457] FPEXC == 0x00000000
[ 2453.894621] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP ARM

and dumps a bit of memory into the kernel log.

My CPU is supposed to have VFP/NEON.

I would need some instructions in order to troubleshoot, for example some other module that also uses floating point instructions, but I certainly can spare the time to provide anything you would need.

rrafal1337 commented 3 years ago

Hi. Did you tried to perform this workaround? https://github.com/brektrou/rtl8821CU#arm-architecture-tweak-for-this-driver-this-solves-compilation-problem-of-this-driver It has been called aarch32 in readme but it is for armv7l. Just check those commands. Removing soft float form kernel hearders helped me to compile driver with hard float and thanks to that driver stopped to crash.

Moarc commented 3 years ago

I actually built the module this before even encountering any issue, since it was applied by default in the AUR package - so the error appears after having applied this workaround.

Moarc commented 3 years ago

Sorry, it seems this was an issue with hardware floating point support being disabled in the default Arch Linux ARM armv7l kernel. The driver works perfectly fine on Armbian, with a kernel that does use floating-point instructions.