author | Yonghui Yu <yonghui.yu@amlogic.com> | 2018-08-16 16:11:35 (GMT) |
---|---|---|
committer | Jianxin Pan <jianxin.pan@amlogic.com> | 2018-08-20 02:12:34 (GMT) |
commit | 9f010c57608e11d99947348e8cd6a82577371b4e (patch) | |
tree | c6896e86a513f403554f0a479e676f78c01168bd | |
parent | 27a98f57787cf146fa7e30844289edbc8e7f0d62 (diff) | |
download | common-9f010c57608e11d99947348e8cd6a82577371b4e.zip common-9f010c57608e11d99947348e8cd6a82577371b4e.tar.gz common-9f010c57608e11d99947348e8cd6a82577371b4e.tar.bz2 |
init: wait emmc ready before root
PD#171658: init: wait emmc ready before root
A temporary ugly patch
Change-Id: I9a75fabf7460f92b0b9ae51992ac0d3c964798d2
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
-rw-r--r-- | init/do_mounts.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c index 1902a1c8..9245c5b 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -549,13 +549,23 @@ void __init mount_root(void) void __init prepare_namespace(void) { int is_floppy; - +#ifdef CONFIG_AMLOGIC_MODIFY + dev_t res = 0; + int wait = 80; /* 8s max wait*/ +#endif /* CONFIG_AMLOGIC_MODIFY */ if (root_delay) { printk(KERN_INFO "Waiting %d sec before mounting root device...\n", root_delay); ssleep(root_delay); } - +#ifdef CONFIG_AMLOGIC_MODIFY + /* A ugly patch for system as root wait emmc ready. */ + while (!res && wait--) { + res = blk_lookup_devt("mmcblk0", 0); + msleep(100); + }; + pr_info("%s() wait %d\n", __func__, wait); +#endif /* CONFIG_AMLOGIC_MODIFY */ /* * wait for the known devices to complete their probing * |