aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2012-02-02 14:16:57 -0600
committerDan Murphy <dmurphy@ti.com>2012-02-02 14:19:13 -0600
commit04cc23436ebc4f0caf088a97ef9404ea71acfdd1 (patch)
tree9994f9a05d68e47e51368017288c157936e9e1cd /init
parent50725abe80c6893a7134977c8b576a0ec4eef5a5 (diff)
parent235eae6e5e402f5f723203e4444f10c16c7c3be3 (diff)
downloadkernel_samsung_espresso10-04cc23436ebc4f0caf088a97ef9404ea71acfdd1.zip
kernel_samsung_espresso10-04cc23436ebc4f0caf088a97ef9404ea71acfdd1.tar.gz
kernel_samsung_espresso10-04cc23436ebc4f0caf088a97ef9404ea71acfdd1.tar.bz2
Merge branch 'linux-3.0.18' into p-android-omap-3.0
Conflicts: arch/arm/mach-omap2/smartreflex.c drivers/i2c/busses/i2c-omap.c drivers/usb/host/ehci.h drivers/usb/musb/musb_core.c fs/proc/base.c Signed-off-by: Dan Murphy <dmurphy@ti.com>
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index c0851a8..ef6478f 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -360,15 +360,42 @@ out:
}
#ifdef CONFIG_ROOT_NFS
+
+#define NFSROOT_TIMEOUT_MIN 5
+#define NFSROOT_TIMEOUT_MAX 30
+#define NFSROOT_RETRY_MAX 5
+
static int __init mount_nfs_root(void)
{
char *root_dev, *root_data;
+ unsigned int timeout;
+ int try, err;
- if (nfs_root_data(&root_dev, &root_data) != 0)
- return 0;
- if (do_mount_root(root_dev, "nfs", root_mountflags, root_data) != 0)
+ err = nfs_root_data(&root_dev, &root_data);
+ if (err != 0)
return 0;
- return 1;
+
+ /*
+ * The server or network may not be ready, so try several
+ * times. Stop after a few tries in case the client wants
+ * to fall back to other boot methods.
+ */
+ timeout = NFSROOT_TIMEOUT_MIN;
+ for (try = 1; ; try++) {
+ err = do_mount_root(root_dev, "nfs",
+ root_mountflags, root_data);
+ if (err == 0)
+ return 1;
+ if (try > NFSROOT_RETRY_MAX)
+ break;
+
+ /* Wait, in case the server refused us immediately */
+ ssleep(timeout);
+ timeout <<= 1;
+ if (timeout > NFSROOT_TIMEOUT_MAX)
+ timeout = NFSROOT_TIMEOUT_MAX;
+ }
+ return 0;
}
#endif