forked from clearlinux-pkgs/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0125-init-wait-for-partition-and-retry-scan.patch
More file actions
52 lines (45 loc) · 1.41 KB
/
Copy path0125-init-wait-for-partition-and-retry-scan.patch
File metadata and controls
52 lines (45 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From d04a77f51ea91d26cda43e0429e650e636177402 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Wed, 17 May 2017 01:52:11 +0000
Subject: [PATCH 125/126] 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 <miguel.bernal.marin@linux.intel.com>
---
init/do_mounts.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 9fd3875897df..5bf8e61fd1c7 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -213,11 +213,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;
@@ -564,7 +572,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();
--
2.15.0