From 6877c51f0780ec37604211053340568709e5325a Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Mon, 29 Nov 2004 03:10:22 -0800 Subject: [PATCH] [IPV4]: Use schedule_timeout() instead of jiffies polling in ipconfig. Signed-off-by: David S. Miller --- net/ipv4/ipconfig.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index a0c8504dc223..f1c60e44a8da 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1102,8 +1102,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. */ @@ -1245,7 +1245,6 @@ u32 __init root_nfs_parse_addr(char *name) static int __init ip_auto_config(void) { - unsigned long jiff; u32 addr; #ifdef CONFIG_PROC_FS @@ -1260,18 +1259,16 @@ static int __init ip_auto_config(void) try_try_again: #endif /* Give hardware a chance to settle */ - jiff = jiffies + CONF_PRE_OPEN; - while (time_before(jiffies, jiff)) - cpu_relax(); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(CONF_PRE_OPEN); /* Setup all network devices */ if (ic_open_devs() < 0) return -1; /* Give drivers a chance to settle */ - jiff = jiffies + CONF_POST_OPEN; - while (time_before(jiffies, jiff)) - cpu_relax(); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(CONF_POST_OPEN); /* * If the config information is insufficient (e.g., our IP address or -- 2.39.5