summaryrefslogtreecommitdiffstats
path: root/patches/boot_time_opt_guest/0103-init-wait-for-partition-and-retry-scan.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/boot_time_opt_guest/0103-init-wait-for-partition-and-retry-scan.patch')
-rw-r--r--patches/boot_time_opt_guest/0103-init-wait-for-partition-and-retry-scan.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/patches/boot_time_opt_guest/0103-init-wait-for-partition-and-retry-scan.patch b/patches/boot_time_opt_guest/0103-init-wait-for-partition-and-retry-scan.patch
new file mode 100644
index 0000000..98b7b5f
--- /dev/null
+++ b/patches/boot_time_opt_guest/0103-init-wait-for-partition-and-retry-scan.patch
@@ -0,0 +1,52 @@
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Arjan van de Ven <arjan@linux.intel.com>
3Date: Wed, 17 May 2017 01:52:11 +0000
4Subject: [PATCH] init: wait for partition and retry scan
5
6As Clear Linux boots fast the device is not ready when
7the mounting code is reached, so a retry device scan will
8be performed every 0.5 sec for at least 40 sec
9and synchronize the async task.
10
11Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
12---
13 init/do_mounts.c | 10 ++++++++++
14 1 file changed, 10 insertions(+)
15
16diff --git a/init/do_mounts.c b/init/do_mounts.c
17index b5f9604d0c98..6022ead20701 100644
18--- a/init/do_mounts.c
19+++ b/init/do_mounts.c
20@@ -225,11 +225,19 @@ dev_t name_to_dev_t(const char *name)
21 char *p;
22 dev_t res = 0;
23 int part;
24+ /* we will wait at least 40 sec */
25+ int needtowait = 40<<1;
26
27 #ifdef CONFIG_BLOCK
28 if (strncmp(name, "PARTUUID=", 9) == 0) {
29 name += 9;
30 res = devt_from_partuuid(name);
31+ while (!res && needtowait) {
32+ /* waiting 0.5 sec */
33+ msleep(500);
34+ res = devt_from_partuuid(name);
35+ needtowait--;
36+ }
37 if (!res)
38 goto fail;
39 goto done;
40@@ -596,7 +604,9 @@ void __init prepare_namespace(void)
41 * For example, it is not atypical to wait 5 seconds here
42 * for the touchpad of a laptop to initialize.
43 */
44+ async_synchronize_full();
45 wait_for_device_probe();
46+ async_synchronize_full();
47
48 md_run_setup();
49
50--
51https://clearlinux.org
52