aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/netpoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r--net/core/netpoll.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 209d84253dd5..a5802a8b652f 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -206,17 +206,17 @@ static void netpoll_poll_dev(struct net_device *dev)
206 * the dev_open/close paths use this to block netpoll activity 206 * the dev_open/close paths use this to block netpoll activity
207 * while changing device state 207 * while changing device state
208 */ 208 */
209 if (!mutex_trylock(&ni->dev_lock)) 209 if (!down_trylock(&ni->dev_lock))
210 return; 210 return;
211 211
212 if (!netif_running(dev)) { 212 if (!netif_running(dev)) {
213 mutex_unlock(&ni->dev_lock); 213 up(&ni->dev_lock);
214 return; 214 return;
215 } 215 }
216 216
217 ops = dev->netdev_ops; 217 ops = dev->netdev_ops;
218 if (!ops->ndo_poll_controller) { 218 if (!ops->ndo_poll_controller) {
219 mutex_unlock(&ni->dev_lock); 219 up(&ni->dev_lock);
220 return; 220 return;
221 } 221 }
222 222
@@ -225,7 +225,7 @@ static void netpoll_poll_dev(struct net_device *dev)
225 225
226 poll_napi(dev); 226 poll_napi(dev);
227 227
228 mutex_unlock(&ni->dev_lock); 228 up(&ni->dev_lock);
229 229
230 if (dev->flags & IFF_SLAVE) { 230 if (dev->flags & IFF_SLAVE) {
231 if (ni) { 231 if (ni) {
@@ -255,7 +255,7 @@ int netpoll_rx_disable(struct net_device *dev)
255 idx = srcu_read_lock(&netpoll_srcu); 255 idx = srcu_read_lock(&netpoll_srcu);
256 ni = srcu_dereference(dev->npinfo, &netpoll_srcu); 256 ni = srcu_dereference(dev->npinfo, &netpoll_srcu);
257 if (ni) 257 if (ni)
258 mutex_lock(&ni->dev_lock); 258 down(&ni->dev_lock);
259 srcu_read_unlock(&netpoll_srcu, idx); 259 srcu_read_unlock(&netpoll_srcu, idx);
260 return 0; 260 return 0;
261} 261}
@@ -267,7 +267,7 @@ void netpoll_rx_enable(struct net_device *dev)
267 rcu_read_lock(); 267 rcu_read_lock();
268 ni = rcu_dereference(dev->npinfo); 268 ni = rcu_dereference(dev->npinfo);
269 if (ni) 269 if (ni)
270 mutex_unlock(&ni->dev_lock); 270 up(&ni->dev_lock);
271 rcu_read_unlock(); 271 rcu_read_unlock();
272} 272}
273EXPORT_SYMBOL(netpoll_rx_enable); 273EXPORT_SYMBOL(netpoll_rx_enable);
@@ -1047,7 +1047,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev, gfp_t gfp)
1047 INIT_LIST_HEAD(&npinfo->rx_np); 1047 INIT_LIST_HEAD(&npinfo->rx_np);
1048 1048
1049 spin_lock_init(&npinfo->rx_lock); 1049 spin_lock_init(&npinfo->rx_lock);
1050 mutex_init(&npinfo->dev_lock); 1050 sema_init(&npinfo->dev_lock, 1);
1051 skb_queue_head_init(&npinfo->neigh_tx); 1051 skb_queue_head_init(&npinfo->neigh_tx);
1052 skb_queue_head_init(&npinfo->txq); 1052 skb_queue_head_init(&npinfo->txq);
1053 INIT_DELAYED_WORK(&npinfo->tx_work, queue_process); 1053 INIT_DELAYED_WORK(&npinfo->tx_work, queue_process);