| From 051c086439db9f38120dbbbe66bb59e8cd10ec22 Mon Sep 17 00:00:00 2001 |
| From: "song.han" <song.han@amlogic.com> |
| Date: Wed, 23 Feb 2022 14:20:28 +0800 |
| Subject: [PATCH] boottime: reduce boot time [1/1] |
| |
| PD#SWPL-71744 |
| |
| Problem: |
| 1.Jitter rng is doing 1024 rounds of tests and causing |
| long initialization time. |
| 2.regulator driver init time too long. |
| |
| Solution: |
| 1.change jent_mod_int to delaywork to reduce boot time. |
| 2.fixed regulator driver use ASYNCHRONOUS probe mode. |
| |
| Verify: |
| c2_af400 |
| |
| Signed-off-by: song.han <song.han@amlogic.com> |
| Change-Id: I90e67854b213dd673077c72bb4830264d17f1f88 |
| --- |
| crypto/jitterentropy-kcapi.c | 27 +++++++++++++++++++++++++++ |
| drivers/regulator/fixed.c | 3 +++ |
| 2 files changed, 30 insertions(+) |
| |
| diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c |
| index e8a4165a1874..1dcd05ea62cc 100644 |
| --- a/crypto/jitterentropy-kcapi.c |
| +++ b/crypto/jitterentropy-kcapi.c |
| @@ -197,6 +197,7 @@ static struct rng_alg jent_alg = { |
| } |
| }; |
| |
| +#if !IS_ENABLED(CONFIG_AMLOGIC_BOOT_TIME) |
| static int __init jent_mod_init(void) |
| { |
| int ret = 0; |
| @@ -208,6 +209,32 @@ static int __init jent_mod_init(void) |
| } |
| return crypto_register_rng(&jent_alg); |
| } |
| +#else |
| +static struct delayed_work jent_work; |
| +static void __jent_mod_init(struct work_struct *work) |
| +{ |
| + int ret = 0; |
| + |
| + ret = jent_entropy_init(); |
| + if (ret) { |
| + pr_info("jitterentropy: Initialization failed with : %d\n", ret); |
| + return; |
| + } |
| + ret = crypto_register_rng(&jent_alg); |
| + if (ret) { |
| + pr_err("registering jent_alg failed: %d\n", ret); |
| + return; |
| + } |
| +} |
| + |
| +static int __init jent_mod_init(void) |
| +{ |
| + INIT_DELAYED_WORK(&jent_work, __jent_mod_init); |
| + schedule_delayed_work(&jent_work, msecs_to_jiffies(1000)); |
| + |
| + return 0; |
| +} |
| +#endif |
| |
| static void __exit jent_mod_exit(void) |
| { |
| diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c |
| index fb163458337f..e009b61422f8 100644 |
| --- a/drivers/regulator/fixed.c |
| +++ b/drivers/regulator/fixed.c |
| @@ -338,6 +338,9 @@ static struct platform_driver regulator_fixed_voltage_driver = { |
| .driver = { |
| .name = "reg-fixed-voltage", |
| .of_match_table = of_match_ptr(fixed_of_match), |
| +#if IS_ENABLED(CONFIG_AMLOGIC_BOOT_TIME) |
| + .probe_type = PROBE_PREFER_ASYNCHRONOUS, |
| +#endif |
| }, |
| }; |
| |
| -- |
| 2.25.1 |
| |