From f62f13436118619dfd6db24bd0a75f7aef0ae144 Mon Sep 17 00:00:00 2001 From: xuzhenhai Date: Fri, 28 Jun 2024 15:49:07 +0800 Subject: [PATCH] call wait_for_random_bytes in kernel thread to speed up init boot process. Change-Id: I79966075664fbca0ec20193da403768c71f8a916 --- linux-5.10/rk3568_patch/kernel.patch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/linux-5.10/rk3568_patch/kernel.patch b/linux-5.10/rk3568_patch/kernel.patch index afd3e84..9ea5cc1 100755 --- a/linux-5.10/rk3568_patch/kernel.patch +++ b/linux-5.10/rk3568_patch/kernel.patch @@ -1800020,3 +1800020,31 @@ index 89a8bb8e2..70cd26e8b 100644 static int trace_panic_handler(struct notifier_block *this, unsigned long event, void *unused) { +diff --git a/drivers/char/mem.c b/drivers/char/mem.c +index 7d483c332..9b839d619 100644 +--- a/drivers/char/mem.c ++++ b/drivers/char/mem.c +@@ -1066,6 +1066,12 @@ static int devmem_init_inode(void) + return 0; + } + ++static int do_wait_for_random_bytes(void * data) ++{ ++ wait_for_random_bytes(); ++ return 0; ++} ++ + static int __init chr_dev_init(void) + { + int minor; +@@ -1094,6 +1100,11 @@ static int __init chr_dev_init(void) + NULL, devlist[minor].name); + } + ++ struct task_struct *thread; ++ thread = kthread_run(do_wait_for_random_bytes,NULL,"wait_for_random_bytes_thread"); ++ if (IS_ERR(thread)){ ++ printk("wait_for_random_bytes_thread thread create fail"); ++ } + return tty_init(); + } -- Gitee