Xavier ethernet phy driver problem

We use dp83867 as ethernet phy for our custom board.
So I compile dp83867 driver as a kernel module.
After I compile the kernel, I get the dp833867.ko. And when I insmod it on Xavier, there are many errors as follow:

[11902.009976] dp83867: loading out-of-tree module taints kernel.
[11902.010678] dp83867: disagrees about version of symbol phy_write_mmd_indirect
[11902.010854] dp83867: Unknown symbol phy_write_mmd_indirect (err -22)
[11902.010990] dp83867: disagrees about version of symbol phy_read_mmd_indirect
[11902.011132] dp83867: Unknown symbol phy_read_mmd_indirect (err -22)
[11902.011263] dp83867: disagrees about version of symbol phy_drivers_unregister
[11902.011414] dp83867: Unknown symbol phy_drivers_unregister (err -22)
[11902.011601] dp83867: disagrees about version of symbol genphy_resume
[11902.011734] dp83867: Unknown symbol genphy_resume (err -22)
[11902.011857] dp83867: disagrees about version of symbol genphy_config_aneg
[11902.011990] dp83867: Unknown symbol genphy_config_aneg (err -22)
[11902.012115] dp83867: disagrees about version of symbol mdiobus_read
[11902.012241] dp83867: Unknown symbol mdiobus_read (err -22)
[11902.012527] dp83867: disagrees about version of symbol mdiobus_write
[11902.013009] dp83867: Unknown symbol mdiobus_write (err -22)
[11902.013986] dp83867: disagrees about version of symbol phy_drivers_register
[11902.021104] dp83867: Unknown symbol phy_drivers_register (err -22)
[11902.027112] dp83867: disagrees about version of symbol genphy_read_status
[11902.033669] dp83867: Unknown symbol genphy_read_status (err -22)
[11902.039846] dp83867: disagrees about version of symbol genphy_suspend
[11902.045885] dp83867: Unknown symbol genphy_suspend (err -22)
insmod: ERROR: could not insert module dp83867.ko: Invalid parameters

I used these commands to check file property:

nvidia@ubuntu:~/dp83867$ file dp83867.ko 
dp83867.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=90ea59e0829b36939b2f54fe8b08d9344eef70c9, with debug_info, not stripped

module info:

nvidia@ubuntu:~/dp83867$ modinfo dp83867.ko
filename:       /home/nvidia/dp83867/dp83867.ko
license:        GPL
author:         Dan Murphy <dmurphy@ti.com
description:    Texas Instruments DP83867 PHY driver
alias:          mdio:0010000000000000101000100011????
depends:        
vermagic:       4.9.140-tegra SMP preempt mod_unload modversions aarch64

uname:

nvidia@ubuntu:~/dp83867$ uname -r
4.9.140-tegra

next I copy the dp83867.c in kernel to other folder and compile it as module, but same error.

then I config the dp83867 as obj-y, and compile the kernel and flash the whole kernel into the board. But when system boot up, I can’t find the driver in /lib/modules/module/4.9.140-tegra/modules.builtin

@kayccc

Hi,

Could you follow our L4T document to build kernel modules? Especially the installation part.
Also, is your source code from our public code tarball?

Hi,
I have followed the document to build whole kernel and then I get the kernel module in TEGRA_KERNEL_OUT folder.
you said the installtion part, which means I can’t copy the .ko file to xavier and I must install the modules into the rootfs and flash whole file system into the xavier?
I download the newest kernel source 32.3.1 and JetPack_4.3_Linux_P2888.

No, just want to make sure you installed all the files needed. The path no need to be only rootfs.

$ sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install
INSTALL_MOD_PATH=/Linux_for_Tegra/rootfs/

Why do you use insmod? Have you tried modprobe? Is there any dependencies needed for this module?

hi,
I don’t find any dependencies about this module from modinfo of my first post.
I tried modprobe, same error.
Now I compile it on xavier devkit itself and it works. So it is really a cross-compile problem.
Next I will try to install the modules into rootfs and reflash xavier.

What toolchian are you using for cross-compile?

Hi WayneWWW,
Thank you for prompt reply.
The cross-compile version I used is:

gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu

I try to install the modules into rootfs and reflash xavier. And it works.
But I only copy the .ko file into xavier and insmod, the error come out

I think modules_install is needed here. Could you confirm? It seems just copy the .ko file may not be sufficient.

For now, it seems so. I will try it several times and I will try some other modules to confirm it.

hi WayneWWW,

In my last post, I said:

hi,
I don’t find any dependencies about this module from modinfo of my first post.
I tried modprobe, same error.
Now I compile it on xavier devkit itself and it works. So it is really a cross-compile problem.
Next I will try to install the modules into rootfs and reflash xavier.

It’s my mistake that the kernel image is the obj-y image, in fact it doesn’t work.

I test this problem several times, and results:

  1. copy dp83867.c to other folder and cross-compile it as a kernel module. copy .ko to xavier
    same error when insmod.
  2. config dp83867 by ‘make menuconfig’ to obj-m and cross-compile the whole kernel. copy .ko to xavier.
    same error when insmod.
  3. config dp83867 by ‘make menuconfig’ to obj-m and cross-compile the whole kernel. I install all modules into the rootfs and reflash xavier.
    same error when modprobe
  4. config dp83867 by ‘make menuconfig’ to obj-y and cross-compile the whole kernel. I replace the image file in Linux_for_Tegra/kernel. and I reflash the xavier.
    It works fine when system boot up.
  5. copy dp83867.c to xavier and compile it as a kernel module.
    It works fine when insmod.

And I test a module I made, it is works fine. It is not all modules which have these errors.

In the third test, there are other errors in kernel log. It seems that other modules have same errors.

[    2.967901] x_tables: disagrees about version of symbol seq_open_net
[    2.967909] x_tables: Unknown symbol seq_open_net (err -22)
[    2.967935] x_tables: disagrees about version of symbol register_pernet_subsys
[    2.967938] x_tables: Unknown symbol register_pernet_subsys (err -22)
[    2.967959] x_tables: disagrees about version of symbol init_net
[    2.967962] x_tables: Unknown symbol init_net (err -22)
[    2.967967] x_tables: disagrees about version of symbol seq_release_net
[    2.967970] x_tables: Unknown symbol seq_release_net (err -22)
[    2.967995] x_tables: disagrees about version of symbol unregister_pernet_subsys
[    2.967999] x_tables: Unknown symbol unregister_pernet_subsys (err -22)
[    2.968022] x_tables: disagrees about version of symbol audit_log_start
[    2.968025] x_tables: Unknown symbol audit_log_start (err -22)
[    3.222665] bluedroid_pm: disagrees about version of symbol kobject_uevent_env
[    3.222674] bluedroid_pm: Unknown symbol kobject_uevent_env (err -22)
[    3.625091] nvgpu: disagrees about version of symbol dev_warn
[    3.625107] nvgpu: Unknown symbol dev_warn (err -22)
[    3.625561] nvgpu: disagrees about version of symbol __dynamic_dev_dbg
[    3.625567] nvgpu: Unknown symbol __dynamic_dev_dbg (err -22)
[    3.625619] nvgpu: disagrees about version of symbol wake_up_process
[    3.625623] nvgpu: Unknown symbol wake_up_process (err -22)
[    3.625633] nvgpu: disagrees about version of symbol device_show_int
[    3.625636] nvgpu: Unknown symbol device_show_int (err -22)
[    3.625899] nvgpu: disagrees about version of symbol device_create_file
[    3.625905] nvgpu: Unknown symbol device_create_file (err -22)
[    3.625969] nvgpu: disagrees about version of symbol perf_trace_run_bpf_submit
[    3.625972] nvgpu: Unknown symbol perf_trace_run_bpf_submit (err -22)
[    3.626076] nvgpu: disagrees about version of symbol device_create
[    3.626080] nvgpu: Unknown symbol device_create (err -22)
[    3.626267] nvgpu: disagrees about version of symbol dev_err
[    3.626270] nvgpu: Unknown symbol dev_err (err -22)
[    3.626508] nvgpu: disagrees about version of symbol device_destroy
[    3.626512] nvgpu: Unknown symbol device_destroy (err -22)
[    3.626659] nvgpu: disagrees about version of symbol device_remove_file
[    3.626662] nvgpu: Unknown symbol device_remove_file (err -22)
[    3.978196] nvgpu: disagrees about version of symbol dev_warn
[    3.978346] nvgpu: Unknown symbol dev_warn (err -22)
[    3.978793] nvgpu: disagrees about version of symbol __dynamic_dev_dbg
[    3.978910] nvgpu: Unknown symbol __dynamic_dev_dbg (err -22)
[    3.979072] nvgpu: disagrees about version of symbol wake_up_process
[    3.979187] nvgpu: Unknown symbol wake_up_process (err -22)
[    3.979296] nvgpu: disagrees about version of symbol device_show_int
[    3.979411] nvgpu: Unknown symbol device_show_int (err -22)
[    3.980857] nvgpu: disagrees about version of symbol device_create_file
[    3.981006] nvgpu: Unknown symbol device_create_file (err -22)
[    3.981192] nvgpu: disagrees about version of symbol perf_trace_run_bpf_submit
[    3.981333] nvgpu: Unknown symbol perf_trace_run_bpf_submit (err -22)
[    3.982378] nvgpu: disagrees about version of symbol device_create
[    3.982501] nvgpu: Unknown symbol device_create (err -22)
[    3.982816] nvgpu: disagrees about version of symbol dev_err
[    3.982928] nvgpu: Unknown symbol dev_err (err -22)
[    3.983274] nvgpu: disagrees about version of symbol device_destroy
[    3.988946] nvgpu: Unknown symbol device_destroy (err -22)
[    3.989003] spidev: disagrees about version of symbol get_device
[    3.989008] spidev: Unknown symbol get_device (err -22)
[    3.989017] spidev: disagrees about version of symbol __dynamic_dev_dbg
[    3.989019] spidev: Unknown symbol __dynamic_dev_dbg (err -22)
[    3.989038] spidev: disagrees about version of symbol put_device
[    3.989041] spidev: Unknown symbol put_device (err -22)
[    3.989073] spidev: disagrees about version of symbol device_create
[    3.989076] spidev: Unknown symbol device_create (err -22)
[    3.989098] spidev: disagrees about version of symbol dev_err
[    3.989100] spidev: Unknown symbol dev_err (err -22)
[    3.989124] spidev: disagrees about version of symbol device_destroy
[    3.989126] spidev: Unknown symbol device_destroy (err -22)
[    4.009736] nvgpu: disagrees about version of symbol device_remove_file
[    4.009742] nvgpu: Unknown symbol device_remove_file (err -22)
[    4.045477] spidev: disagrees about version of symbol get_device
[    4.045482] spidev: Unknown symbol get_device (err -22)
[    4.045486] spidev: disagrees about version of symbol __dynamic_dev_dbg
[    4.045488] spidev: Unknown symbol __dynamic_dev_dbg (err -22)
[    4.045504] spidev: disagrees about version of symbol put_device
[    4.045506] spidev: Unknown symbol put_device (err -22)
[    4.045522] spidev: disagrees about version of symbol device_create
[    4.045524] spidev: Unknown symbol device_create (err -22)
[    4.045543] spidev: disagrees about version of symbol dev_err
[    4.045545] spidev: Unknown symbol dev_err (err -22)
[    4.045566] spidev: disagrees about version of symbol device_destroy
[    4.045568] spidev: Unknown symbol device_destroy (err -22)
[    4.158364] spidev: disagrees about version of symbol get_device
[    4.161936] spidev: Unknown symbol get_device (err -22)
[    4.165833] tegra_udrm: disagrees about version of symbol dev_warn
[    4.165839] tegra_udrm: Unknown symbol dev_warn (err -22)
[    4.178689] spidev: disagrees about version of symbol __dynamic_dev_dbg
[    4.194557] spidev: Unknown symbol __dynamic_dev_dbg (err -22)
[    4.194717] spidev: disagrees about version of symbol put_device
[    4.197056] spidev: Unknown symbol put_device (err -22)
[    4.202668] spidev: disagrees about version of symbol device_create
[    4.208487] spidev: Unknown symbol device_create (err -22)
[    4.208529] spidev: disagrees about version of symbol dev_err
[    4.208532] spidev: Unknown symbol dev_err (err -22)
[    4.208573] spidev: disagrees about version of symbol device_destroy
[    4.208575] spidev: Unknown symbol device_destroy (err -22)
[  160.339902] bluedroid_pm: disagrees about version of symbol kobject_uevent_env
[  160.340056] bluedroid_pm: Unknown symbol kobject_uevent_env (err -22)
[  160.359937] overlay: disagrees about version of symbol revert_creds
[  160.360078] overlay: Unknown symbol revert_creds (err -22)
[  160.360188] overlay: disagrees about version of symbol vfs_rename
[  160.360292] overlay: Unknown symbol vfs_rename (err -22)
[  160.360393] overlay: disagrees about version of symbol lookup_one_len
[  160.360501] overlay: Unknown symbol lookup_one_len (err -22)
[  160.360625] overlay: disagrees about version of symbol generic_readlink
[  160.360738] overlay: Unknown symbol generic_readlink (err -22)
[  160.360848] overlay: disagrees about version of symbol generic_permission
[  160.360960] overlay: Unknown symbol generic_permission (err -22)
[  160.361087] overlay: disagrees about version of symbol vfs_unlink
[  160.361190] overlay: Unknown symbol vfs_unlink (err -22)
[  160.361498] overlay: disagrees about version of symbol path_put
[  160.361951] overlay: Unknown symbol path_put (err -22)
[  160.362362] overlay: disagrees about version of symbol __put_cred
[  160.362819] overlay: Unknown symbol __put_cred (err -22)
[  160.365096] overlay: disagrees about version of symbol vfs_mkdir
[  160.370518] overlay: Unknown symbol vfs_mkdir (err -22)
[  160.370565] overlay: disagrees about version of symbol __check_sticky
[  160.370568] overlay: Unknown symbol __check_sticky (err -22)
[  160.370587] overlay: disagrees about version of symbol prepare_creds
[  160.370589] overlay: Unknown symbol prepare_creds (err -22)
[  160.370601] overlay: disagrees about version of symbol vfs_get_link
[  160.370603] overlay: Unknown symbol vfs_get_link (err -22)
[  160.370615] overlay: disagrees about version of symbol vfs_whiteout
[  160.370617] overlay: Unknown symbol vfs_whiteout (err -22)
[  160.370624] overlay: disagrees about version of symbol lock_rename
[  160.370626] overlay: Unknown symbol lock_rename (err -22)
[  160.370643] overlay: disagrees about version of symbol kern_path
[  160.370645] overlay: Unknown symbol kern_path (err -22)
[  160.370654] overlay: disagrees about version of symbol unlock_rename
[  160.370656] overlay: Unknown symbol unlock_rename (err -22)
[  160.370659] overlay: disagrees about version of symbol vfs_rmdir
[  160.370661] overlay: Unknown symbol vfs_rmdir (err -22)
[  160.370672] overlay: disagrees about version of symbol override_creds
[  160.370674] overlay: Unknown symbol override_creds (err -22)
[  160.370682] overlay: disagrees about version of symbol vfs_symlink
[  160.370684] overlay: Unknown symbol vfs_symlink (err -22)
[  160.370782] overlay: disagrees about version of symbol vfs_mknod
[  160.370789] overlay: Unknown symbol vfs_mknod (err -22)
[  160.370817] overlay: disagrees about version of symbol lookup_one_len_unlocked
[  160.370819] overlay: Unknown symbol lookup_one_len_unlocked (err -22)
[  160.370831] overlay: disagrees about version of symbol vfs_link
[  160.370833] overlay: Unknown symbol vfs_link (err -22)
[  160.370843] overlay: disagrees about version of symbol inode_permission
[  160.370845] overlay: Unknown symbol inode_permission (err -22)
[  160.370858] overlay: disagrees about version of symbol vfs_create
[  160.370860] overlay: Unknown symbol vfs_create (err -22)
[  160.408613] nvgpu: disagrees about version of symbol dev_warn
[  160.408620] nvgpu: Unknown symbol dev_warn (err -22)
[  160.408969] nvgpu: disagrees about version of symbol __dynamic_dev_dbg
[  160.408971] nvgpu: Unknown symbol __dynamic_dev_dbg (err -22)
[  160.409026] nvgpu: disagrees about version of symbol wake_up_process
[  160.409028] nvgpu: Unknown symbol wake_up_process (err -22)
[  160.409037] nvgpu: disagrees about version of symbol device_show_int
[  160.409039] nvgpu: Unknown symbol device_show_int (err -22)
[  160.409311] nvgpu: disagrees about version of symbol device_create_file
[  160.409313] nvgpu: Unknown symbol device_create_file (err -22)
[  160.409378] nvgpu: disagrees about version of symbol perf_trace_run_bpf_submit
[  160.409380] nvgpu: Unknown symbol perf_trace_run_bpf_submit (err -22)
[  160.409485] nvgpu: disagrees about version of symbol device_create
[  160.409487] nvgpu: Unknown symbol device_create (err -22)
[  160.409683] nvgpu: disagrees about version of symbol dev_err
[  160.409685] nvgpu: Unknown symbol dev_err (err -22)
[  160.409952] nvgpu: disagrees about version of symbol device_destroy
[  160.409956] nvgpu: Unknown symbol device_destroy (err -22)
[  160.410100] nvgpu: disagrees about version of symbol device_remove_file
[  160.410102] nvgpu: Unknown symbol device_remove_file (err -22)
[  166.806918] zram: disagrees about version of symbol crypto_alloc_base
[  166.807068] zram: Unknown symbol crypto_alloc_base (err -22)
[  166.807226] zram: disagrees about version of symbol crypto_destroy_tfm
[  166.807347] zram: Unknown symbol crypto_destroy_tfm (err -22)
[  292.158236] dp83867: disagrees about version of symbol phy_write_mmd_indirect
[  292.158404] dp83867: Unknown symbol phy_write_mmd_indirect (err -22)
[  292.158515] dp83867: disagrees about version of symbol phy_read_mmd_indirect
[  292.158635] dp83867: Unknown symbol phy_read_mmd_indirect (err -22)
[  292.158739] dp83867: disagrees about version of symbol phy_drivers_unregister
[  292.158859] dp83867: Unknown symbol phy_drivers_unregister (err -22)
[  292.158971] dp83867: disagrees about version of symbol genphy_resume
[  292.159079] dp83867: Unknown symbol genphy_resume (err -22)
[  292.159174] dp83867: disagrees about version of symbol genphy_config_aneg
[  292.159286] dp83867: Unknown symbol genphy_config_aneg (err -22)
[  292.159385] dp83867: disagrees about version of symbol mdiobus_read
[  292.159735] dp83867: Unknown symbol mdiobus_read (err -22)
[  292.160179] dp83867: disagrees about version of symbol mdiobus_write
[  292.160647] dp83867: Unknown symbol mdiobus_write (err -22)
[  292.161069] dp83867: disagrees about version of symbol phy_drivers_register
[  292.163423] dp83867: Unknown symbol phy_drivers_register (err -22)
[  292.170132] dp83867: disagrees about version of symbol genphy_read_status
[  292.176371] dp83867: Unknown symbol genphy_read_status (err -22)
[  292.181913] dp83867: disagrees about version of symbol genphy_suspend
[  292.181924] dp83867: Unknown symbol genphy_suspend (err -22)
[  792.202660] dp83867: disagrees about version of symbol phy_write_mmd_indirect
[  792.202826] dp83867: Unknown symbol phy_write_mmd_indirect (err -22)
[  792.202937] dp83867: disagrees about version of symbol phy_read_mmd_indirect
[  792.203056] dp83867: Unknown symbol phy_read_mmd_indirect (err -22)
[  792.203163] dp83867: disagrees about version of symbol phy_drivers_unregister
[  792.203293] dp83867: Unknown symbol phy_drivers_unregister (err -22)
[  792.203407] dp83867: disagrees about version of symbol genphy_resume
[  792.203519] dp83867: Unknown symbol genphy_resume (err -22)
[  792.203734] dp83867: disagrees about version of symbol genphy_config_aneg
[  792.203907] dp83867: Unknown symbol genphy_config_aneg (err -22)
[  792.204028] dp83867: disagrees about version of symbol mdiobus_read
[  792.204169] dp83867: Unknown symbol mdiobus_read (err -22)
[  792.204555] dp83867: disagrees about version of symbol mdiobus_write
[  792.205050] dp83867: Unknown symbol mdiobus_write (err -22)
[  792.205477] dp83867: disagrees about version of symbol phy_drivers_register
[  792.208075] dp83867: Unknown symbol phy_drivers_register (err -22)
[  792.214177] dp83867: disagrees about version of symbol genphy_read_status
[  792.220447] dp83867: Unknown symbol genphy_read_status (err -22)
[  792.226315] dp83867: disagrees about version of symbol genphy_suspend
[  792.232930] dp83867: Unknown symbol genphy_suspend (err -22)


I wonder “menuconfig” is the cause of test 3. AFAIK, we don’t use menuconfig when building kernel image/modules. Instead, we use this file- tegra_defconfig to configure the -y/-m/-n.

It seems you need to build the whole kernel image again to prevent the error when make menuconfig is in use.

I just want to test different ways to get the module and check if it works OK.
I do use tegra_defconfig. My whole command is:

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
make ARCH=arm64 O=$TEGRA_KERNEL_OUT menuconfig
make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j8

menuconfig is a graphical configuration tool, not board_defconfig.

Hi WayneWWW,

I found this problem maybe the aarch64-linux-gnu version problem.
The aarch64-linux-gnu version is 7.4.0 while the cross-compile aarch64-linux-gnu version is 7.3.1.
So I must compile the module on xavier.
If I want to cross-compile module, I must cross-compile whole kernel with 7.3.1 and flash the xavier.

I am pretty sure it is the key issue, but I need further test .
Correct me if I am wrong.

I am not sure.
Actually, I suspect the menuconfig. I understand this is a linux graphical tool for configuration kernel config. But the tegra_defconfig already put everything needed inside it. Don’t know why you have to run menuconfig again.

The error log you pasted just pointed this out. It seems when you run menuconfig, you affect other modules as well but not just only the dp83867.

In the third test, there are other errors in kernel log. It seems that other modules have same errors.

I just wonder did you also hit this error from x_tables, bluedroid_pm and nvgpu in test4?

I need further test about test 3 and 4. Beacuse I found a serious problem which have an effect on it: the system time.

when I reflash the SOM on our custom board and config it, the system time become the default time, maybe 2018.
But I cross-compile kernel and modules time is 2020, so when system bootup the new time module does’t work and the system maybe crash. So I am working on test 3 and 4.

Why the system time would be 2018 when your reflash your board? Didn’t you configure your timezone in first boot?

I don’t think you should care about the system time is whether 2018 or 2020…

Yes, you are right. I found the time doesn’t matter on devkit. Maybe this is new problem on our board. It is strange.

I will test several time on our custom board.

Hi WayneWWW,

You are right. The system time and gcc version doesn’t matter.
The kernel image and module is the key issue after menuconfig.
In my all test above, I just install modules or just replace the kernel image, which will make many strange phenomena. So every time I thought I found the truth, I am still lost in the hole.

Every time I cross-compile the kernel source, I must replace the kernel image and install modules at the same time. The system will work normally and the cross-compile modules can work fine.

I use menuconfig to config dp83867 driver to kernel or module, beacuse our custom board use dp83867 and the default kernel doesn’t include this driver. But the eth0 doesn’t work. So I want to add some debug infomation in driver and I cross-compile it. I just compile it on xavier to debug dp83867 these days. Now I can cross-compile it on my host.

Thank you for all.