netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erwan Velu <erwanaliasr1@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH] ipconfig: Inform user if carrier is not ready
Date: Thu, 13 Sep 2012 23:59:52 +0200	[thread overview]
Message-ID: <50525758.1090609@gmail.com> (raw)
In-Reply-To: <20120913.164525.1171098883605242394.davem@davemloft.net>

From: Erwan Velu <erwanaliasr1@gmail.com>

While using the ip= option at the cmdline, the kernel can hold the boot
process for 2 minutes (CONF_CARRIER_TIMEOUT) if the carrier is not
present.

While waiting the carrier, user is not informed about this situation and
so could think the kernel is frozen.

This patch is just adding a simple message every second telling we are
waiting the carrier to come up.
---
  net/ipv4/ipconfig.c |    8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 67e8a6b..d9f34b7 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -205,6 +205,7 @@ static int __init ic_open_devs(void)
      struct net_device *dev;
      unsigned short oflags;
      unsigned long start;
+    unsigned int loops=0;

      last = &ic_first_dev;
      rtnl_lock();
@@ -266,6 +267,13 @@ static int __init ic_open_devs(void)
              if (ic_is_init_dev(dev) && netif_carrier_ok(dev))
                  goto have_carrier;

+        loops++;
+        /* This loop is blocking the boot process until we get the 
carrier or reach the timeout.
+         * We have to inform the user about the situation as it could 
look like a kernel freeze.
+         * Every second, we display a short message indicating we wait 
the carrier */
+        if ((loops % 1000) == 0) {
+            pr_info("IP-Config: Waiting Carrier (%d/%d):\n",loops / 
1000, CONF_CARRIER_TIMEOUT / 1000);
+        }
          msleep(1);
      }
  have_carrier:
-- 
1.7.10

  reply	other threads:[~2012-09-13 21:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 20:21 Remarks and comments about ipconfig behavior Erwan Velu
2012-09-13 20:31 ` David Miller
2012-09-13 20:37   ` Erwan Velu
2012-09-13 20:45     ` David Miller
2012-09-13 21:59       ` Erwan Velu [this message]
2012-09-14  5:36         ` [PATCH] ipconfig: Inform user if carrier is not ready Francois Romieu
     [not found]         ` <50525C5D.8040302@hp.com>
2012-09-14 19:08           ` [PATCH V2] " Erwan Velu
2012-09-14 19:17             ` David Miller
2012-09-14 19:30               ` [PATCH V3] " Erwan Velu
2012-09-14 19:42                 ` David Miller
2012-09-14 20:13                   ` Erwan Velu
2012-09-14 20:23                     ` David Miller
2012-09-14 20:59                       ` Erwan Velu
2012-09-14 19:31               ` [PATCH V2] " Erwan Velu
2012-09-14 19:19             ` Rick Jones
2012-09-15 16:18   ` Remarks and comments about ipconfig behavior Erwan Velu

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=50525758.1090609@gmail.com \
    --to=erwanaliasr1@gmail.com \
    --cc=davem@davemloft.net \
    --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).