From c6e89e8a31eeeb82c5711cba8235e7e55d9be6a8 Mon Sep 17 00:00:00 2001 From: Adrian Calianu Date: Tue, 11 May 2021 09:42:24 +0200 Subject: boot_time_opt: update patches to 5.10 kernel Patches used in boot time optimization are coming from clearlinux distribution. Update patches correspuding to 5.10 kernel: https://github.com/clearlinux-pkgs/linux/tree/5.10.32-1034 We selected a list of patches from ClearLinux. Those we have considered risky, unknown impact on functionality have been avoided. Change-Id: If01459292a5a383b49944645bd8536d9a62d9de3 Signed-off-by: Adrian Calianu --- ...13-init-wait-for-partition-and-retry-scan.patch | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 patches/boot_time_opt/0113-init-wait-for-partition-and-retry-scan.patch (limited to 'patches/boot_time_opt/0113-init-wait-for-partition-and-retry-scan.patch') diff --git a/patches/boot_time_opt/0113-init-wait-for-partition-and-retry-scan.patch b/patches/boot_time_opt/0113-init-wait-for-partition-and-retry-scan.patch new file mode 100644 index 0000000..98b7b5f --- /dev/null +++ b/patches/boot_time_opt/0113-init-wait-for-partition-and-retry-scan.patch @@ -0,0 +1,52 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Arjan van de Ven +Date: Wed, 17 May 2017 01:52:11 +0000 +Subject: [PATCH] init: wait for partition and retry scan + +As Clear Linux boots fast the device is not ready when +the mounting code is reached, so a retry device scan will +be performed every 0.5 sec for at least 40 sec +and synchronize the async task. + +Signed-off-by: Miguel Bernal Marin +--- + init/do_mounts.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/init/do_mounts.c b/init/do_mounts.c +index b5f9604d0c98..6022ead20701 100644 +--- a/init/do_mounts.c ++++ b/init/do_mounts.c +@@ -225,11 +225,19 @@ dev_t name_to_dev_t(const char *name) + char *p; + dev_t res = 0; + int part; ++ /* we will wait at least 40 sec */ ++ int needtowait = 40<<1; + + #ifdef CONFIG_BLOCK + if (strncmp(name, "PARTUUID=", 9) == 0) { + name += 9; + res = devt_from_partuuid(name); ++ while (!res && needtowait) { ++ /* waiting 0.5 sec */ ++ msleep(500); ++ res = devt_from_partuuid(name); ++ needtowait--; ++ } + if (!res) + goto fail; + goto done; +@@ -596,7 +604,9 @@ void __init prepare_namespace(void) + * For example, it is not atypical to wait 5 seconds here + * for the touchpad of a laptop to initialize. + */ ++ async_synchronize_full(); + wait_for_device_probe(); ++ async_synchronize_full(); + + md_run_setup(); + +-- +https://clearlinux.org + -- cgit v1.2.3-54-g00ecf