diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 18 | ||||
-rw-r--r-- | net/core/dev.c | 10 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 10 |
3 files changed, 18 insertions, 20 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index af73bc3acb40..410dd5e76c41 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -101,11 +101,11 @@ static struct rfcomm_session *rfcomm_session_del(struct rfcomm_session *s); | |||
101 | #define __get_rpn_stop_bits(line) (((line) >> 2) & 0x1) | 101 | #define __get_rpn_stop_bits(line) (((line) >> 2) & 0x1) |
102 | #define __get_rpn_parity(line) (((line) >> 3) & 0x7) | 102 | #define __get_rpn_parity(line) (((line) >> 3) & 0x7) |
103 | 103 | ||
104 | static DECLARE_WAIT_QUEUE_HEAD(rfcomm_wq); | ||
105 | |||
104 | static void rfcomm_schedule(void) | 106 | static void rfcomm_schedule(void) |
105 | { | 107 | { |
106 | if (!rfcomm_thread) | 108 | wake_up_all(&rfcomm_wq); |
107 | return; | ||
108 | wake_up_process(rfcomm_thread); | ||
109 | } | 109 | } |
110 | 110 | ||
111 | /* ---- RFCOMM FCS computation ---- */ | 111 | /* ---- RFCOMM FCS computation ---- */ |
@@ -2086,24 +2086,22 @@ static void rfcomm_kill_listener(void) | |||
2086 | 2086 | ||
2087 | static int rfcomm_run(void *unused) | 2087 | static int rfcomm_run(void *unused) |
2088 | { | 2088 | { |
2089 | DEFINE_WAIT_FUNC(wait, woken_wake_function); | ||
2089 | BT_DBG(""); | 2090 | BT_DBG(""); |
2090 | 2091 | ||
2091 | set_user_nice(current, -10); | 2092 | set_user_nice(current, -10); |
2092 | 2093 | ||
2093 | rfcomm_add_listener(BDADDR_ANY); | 2094 | rfcomm_add_listener(BDADDR_ANY); |
2094 | 2095 | ||
2095 | while (1) { | 2096 | add_wait_queue(&rfcomm_wq, &wait); |
2096 | set_current_state(TASK_INTERRUPTIBLE); | 2097 | while (!kthread_should_stop()) { |
2097 | |||
2098 | if (kthread_should_stop()) | ||
2099 | break; | ||
2100 | 2098 | ||
2101 | /* Process stuff */ | 2099 | /* Process stuff */ |
2102 | rfcomm_process_sessions(); | 2100 | rfcomm_process_sessions(); |
2103 | 2101 | ||
2104 | schedule(); | 2102 | wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); |
2105 | } | 2103 | } |
2106 | __set_current_state(TASK_RUNNING); | 2104 | remove_wait_queue(&rfcomm_wq, &wait); |
2107 | 2105 | ||
2108 | rfcomm_kill_listener(); | 2106 | rfcomm_kill_listener(); |
2109 | 2107 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index 945bbd001359..3acff0974560 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -7200,11 +7200,10 @@ static void __net_exit rtnl_lock_unregistering(struct list_head *net_list) | |||
7200 | */ | 7200 | */ |
7201 | struct net *net; | 7201 | struct net *net; |
7202 | bool unregistering; | 7202 | bool unregistering; |
7203 | DEFINE_WAIT(wait); | 7203 | DEFINE_WAIT_FUNC(wait, woken_wake_function); |
7204 | 7204 | ||
7205 | add_wait_queue(&netdev_unregistering_wq, &wait); | ||
7205 | for (;;) { | 7206 | for (;;) { |
7206 | prepare_to_wait(&netdev_unregistering_wq, &wait, | ||
7207 | TASK_UNINTERRUPTIBLE); | ||
7208 | unregistering = false; | 7207 | unregistering = false; |
7209 | rtnl_lock(); | 7208 | rtnl_lock(); |
7210 | list_for_each_entry(net, net_list, exit_list) { | 7209 | list_for_each_entry(net, net_list, exit_list) { |
@@ -7216,9 +7215,10 @@ static void __net_exit rtnl_lock_unregistering(struct list_head *net_list) | |||
7216 | if (!unregistering) | 7215 | if (!unregistering) |
7217 | break; | 7216 | break; |
7218 | __rtnl_unlock(); | 7217 | __rtnl_unlock(); |
7219 | schedule(); | 7218 | |
7219 | wait_woken(&wait, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); | ||
7220 | } | 7220 | } |
7221 | finish_wait(&netdev_unregistering_wq, &wait); | 7221 | remove_wait_queue(&netdev_unregistering_wq, &wait); |
7222 | } | 7222 | } |
7223 | 7223 | ||
7224 | static void __net_exit default_device_exit_batch(struct list_head *net_list) | 7224 | static void __net_exit default_device_exit_batch(struct list_head *net_list) |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 76321ea442c3..88e8de3b59b0 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -365,11 +365,10 @@ static void rtnl_lock_unregistering_all(void) | |||
365 | { | 365 | { |
366 | struct net *net; | 366 | struct net *net; |
367 | bool unregistering; | 367 | bool unregistering; |
368 | DEFINE_WAIT(wait); | 368 | DEFINE_WAIT_FUNC(wait, woken_wake_function); |
369 | 369 | ||
370 | add_wait_queue(&netdev_unregistering_wq, &wait); | ||
370 | for (;;) { | 371 | for (;;) { |
371 | prepare_to_wait(&netdev_unregistering_wq, &wait, | ||
372 | TASK_UNINTERRUPTIBLE); | ||
373 | unregistering = false; | 372 | unregistering = false; |
374 | rtnl_lock(); | 373 | rtnl_lock(); |
375 | for_each_net(net) { | 374 | for_each_net(net) { |
@@ -381,9 +380,10 @@ static void rtnl_lock_unregistering_all(void) | |||
381 | if (!unregistering) | 380 | if (!unregistering) |
382 | break; | 381 | break; |
383 | __rtnl_unlock(); | 382 | __rtnl_unlock(); |
384 | schedule(); | 383 | |
384 | wait_woken(&wait, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); | ||
385 | } | 385 | } |
386 | finish_wait(&netdev_unregistering_wq, &wait); | 386 | remove_wait_queue(&netdev_unregistering_wq, &wait); |
387 | } | 387 | } |
388 | 388 | ||
389 | /** | 389 | /** |