From 75317a07787356337a93caa7ac7522f3a790987d Mon Sep 17 00:00:00 2001 From: The-going <48602507+The-going@users.noreply.github.com> Date: Sun, 7 Jul 2024 10:47:24 +0300 Subject: [PATCH] sunxi-6.1: Revert: handle entropy from atomic process context Revert 07b37f227c8daa27e68f57b1c691fab34a06731e commit For the sunxi (armhf) architecture, this commit results in an inability to load the kernel. It's actually a crutch that can break everything tomorrow. Therefore, freeze the kernel version for better times. --- ...ndle-entropy-from-atomic-process-con.patch | 52 +++++++++++++++++++ patch/kernel/archive/sunxi-6.1/series.armbian | 1 + patch/kernel/archive/sunxi-6.1/series.conf | 1 + 3 files changed, 54 insertions(+) create mode 100644 patch/kernel/archive/sunxi-6.1/patches.armbian/random-Revert-handle-entropy-from-atomic-process-con.patch diff --git a/patch/kernel/archive/sunxi-6.1/patches.armbian/random-Revert-handle-entropy-from-atomic-process-con.patch b/patch/kernel/archive/sunxi-6.1/patches.armbian/random-Revert-handle-entropy-from-atomic-process-con.patch new file mode 100644 index 000000000..93ab62cc8 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.1/patches.armbian/random-Revert-handle-entropy-from-atomic-process-con.patch @@ -0,0 +1,52 @@ +From 25ba88c95e844f900f5603890eaab8d19792a6a8 Mon Sep 17 00:00:00 2001 +From: The-going <48602507+The-going@users.noreply.github.com> +Date: Sun, 7 Jul 2024 10:39:48 +0300 +Subject: [PATCH] random: Revert: handle entropy from atomic process context + +Revert 07b37f227c8daa27e68f57b1c691fab34a06731e commit +For the sunxi architecture, this commit results in +an inability to load the kernel. It's actually a crutch +that can break everything tomorrow. +Therefore, freeze the kernel version for better times. +--- + drivers/char/random.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/char/random.c b/drivers/char/random.c +index fd57eb372..5d1c8e1c9 100644 +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -683,7 +683,7 @@ static void extract_entropy(void *buf, size_t len) + + static void __cold _credit_init_bits(size_t bits) + { +- static DECLARE_WORK(set_ready, crng_set_ready); ++ static struct execute_work set_ready; + unsigned int new, orig, add; + unsigned long flags; + +@@ -699,8 +699,8 @@ static void __cold _credit_init_bits(size_t bits) + + if (orig < POOL_READY_BITS && new >= POOL_READY_BITS) { + crng_reseed(); /* Sets crng_init to CRNG_READY under base_crng.lock. */ +- if (static_key_initialized && system_unbound_wq) +- queue_work(system_unbound_wq, &set_ready); ++ if (static_key_initialized) ++ execute_in_process_context(crng_set_ready, &set_ready); + wake_up_interruptible(&crng_init_wait); + kill_fasync(&fasync, SIGIO, POLL_IN); + pr_notice("crng init done\n"); +@@ -870,8 +870,8 @@ void __init random_init(void) + + /* + * If we were initialized by the cpu or bootloader before jump labels +- * or workqueues are initialized, then we should enable the static +- * branch here, where it's guaranteed that these have been initialized. ++ * are initialized, then we should enable the static branch here, where ++ * it's guaranteed that jump labels have been initialized. + */ + if (!static_branch_likely(&crng_is_ready) && crng_init >= CRNG_READY) + crng_set_ready(NULL); +-- +2.35.3 + diff --git a/patch/kernel/archive/sunxi-6.1/series.armbian b/patch/kernel/archive/sunxi-6.1/series.armbian index 004395d76..941e72a8b 100644 --- a/patch/kernel/archive/sunxi-6.1/series.armbian +++ b/patch/kernel/archive/sunxi-6.1/series.armbian @@ -190,3 +190,4 @@ patches.armbian/drivers-hack-for-h616-hdmi-video-output.patch patches.armbian/arm64-dts-h616-add-hdmi-support-for-zero2.patch patches.armbian/arm64-dts-sun50i-h616-Add-dma-node.patch + patches.armbian/random-Revert-handle-entropy-from-atomic-process-con.patch diff --git a/patch/kernel/archive/sunxi-6.1/series.conf b/patch/kernel/archive/sunxi-6.1/series.conf index d3bfefa28..02ba9751e 100644 --- a/patch/kernel/archive/sunxi-6.1/series.conf +++ b/patch/kernel/archive/sunxi-6.1/series.conf @@ -594,3 +594,4 @@ patches.armbian/drivers-hack-for-h616-hdmi-video-output.patch patches.armbian/arm64-dts-h616-add-hdmi-support-for-zero2.patch patches.armbian/arm64-dts-sun50i-h616-Add-dma-node.patch + patches.armbian/random-Revert-handle-entropy-from-atomic-process-con.patch