]> git.hungrycats.org Git - linux/commitdiff
[NET]: Replace schedule_timeout() with msleep() in netdev_wait_allrefs()
authorNishanth Aravamudan <nacc@us.ibm.com>
Tue, 8 Feb 2005 08:20:23 +0000 (00:20 -0800)
committerDavid S. Miller <davem@kernel.bkbits.net>
Tue, 8 Feb 2005 08:20:23 +0000 (00:20 -0800)
Description: Use msleep() instead of schedule_timeout() to guarantee the task
delays as expected. The current code uses TASK_INTERRUPTIBLE, but does not
respond to signals, so msleep() should be ok.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 4dc01e26f158b9fb1706470a409a5aa882c83017..5d4abaa853510d0a5cbf4f3ecc18e4b1366d376e 100644 (file)
 #include <linux/kallsyms.h>
 #include <linux/netpoll.h>
 #include <linux/rcupdate.h>
+#include <linux/delay.h>
 #ifdef CONFIG_NET_RADIO
 #include <linux/wireless.h>            /* Note : will define WIRELESS_EXT */
 #include <net/iw_handler.h>
@@ -2899,8 +2900,7 @@ static void netdev_wait_allrefs(struct net_device *dev)
                        rebroadcast_time = jiffies;
                }
 
-               current->state = TASK_INTERRUPTIBLE;
-               schedule_timeout(HZ / 4);
+               msleep(250);
 
                if (time_after(jiffies, warning_time + 10 * HZ)) {
                        printk(KERN_EMERG "unregister_netdevice: "