From: dmitry.krivoschekov@gmail.com
To: netdev@vger.kernel.org, davem@davemloft.net
Cc: Dmitry Krivoschekov <dkrivoschekov@ru.mvista.com>
Subject: [PATCH 3/3] ipconfig: look for a network device forever if NFS root
Date: Thu, 16 Apr 2009 13:37:39 +0400 [thread overview]
Message-ID: <1239874659-19273-4-git-send-email-dmitry.krivoschekov@gmail.com> (raw)
In-Reply-To: <1239874659-19273-1-git-send-email-dmitry.krivoschekov@gmail.com>
From: Dmitry Krivoschekov <dkrivoschekov@ru.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@ru.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
next prev parent reply other threads:[~2009-04-16 9:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-16 9:37 [PATCH 0/3] dmitry.krivoschekov
2009-04-16 9:37 ` [PATCH 1/3] ipconfig: use same time units for CONF_{PRE,POST}_OPEN delays dmitry.krivoschekov
2009-04-16 9:37 ` [PATCH 2/3] ipconfig: add 'ipwait' cmdline parameter dmitry.krivoschekov
2009-04-16 9:37 ` dmitry.krivoschekov [this message]
2009-04-17 8:23 ` [PATCH 0/3] David Miller
2009-04-17 10:00 ` [PATCH 0/3] ipconfig tweaks Dmitry Krivoschekov
2009-04-17 10:45 ` David Miller
2009-04-17 14:31 ` Benny Amorsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1239874659-19273-4-git-send-email-dmitry.krivoschekov@gmail.com \
--to=dmitry.krivoschekov@gmail.com \
--cc=davem@davemloft.net \
--cc=dkrivoschekov@ru.mvista.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).