Kernel Entropy on i.MX8M Mini

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kernel Entropy on i.MX8M Mini

1,978 Views
david_ochs1
Contributor III

Hi,

We have a custom board that's based on the i.MX8M Mini EVK. I noticed that it takes a lot longer for the random number generator to initialize on our board vs the EVK. On the EVK, I get the message "random: crng init done" at about 7 seconds after bootup, but on our board it can take more than 10 minutes. I installed rng-tools and now our board is around the 7 second level too, so we have a workaround.

I'm curious, though, as to what could cause this. Both boards are headless and running a lightly modified version of linux-imx L4.14.98_2.0.0. They have similar accessories attached - same camera, same audio codec etc. Our changes to vs. the EVK were mostly to remove things: ethernet, audio codec, pcie interface, SD card interface to name a few.

Is there any possible straightforward answer to this, or does it really heavily depend on the hardware changes we made?

Thanks,

Dave

Labels (1)
0 Kudos
5 Replies

1,694 Views
b36401
NXP Employee
NXP Employee

Please note that rng-tools is software tool to perform random number generation.
And possibly it is quicker because it generates less quality random number.

Please tell us exact Part number of the processor for we can check if there is some issue with CAAM.

0 Kudos

1,694 Views
david_ochs1
Contributor III

MIMX8MM6DVTLZAA

0 Kudos

1,694 Views
b36401
NXP Employee
NXP Employee

They are asking for more details :
1. how are the random numbers been generated
2. Is CAAM being used to accelerate random number generator
3. Compare the kernel modules that are enabled in EVK vs your board.

0 Kudos

1,694 Views
david_ochs1
Contributor III

I didn't (intentionally) do anything to modify how random numbers are being generated vs. how it's done in the baseline linux-imx fsl-image-validation-imx image.

Here are the changes I made to the kernel config:

--- /home/daveo/baseline_bsp/baseline_bsp/tmp/work/imx8mmevk-poky-linux/linux-imx/4.14.98-r0/build/.config
+++ /home/daveo/yocto_praesidium_L4.14.98/praesidium_HW0_bsp/tmp/work/imx8mmevk-poky-linux/linux-imx/4.14.98-r0/build/.config
@@ -231,12 +231,13 @@
CONFIG_SLUB_CPU_PARTIAL=y
# CONFIG_SYSTEM_DATA_VERIFICATION is not set
CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
# CONFIG_STATIC_KEYS_SELFTEST is not set
-# CONFIG_UPROBES is not set
+CONFIG_UPROBES=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_KPROBES=y
@@ -1063,6 +1064,7 @@
# Network testing
#
# CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_DROP_MONITOR is not set
# CONFIG_HAMRADIO is not set
CONFIG_CAN=y
CONFIG_CAN_RAW=y
@@ -1221,7 +1223,9 @@
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
+CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
+CONFIG_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
@@ -2099,8 +2103,8 @@
CONFIG_BRCMFMAC_SDIO=y
# CONFIG_BRCMFMAC_USB is not set
CONFIG_BRCMFMAC_PCIE=y
-# CONFIG_BRCM_TRACING is not set
-# CONFIG_BRCMDBG is not set
+CONFIG_BRCM_TRACING=y
+CONFIG_BRCMDBG=y
CONFIG_WLAN_VENDOR_CISCO=y
CONFIG_WLAN_VENDOR_INTEL=y
# CONFIG_IPW2100 is not set
@@ -3337,6 +3341,7 @@
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX8973 is not set
# CONFIG_REGULATOR_MT6311 is not set
+CONFIG_REGULATOR_PF8X00=y
CONFIG_REGULATOR_PFUZE100=y
# CONFIG_REGULATOR_PV88060 is not set
# CONFIG_REGULATOR_PV88080 is not set
@@ -4304,7 +4309,7 @@
# CONFIG_SND_SOC_TFA9879 is not set
# CONFIG_SND_SOC_TLV320AIC23_I2C is not set
# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
-# CONFIG_SND_SOC_TLV320AIC31XX is not set
+CONFIG_SND_SOC_TLV320AIC31XX=y
# CONFIG_SND_SOC_TLV320AIC3X is not set
# CONFIG_SND_SOC_TS3A227E is not set
# CONFIG_SND_SOC_WM8510 is not set
@@ -4796,6 +4801,7 @@
#
# MXC Vivante GPU support
#
+# CONFIG_MXC_GPU_VIV is not set

#
# MXC HANTRO(Video Processing Unit) support
@@ -6388,6 +6394,7 @@
# CONFIG_PAGE_EXTENSION is not set
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_PAGE_POISONING is not set
+# CONFIG_DEBUG_PAGE_REF is not set
# CONFIG_DEBUG_RODATA_TEST is not set
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_DEBUG_ON is not set
@@ -6436,7 +6443,7 @@
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
# CONFIG_WW_MUTEX_SELFTEST is not set
-# CONFIG_STACKTRACE is not set
+CONFIG_STACKTRACE=y
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_HAVE_DEBUG_BUGVERBOSE=y
@@ -6463,14 +6470,41 @@
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
+CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACE_CLOCK=y
+CONFIG_RING_BUFFER=y
+CONFIG_EVENT_TRACING=y
+CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_TRACING=y
CONFIG_TRACING_SUPPORT=y
-# CONFIG_FTRACE is not set
+CONFIG_FTRACE=y
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_PREEMPT_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_HWLAT_TRACER is not set
+# CONFIG_ENABLE_DEFAULT_TRACERS is not set
+# CONFIG_FTRACE_SYSCALLS is not set
+# CONFIG_TRACER_SNAPSHOT is not set
+CONFIG_BRANCH_PROFILE_NONE=y
+# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
+# CONFIG_PROFILE_ALL_BRANCHES is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_UPROBE_EVENTS=y
+CONFIG_PROBE_EVENTS=y
+# CONFIG_HIST_TRIGGERS is not set
+# CONFIG_TRACEPOINT_BENCHMARK is not set
+# CONFIG_RING_BUFFER_BENCHMARK is not set
+# CONFIG_RING_BUFFER_STARTUP_TEST is not set
+# CONFIG_TRACE_EVAL_MAP_FILE is not set
+CONFIG_TRACING_EVENTS_GPIO=y
# CONFIG_DMA_API_DEBUG is not set

#
@@ -6741,7 +6775,7 @@
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m
CONFIG_CRYPTO_CHACHA20_NEON=m
CONFIG_CRYPTO_AES_ARM64_BS=m
-# CONFIG_BINARY_PRINTF is not set
+CONFIG_BINARY_PRINTF=y

#
# Library routines
@@ -6828,4 +6862,3 @@
CONFIG_ARCH_HAS_SG_CHAIN=y
CONFIG_SBITMAP=y
# CONFIG_STRING_SELFTEST is not set
-# CONFIG_MXC_GPU_VIV is not set

0 Kudos

1,691 Views
b36401
NXP Employee
NXP Employee

They have looked into the configuration differences you have sent and also tried to replicate in EVK with similar configuration.
However they did not see anything that would cause rng initialization delay.

They are asking to check boot log: where in the boot log does the delay occurs.
Are you sure that the delay is caused due to rng initialization or some other module?
Searching through the online forums it seems to be either related to not enough entropy generated for rng initialization or a partition detection issue by initramfs.

0 Kudos