2011-09-21 14:33:55     Trouble with modules

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-09-21 14:33:55     Trouble with modules

Milind Paranjpe (UNITED STATES)

Message: 103480   


I'm working on bringing up uClinux on a custom BF527 board.  Things appear to be going quite well, except for the fact that I can't get any drivers compiled as modules to load properly on my kernel.  When I compile the kernel without modversions, any modules I load cause the kernel to crash.  On a kernel running with modversions, I get "unknown symbol" errors for simple symbols such as "printk" which show up in /proc/kallsyms.


For example, when I try to compile / load the sample_module example, I get the following output with modversions:


root:/mnt/app> insmod ./sample_module.ko

[  781.840000] sample_module: no symbol version for _driver_unregister

[  781.844000] sample_module: Unknown symbol _driver_unregister

[  781.848000] sample_module: no symbol version for _printk

[  781.852000] sample_module: Unknown symbol _printk

[  781.856000] sample_module: no symbol version for _driver_register

[  781.860000] sample_module: Unknown symbol _driver_register

[  781.864000] sample_module: no symbol version for _platform_bus_type

[  781.868000] sample_module: Unknown symbol _platform_bus_type

[  781.872000] sample_module: no symbol version for __mcount

[  781.876000] sample_module: Unknown symbol __mcount

insmod: can't insert './sample_module.ko': unknown symbol in module, or unknown parameter

root:/mnt/app> cat /proc/kallsyms | grep _driver_unregister

00101c10 T _sysdev_driver_unregister

00103518 T _driver_unregister

001044a4 T _platform_driver_unregister

00111c78 T _phy_driver_unregister

root:/mnt/app> cat /proc/version

Linux version (xxxx@yyyy) (gcc version 4.3.5 (ADI-2010R1-RC4) ) #2 Tue Sep 20 17:19:29 PDT 2011


I'm using the 2010R1 branches of both uclinux-dist and linux-kernel for my baseline.  I have attached config files for both uClinux and the kernel.


Any clues would be much appreciated.












2011-09-21 23:26:38     Re: Trouble with modules

Aaron Wu (CHINA)

Message: 103489   


Have you tried to build it into the kernel? You may try this first to figure out where the problem happens, the module or the code of your driver.




2011-09-21 23:40:55     Re: Trouble with modules

Milind Paranjpe (UNITED STATES)

Message: 103491   


Hi Aaron,


I haven't tried building the simple_module example into the driver, but with my setup I have observed that any driver included in the kernel that runs successfully when compiled into the kernel causes undefined-symbols or a crash when compiled as a module and loaded with modprobe or insmod.  One such example is g_ether.  If I compile this driver into the kernel it runs fine, but if I build it as a module and try "modprobe g_ether" I get undefined-symbols or crash depending on whether modversions is on or off.


Other things I have tried without being able to resolve this issue since posting the message earlier today:


    U-boot version 2010R1 instead of trunk

    Recompile toolchain from the head of 2010R1 branch instead of using precompiled 2010R1-RC4 binaries

    Slow down SCLK to 100 MHz and increase the value of EBIU_SDRRC to slow down SDRAM access


My goal is to eventually run my custom driver, hopefully as a module.  If I can't resolve this issue, I can try compiling it into the kernel as that appears to work on my setup.








2011-09-22 12:14:03     Re: Trouble with modules

Milind Paranjpe (UNITED STATES)

Message: 103498   




I was able to resolve this problem by modifying my linux-kernel config to match that provided for the EZKIT-V2 board as much as possible.  The revised config is attached.  I'm not really sure which of the options is the culprit, but if/when I have more time, I'll go back to identifying it.


I actually also modified arch/blackfin/Kconfig to make sure CONFIG_MEM_MT48LC32M16A2TG_75 was set as that's the SDRAM on my board; but I don't think this made any difference because CONFIG_BFIN_KERNEL_CLOCK is not set, and this means I end up using the SDRAM and clock parameters that are programmed by U-boot.