Commit aff4b288 authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by David S. Miller

[IPV4]: ipconfig: Replace schedule_timeout() with msleep()

Description: Use msleep() instead of schedule_timeout() to guarantee the task
delays as expected. Change the units of the two constants to be msecs and secs
respectively.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8afb60c
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/root_dev.h> #include <linux/root_dev.h>
#include <linux/delay.h>
#include <net/arp.h> #include <net/arp.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/ipconfig.h> #include <net/ipconfig.h>
...@@ -84,8 +85,8 @@ ...@@ -84,8 +85,8 @@
#endif #endif
/* Define the friendly delay before and after opening net devices */ /* Define the friendly delay before and after opening net devices */
#define CONF_PRE_OPEN (HZ/2) /* Before opening: 1/2 second */ #define CONF_PRE_OPEN 500 /* Before opening: 1/2 second */
#define CONF_POST_OPEN (1*HZ) /* After opening: 1 second */ #define CONF_POST_OPEN 1 /* After opening: 1 second */
/* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */ /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */
#define CONF_OPEN_RETRIES 2 /* (Re)open devices twice */ #define CONF_OPEN_RETRIES 2 /* (Re)open devices twice */
...@@ -1259,16 +1260,14 @@ static int __init ip_auto_config(void) ...@@ -1259,16 +1260,14 @@ static int __init ip_auto_config(void)
try_try_again: try_try_again:
#endif #endif
/* Give hardware a chance to settle */ /* Give hardware a chance to settle */
set_current_state(TASK_UNINTERRUPTIBLE); msleep(CONF_PRE_OPEN);
schedule_timeout(CONF_PRE_OPEN);
/* Setup all network devices */ /* Setup all network devices */
if (ic_open_devs() < 0) if (ic_open_devs() < 0)
return -1; return -1;
/* Give drivers a chance to settle */ /* Give drivers a chance to settle */
set_current_state(TASK_UNINTERRUPTIBLE); ssleep(CONF_POST_OPEN);
schedule_timeout(CONF_POST_OPEN);
/* /*
* If the config information is insufficient (e.g., our IP address or * If the config information is insufficient (e.g., our IP address or
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment