OSDN Git Service

[PATCH] ip-pnp-dhcp: wait lazily when doing dhcp for diskless systems
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Wed, 16 Apr 2008 01:15:10 +0000 (18:15 -0700)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2008 06:35:59 +0000 (08:35 +0200)
ic_dynamic() holds the cpu too long and tasks do not have a chance to run.
This causes adapters like e1000 that have the link come up in a tasklet to fail
link up due to exceptionally long delays in acquiring link, and then a dhcp
address.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
net/ipv4/ipconfig.c

index f9fcb3b..71ac51c 100644 (file)
@@ -1034,8 +1034,8 @@ static int __init ic_dynamic(void)
 
                jiff = jiffies + (d->next ? CONF_INTER_TIMEOUT : timeout);
                while (time_before(jiffies, jiff) && !ic_got_reply) {
-                       barrier();
-                       cpu_relax();
+                       __set_current_state(TASK_UNINTERRUPTIBLE);
+                       schedule_timeout(1);
                }
 #ifdef IPCONFIG_DHCP
                /* DHCP isn't done until we get a DHCPACK. */