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

[NET]: Replace schedule_timeout() with msleep() in netdev_wait_allrefs()

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: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc86dddb
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <linux/netpoll.h> #include <linux/netpoll.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/delay.h>
#ifdef CONFIG_NET_RADIO #ifdef CONFIG_NET_RADIO
#include <linux/wireless.h> /* Note : will define WIRELESS_EXT */ #include <linux/wireless.h> /* Note : will define WIRELESS_EXT */
#include <net/iw_handler.h> #include <net/iw_handler.h>
...@@ -2899,8 +2900,7 @@ static void netdev_wait_allrefs(struct net_device *dev) ...@@ -2899,8 +2900,7 @@ static void netdev_wait_allrefs(struct net_device *dev)
rebroadcast_time = jiffies; rebroadcast_time = jiffies;
} }
current->state = TASK_INTERRUPTIBLE; msleep(250);
schedule_timeout(HZ / 4);
if (time_after(jiffies, warning_time + 10 * HZ)) { if (time_after(jiffies, warning_time + 10 * HZ)) {
printk(KERN_EMERG "unregister_netdevice: " printk(KERN_EMERG "unregister_netdevice: "
......
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