This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: kernel crash when using new meta-ti

Part Number: AM625

Hello,

we updated meta-ti to current version.

Starting from commit ecd328fe22f6 ("optee-os: Enable OP-TEE TRNG in AM62X") kernel crashed giving this output:

[  OK  ] Listening on Load/Save RF …itch Status /dev/rfkill Watch.
[    9.634989] SError Interrupt on CPU1, code 0x00000000bf000002 -- SError
[    9.635021] CPU: 1 PID: 198 Comm: systemd-udevd Not tainted 6.1.46-6.5.0-devel+git.815effbfcba4 #1
[    9.635031] Hardware name: Toradex Verdin AM62 WB on Verdin Development Board (DT)
[    9.635038] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    9.635047] pc : devm_hwrng_register+0x0/0xa4 [rng_core]
[    9.635078] lr : omap_rng_probe+0x1dc/0x3d0 [omap_rng]
[    9.635098] sp : ffff800009a13900
[    9.635102] x29: ffff800009a13900 x28: 0000000000000000 x27: ffff800009a13c80
[    9.635117] x26: ffff800009a13c30 x25: ffff800009a13d88 x24: ffff00000685bf68
[    9.635126] x23: ffff000001164c00 x22: ffff000001164c10 x21: ffff00000205ce80
[    9.635135] x20: fffffffffffffffe x19: 00000000000001f3 x18: ffffffffffffffff
[    9.635144] x17: 000000000404004e x16: 0000000000000000 x15: ffff800089a137ad
[    9.635153] x14: ffffffffffffffff x13: 007473696c5f7974 x12: 0000000000000000
[    9.635162] x11: ffffffffffffffc0 x10: 0000000000000040 x9 : ffffffffffffffff
[    9.635170] x8 : 0000000000000228 x7 : 0000000000000001 x6 : 0000000000000001
[    9.635178] x5 : ffff0000068d78c8 x4 : ffff000001164e10 x3 : ffff00000695e100
[    9.635188] x2 : 0000000000000014 x1 : ffff00000205ce98 x0 : ffff000001164c10
[    9.635200] Kernel panic - not syncing: Asynchronous SError Interrupt
[    9.635207] CPU: 1 PID: 198 Comm: systemd-udevd Not tainted 6.1.46-6.5.0-devel+git.815effbfcba4 #1
[    9.635214] Hardware name: Toradex Verdin AM62 WB on Verdin Development Board (DT)
[    9.635218] Call trace:
[    9.635223]  dump_backtrace+0xd8/0x130
[    9.635247]  show_stack+0x18/0x30
[    9.635257]  dump_stack_lvl+0x68/0x84
[    9.635271]  dump_stack+0x18/0x34
[    9.635278]  panic+0x188/0x348
[    9.635288]  nmi_panic+0xac/0xb0
[    9.635301]  arm64_serror_panic+0x6c/0x7c
[    9.635309]  do_serror+0x58/0x5c
[    9.635314]  el1h_64_error_handler+0x30/0x4c
[    9.635325]  el1h_64_error+0x64/0x68
[    9.635331]  devm_hwrng_register+0x0/0xa4 [rng_core]
[    9.635348]  platform_probe+0x68/0xe0
[    9.635363]  really_probe+0xc0/0x3dc
[    9.635375]  __driver_probe_device+0x7c/0x160
[    9.635384]  driver_probe_device+0x3c/0x110
[    9.635392]  __driver_attach+0xf4/0x200
[    9.635401]  bus_for_each_dev+0x74/0xd4
[    9.635410]  driver_attach+0x24/0x30
[    9.635419]  bus_add_driver+0x17c/0x240
[    9.635428]  driver_register+0x78/0x130
[    9.635437]  __platform_driver_register+0x28/0x34
[    9.635444]  omap_rng_driver_init+0x20/0x1000 [omap_rng]
[    9.635459]  do_one_initcall+0x54/0x1d0
[    9.635465]  do_init_module+0x48/0x1d0
[    9.635480]  load_module+0x18e4/0x1e00
[    9.635489]  __do_sys_finit_module+0xb0/0x130
[    9.635497]  __arm64_sys_finit_module+0x20/0x30
[    9.635508]  invoke_syscall+0x48/0x114
[    9.635518]  el0_svc_common.constprop.0+0xd4/0xfc
[    9.635526]  do_el0_svc+0x30/0xd0
[    9.635534]  el0_svc+0x2c/0x84
[    9.635545]  el0t_64_sync_handler+0xbc/0x140
[    9.635553]  el0t_64_sync+0x18c/0x190
[    9.635565] SMP: stopping secondary CPUs
[    9.635590] Kernel Offset: disabled
[    9.635593] CPU features: 0x00000,00800084,0000420b
[    9.635601] Memory Limit: none
[    9.918961] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---

These are the relevant component versions:

- Linux kernel TI 09.01.00.006 (more specific: https://git.toradex.com/cgit/linux-toradex.git/commit/?h=toradex_ti-linux-6.1.y&id=815effbfcba4703306e083c19d976dd9714a475f)

- u-boot https://git.toradex.com/cgit/u-boot-toradex.git/log/?h=toradex_ti-u-boot-2023.04 (both 09.00.00.008 and 09.01.00.006)

What is the cause of this error? Can be it is related to a wrong dts?

Kind regards,

Emanuele

  • Hi Emanuele,

    Our Yocto expert is travelling. Please expect delayed response.

  • Could this just be because now you are reserving the RNG to the OPTEE therefore trying to use the RNG from Linux will just crash the system? How can we use the RNG from Linux given this change you did?

    In our DTS to be able to use the HW RNG we have the following:

    	crypto: crypto@40900000 {
    		compatible = "ti,am62-sa3ul";
    		reg = <0x00 0x40900000 0x00 0x1200>;
    		#address-cells = <2>;
    		#size-cells = <2>;
    		ranges = <0x00 0x40900000 0x00 0x40900000 0x00 0x30000>;
    
    		dmas = <&main_pktdma 0xf501 0>, <&main_pktdma 0x7506 0>,
    		       <&main_pktdma 0x7507 0>;
    		dma-names = "tx", "rx1", "rx2";
    
    		rng: rng@40910000 {
    			compatible = "inside-secure,safexcel-eip76";
    			reg = <0x00 0x40910000 0x00 0x7d>;
    			interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>;
    		};
    	};
    

    Should we use `HW_RANDOM_OPTEE`? Is this tested working?

  • I can confirm that using optee rng solves the issue.