[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1239874659-19273-4-git-send-email-dmitry.krivoschekov@gmail.com>
Date: Thu, 16 Apr 2009 13:37:39 +0400
From: dmitry.krivoschekov@...il.com
To: netdev@...r.kernel.org, davem@...emloft.net
Cc: Dmitry Krivoschekov <dkrivoschekov@...mvista.com>
Subject: [PATCH 3/3] ipconfig: look for a network device forever if NFS root
From: Dmitry Krivoschekov <dkrivoschekov@...mvista.com>
For now ip_auto_config() makes a pause before opening a network device
so the h/w can settle. It may not work well for USB network devices
as the period needed for devices to settle may vary from time to time due
to non-deterministic specifics of USB protocol itself.
The period will also depend on a certain USB configuration, e.g. whether
a USB device is sitting behind a USB hub(s) or not.
The issue gets critical when such a device is used to mount a NFS root
filesystem. Currently if ip_auto_config() can't find a network device
it gives up leaving the kernel in unusable state.
To resolve the issue the patch adds a loop waiting until a
suitable network device gets available.
Signed-off-by: Dmitry Krivoschekov <dkrivoschekov@...mvista.com>
---
net/ipv4/ipconfig.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 8222466..0066424 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1284,7 +1284,7 @@ static int __init ip_auto_config(void)
return 0;
DBG(("IP-Config: Entered.\n"));
-#ifdef IPCONFIG_DYNAMIC
+#if defined(IPCONFIG_DYNAMIC) || defined(CONFIG_ROOT_NFS)
try_try_again:
#endif
@@ -1295,8 +1295,16 @@ static int __init ip_auto_config(void)
msleep(ic_wait_pre);
/* Setup all network devices */
- if (ic_open_devs() < 0)
- return -1;
+ if (ic_open_devs() < 0) {
+#ifdef CONFIG_ROOT_NFS
+ if (ROOT_DEV == Root_NFS) {
+ printk(KERN_ERR "IP-Config: Could not open device, "
+ "Retrying forever (NFS root)...\n");
+ goto try_try_again;
+ } else
+#endif
+ return -1;
+ }
if (!ic_wait_post)
ic_wait_post = CONF_POST_OPEN;
--
1.6.1.2.MVISTA.5.ga9f3b
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists