yocto beaglebone play can't load modules

Hi,

I’m trying to get yocto/poky kirkstone to run on a beagleplay. I got a system that allows me to work with a serial console. But then any attempt at loading modules fails spectacularly with something like this:

root@beagleplay:~# modprobe libcomposite
modprobe: ERROR: could not insert 'libcomposite': Cannot allocat[  673.565012] vmap allocation for size 65536 failed: use vmalloc=<size> to increase size
[  673.565037] modprobe: vmalloc error: size 61440, vm_struct allocation failed, mode:0xcc0(GFP_KERNEL), nodemask=(null),cpuset=/,mems_allowed=0
e memory
[  673.565076] CPU: 0 PID: 493 Comm: modprobe Not tainted 6.1.46-rt13-g999 #1
[  673.565084] Hardware name:  , BIOS 2021.01-gb248392d 01/04/2023
[  673.565089] Call trace:
[  673.565094]  dump_backtrace.part.0+0xdc/0xf0
[  673.565117]  show_stack+0x18/0x30
[  673.565126]  dump_stack_lvl+0x68/0x84
[  673.565136]  dump_stack+0x18/0x34
[  673.565143]  warn_alloc+0x10c/0x1a4
[  673.565154]  __vmalloc_node_range+0x590/0x6e0
[  673.565161]  module_alloc+0xec/0x100
[  673.565175]  load_module+0xa08/0x1c60
[  673.565183]  __do_sys_finit_module+0xa8/0x100
[  673.565189]  __arm64_sys_finit_module+0x20/0x30
[  673.565196]  invoke_syscall+0x48/0x114
[  673.565204]  el0_svc_common.constprop.0+0x44/0xfc
[  673.565212]  do_el0_svc+0x30/0xd0
[  673.565219]  el0_svc+0x2c/0x84
[  673.565226]  el0t_64_sync_handler+0xbc/0x140
[  673.565234]  el0t_64_sync+0x18c/0x190
[  673.565242] Mem-Info:
[  673.565247] active_anon:24 inactive_anon:856 isolated_anon:0
[  673.565247]  active_file:3485 inactive_file:2335 isolated_file:0
[  673.565247]  unevictable:0 dirty:0 writeback:0
[  673.565247]  slab_reclaimable:2010 slab_unreclaimable:3404
[  673.565247]  mapped:1236 shmem:52 pagetables:80
[  673.565247]  sec_pagetables:0 bounce:0
[  673.565247]  kernel_misc_reclaimable:0
[  673.565247]  free:478677 free_pcp:1228 free_cma:7825
root@beagleplay:~# [  673.565264] Node 0 active_anon:96kB inactive_anon:3424kB active_file:13940kB inactive_file:9340kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:4944kB dirty:0kB writeback:0kB shmem:208kB writeback_tmp:0kB kernel_stack:1888kB pagetables:320kB sec_pagetables:0kB all_unreclaimable? no
[  673.565280] DMA free:1914708kB boost:0kB min:5624kB low:7600kB high:9576kB reserved_highatomic:0KB active_anon:96kB inactive_anon:3424kB active_file:13940kB inactive_file:9340kB unevictable:0kB writepending:0kB present:2097152kB managed:1980556kB mlocked:0kB bounce:0kB free_pcp:4912kB local_pcp:1564kB free_cma:31300kB
[  673.565295] lowmem_reserve[]: 0 0 0 0
[  673.565305] DMA: 195*4kB (UMEC) 71*8kB (UEC) 47*16kB (UMEC) 23*32kB (UMEC) 7*64kB (UC) 9*128kB (UMEC) 8*256kB (UMC) 5*512kB (UME) 1*1024kB (M) 4*2048kB (UMEC) 463*4096kB (MC) = 1914708kB
[  673.565357] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[  673.565362] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=32768kB
[  673.565367] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[  673.565372] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB
[  673.565377] 5874 total pagecache pages
[  673.565379] 0 pages in swap cache
[  673.565382] Free swap  = 0kB
[  673.565384] Total swap = 0kB
[  673.565386] 524288 pages RAM
[  673.565388] 0 pages HighMem/MovableOnly
[  673.565390] 29149 pages reserved
[  673.565393] 8192 pages cma reserved
[  673.565395] 0 pages hwpoisoned

Any suggestions as to what’s going on are very welcome.

Source your build, then.

$bitbake-layers show-layers

Also make sure you have checked out the correct branches for the meta-layers.

The kernel modules must be compiled with the same kernel version that the board boots with.

layer                 path                                      priority
==========================================================================
meta                  yocto/layers/modules/poky/meta  5
meta-poky             yocto/layers/modules/poky/meta-poky  5
meta-yocto-bsp        yocto/layers/modules/poky/meta-yocto-bsp  5
meta-arm-toolchain    yocto/layers/modules/meta-arm/meta-arm-toolchain  5
meta-arm              yocto/layers/modules/meta-arm/meta-arm  5
meta-ti-bsp           yocto/layers/modules/meta-ti/meta-ti-bsp  6
meta-ti-extras        yocto/layers/modules/meta-ti/meta-ti-extras  6
meta-bela             yocto/layers/meta-customer  6
workspace             yocto/layers/modules/poky/build/workspace  99

All are on kirkstone.

Now what I haven’t mentioned explicitly: I was using linux-ti-staging. Because my customer had used those via Debian/ti-linux-kernel-dev. However this morning I decided to try & revert to linux-bb.org (5.10.162+) and that’s working. Still interested in understanding why the staging kernel works on Debian but not yocto.

Big difference when you are on the top looking down versus on the bottom looking up and guessing what is going on.

Is your MACHINE=“beagleplay” or did you use a custom?

I found our board and built an image after reading your post and used beagleplay with systemd and could not get the weston compositor up. Pretty sure we had it running on that board before, it might be something simple. Maybe when the snow flies this winter…

1 Like

I am using busybox (just because that was the poky default it appeared), if that makes a difference. And yes, I used beagleplay as machine. It is to be honest a bit confusing to me, the build process prints out the usual prefix twice, once for beagleplay, and then for beagleplay-k3r5

Loading cache: 100% |################################################################################################################################################################################################################################################################################################################################################################| Time: 0:00:00
Loaded 3688 entries from dependency cache.
Parsing recipes: 100% |##############################################################################################################################################################################################################################################################################################################################################################| Time: 0:00:01
Parsing of 2068 .bb files complete (2064 cached, 4 parsed). 3690 targets, 317 skipped, 0 masked, 0 errors.
Removing 1 recipes from the beagleplay sysroot: 100% |###############################################################################################################################################################################################################################################################################################################################| Time: 0:00:00
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies

Build Configuration (mc:default):
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "beagleplay"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.12"
TUNE_FEATURES        = "aarch64"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "kirkstone:5d822b31316663c838c5864ab68b28fb3ca41351"
meta-arm-toolchain   
meta-arm             = "kirkstone:b187fb9232ca0a6b5f8f90b4715958546fc41d73"
meta-ti-bsp          
meta-ti-extras       = "kirkstone:c3916324a01fe96c68a78ef9ed0070d6b1fc8f2f"
meta-bela            = "main:d4725bb510a502c4a9cb3bdb8e3c557f233128a7"
workspace            = "kirkstone:5d822b31316663c838c5864ab68b28fb3ca41351"


Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "beagleplay-k3r5"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.12"
TUNE_FEATURES        = "arm armv7a vfp thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "kirkstone:5d822b31316663c838c5864ab68b28fb3ca41351"
meta-arm-toolchain   
meta-arm             = "kirkstone:b187fb9232ca0a6b5f8f90b4715958546fc41d73"
meta-ti-bsp          
meta-ti-extras       = "kirkstone:c3916324a01fe96c68a78ef9ed0070d6b1fc8f2f"
meta-bela            = "main:d4725bb510a502c4a9cb3bdb8e3c557f233128a7"
workspace            = "kirkstone:5d822b31316663c838c5864ab68b28fb3ca41351"

Initialising tasks: 100% |###########################################################################################################################################################################################################################################################################################################################################################| Time: 0:00:04
NOTE: Deferring mc:k3r5:/home/deets/projects/freelance/bela.io/yocto/layers/modules/meta-ti/meta-ti-bsp/recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb:do_populate_lic after /home/deets/projects/freelance/bela.io/yocto/layers/modules/meta-ti/meta-ti-bsp/recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb:do_populate_lic

Try,

In your sourced build

$bitbake-layers remove-layer meta-bela

See what happens.

The meta-bela doesn’t really contain anything significant beyond adding a custom image with some installed packages. So it shouldn’t have any significant impact, or so I thought…

Turns out I need to build core-image-base, and then I get modules, and I can load them. I’ll have to pour over the contents of meta-bela to see what’s causing the issue here.

So I can now load modules. I can’t use eth0 unfortunately, even though it is plugged in, ethtool will say

Settings for eth0:
        Supported ports: [ TP    AUI     MII     FIBRE   BNC     Backplane ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                1000baseKX/Full
                                1000baseX/Full
                                100baseT1/Full
                                1000baseT1/Full
                                100baseFX/Half 100baseFX/Full
                                10baseT1L/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Half
        Auto-negotiation: off
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x000020f7 (8439)
                               drv probe link ifdown ifup rx_err tx_err hw
        Link detected: no

In dmesg I find

[    3.066655] davinci_mdio 8000000.ethernet:mdio@f00: Configuring MDIO in manual mode
[    3.074376] davinci_mdio: probe of 8000000.ethernet:mdio@f00 failed with error -22

But I presume that is for another post?

Might be some config file is missing, sometimes this gets so involved. That meta-bela might have your missing config files, just a guess.

Also, might add in some networking tools so you can poke around and see what is up and running.

Another thought, might look at building the AM62 evm out of ti-bsp. Believe the networking was up on that one. If it does work that might have some additional clues.