LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   kernel panic with newly compiles module (https://www.linuxquestions.org/questions/slackware-arm-108/kernel-panic-with-newly-compiles-module-4175667054/)

justwantin 01-04-2020 01:31 AM

kernel panic with newly compiles module
 
I have done an in tree compile of the rtl8812u module. I can load it using modprobe and when I insert the usb dongle it is recognised and functional.

However, if I boot with the wifi dongle inserted or if I insert it after the system is up I get a kernel panic.
Code:

[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: r8712_efuse_pg_packet_read+0x80/0x1b8 [r8712u] ]
Perhaps someone can explain the problem. I have in the past just enabled this module and compiled the kernel and all modules at the same time (too much time) and had a good r8712u.ko module but this time I just compiled the module in tree with
Code:

# make modules_prepare
# make M=drivers/staging/rtl8712

after saving .config. Did I miss a step along the way?

colorpurple21859 01-04-2020 02:58 PM

Seems like the wrong module is loaded/used if the correct module isn't loaded first. Add "/sbin/modprobe rtl8812u" to /etc/rc.d/rc.modules.local

justwantin 01-04-2020 06:08 PM

Thanks for the reply. Using rc.modules_local I can boot with the wifi dongle inserted and not get a kernel panic. I can the use iwconfig to set up the device but after 'ifconfig up' when I try to run iwlist wlan0 scan I have a kernel panic with the same message.

This wireless dongle had been working with slackwarearm current from back in May on this same BananaPro only in that install I had compiled a new kernel and set of modules. I have another exact same setup that has been running panic free for over a year. It there must have been something wrong or that I neglected to do yesterday when I compiled that module. Here's some infe from the one running in my garden shed.
Code:

root@bpro9:/home/rick# uname -r
4.8.15-armv7
root@bpro9:/home/rick# lsusb                                                                 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 046d:0805 Logitech, Inc. Webcam C300
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0b05:1791 ASUSTek Computer, Inc. WL-167G v3 802.11n Adapter [Realtek RTL8188SU]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@bpro9:/home/rick# lsmod | grep r8712u                                                           
r8712u                142699  0
usbcore              152045  22 ehci_orion,uvcvideo,ehci_tegra,usbhid,snd_usb_audio,ums_isd200,usb_storage,r8712u,ums_cypress,ehci_hcd,ums_usbat,ums_jumpshot,ums_freecom,uhci_hcd,ums_onetouch,snd_usbmidi_lib,ums_alauda,ohci_hcd,ums_sddr09,ums_sddr55,ehci_platform,ohci_platform


abga 01-04-2020 08:07 PM

@justwantin

The kernel wireless wiki page lists rtl8192su for your adapter (considering the output of your lsusb):
https://wireless.wiki.kernel.org/en/...rivers/rtl819x
Quote:

rtl8192su is a USB driver for RTL8188SU/RTL8191SU/RTL8192SU devices. (WIP: http://github.com/chunkeey/rtl8192su )
https://github.com/chunkeey/rtl8192su

Have you tried building and using that module? If your kernel (udev) loads a different module, you can always blacklist it by creating:
/lib/modprobe.d/blacklist-module-name.conf
containing the name of the module(s) you wish to blacklist.

justwantin 01-05-2020 12:40 AM

I have had the exact same setup with a bananapro and the same wifi dongle running without problems for a very long time. I had the same wifi dongle working on this bananapro up until I installed current 19/12/2019 and consequently needed to compile a new module.
Code:

Device drivers > Staging Drivers > Realtek RTL8712u (RTL8192SU) Wireless LAN NIC Driver
Code:

root@bpro9:/# lsusb
<snipped
Bus 001 Device 002: ID 0b05:1791 ASUSTek Computer, Inc. WL-167G v3 802.11n Adapter [Realtek RTL8188SU]
<snipped>
root@bpro9:/#

Code:

root@bpro9:/# lsmod | grep r8712u                         
r8712u                142699  0
usbcore              152045  22 ehci_orion,uvcvideo,ehci_tegra,usbhid,snd_usb_audio,ums_isd200,usb_storage,r8712u,ums_cypress,ehci_hcd,ums_usbat,ums_jumpshot,ums_freecom,uhci_hcd,ums_onetouch,snd_usbmidi_lib,ums_alauda,ohci_hcd,ums_sddr09,ums_sddr55,ehci_platform,ohci_platform
root@bpro9:/# lsmod | grep r8192su


justwantin 01-05-2020 05:44 AM

I finally compiled a r8712u module. I think the problem may have been I did not run a make clean inside the source before compiling not sure. In any case I built and installed a module that will load at boot if the wife dongle is already inserted as well as load if inserted after boot without a kernel panic. So far so good but I've sat here long. I'll come back to it when I'm fresh.

justwantin 01-06-2020 02:22 PM

OK, finally got around to configuring wifi on this dongle and wifi is working. I can most likely attribute my problem to not running make clean before I did anything else.

I may as well provide my steps for compiling a single module from the kernel source as installed in Slackware/Slackwarearm in case someone ends up in this thread looking for how to do it.
Code:

# cd /usr/src/linux
# make clean
# make menuconfig
Select m rtl8712 (found in Drivers > Staging) then Save and Exit menuconfig
# make modules_prepare
# make M=drivers/staging/rtl8712
At the end of the compile the ast line of stdout provides where the modules is in the kernel source tree.
<snipped>
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  drivers/staging/rtl8712/r8712u.mod.o
  LD [M]  drivers/staging/rtl8712/r8712u.ko
Make a directory in the modules tree where the module belongs the copy the module to it.
# mkdir /lib/modules/5.4.5-armv7/kernel/drivers/staging/rtl8712u
# cp drivers/staging/rtl8712/r8712u.ko /lib/modules/5.4.5-armv7/kernel/drivers/staging/rtl8712
If you don't run depmod next the magic don't happen
# depmod -a



All times are GMT -5. The time now is 01:10 PM.