Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369908
b: refs/heads/master
c: bd7c4b6
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and David S. Miller committed May 1, 2013
1 parent 1c6ae8f commit 42e2cb2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae6164adeb559db1828d4abd917971b61130f72e
refs/heads/master: bd7c4b604a6cd707803c7c6ba142bfa131f9a9f3
2 changes: 1 addition & 1 deletion trunk/include/linux/netpoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct netpoll_info {

unsigned long rx_flags;
spinlock_t rx_lock;
struct mutex dev_lock;
struct semaphore dev_lock;
struct list_head rx_np; /* netpolls that registered an rx_hook */

struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */
Expand Down
14 changes: 7 additions & 7 deletions trunk/net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,17 @@ static void netpoll_poll_dev(struct net_device *dev)
* the dev_open/close paths use this to block netpoll activity
* while changing device state
*/
if (!mutex_trylock(&ni->dev_lock))
if (!down_trylock(&ni->dev_lock))
return;

if (!netif_running(dev)) {
mutex_unlock(&ni->dev_lock);
up(&ni->dev_lock);
return;
}

ops = dev->netdev_ops;
if (!ops->ndo_poll_controller) {
mutex_unlock(&ni->dev_lock);
up(&ni->dev_lock);
return;
}

Expand All @@ -225,7 +225,7 @@ static void netpoll_poll_dev(struct net_device *dev)

poll_napi(dev);

mutex_unlock(&ni->dev_lock);
up(&ni->dev_lock);

if (dev->flags & IFF_SLAVE) {
if (ni) {
Expand Down Expand Up @@ -255,7 +255,7 @@ int netpoll_rx_disable(struct net_device *dev)
idx = srcu_read_lock(&netpoll_srcu);
ni = srcu_dereference(dev->npinfo, &netpoll_srcu);
if (ni)
mutex_lock(&ni->dev_lock);
down(&ni->dev_lock);
srcu_read_unlock(&netpoll_srcu, idx);
return 0;
}
Expand All @@ -267,7 +267,7 @@ void netpoll_rx_enable(struct net_device *dev)
rcu_read_lock();
ni = rcu_dereference(dev->npinfo);
if (ni)
mutex_unlock(&ni->dev_lock);
up(&ni->dev_lock);
rcu_read_unlock();
}
EXPORT_SYMBOL(netpoll_rx_enable);
Expand Down Expand Up @@ -1047,7 +1047,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev, gfp_t gfp)
INIT_LIST_HEAD(&npinfo->rx_np);

spin_lock_init(&npinfo->rx_lock);
mutex_init(&npinfo->dev_lock);
sema_init(&npinfo->dev_lock, 1);
skb_queue_head_init(&npinfo->neigh_tx);
skb_queue_head_init(&npinfo->txq);
INIT_DELAYED_WORK(&npinfo->tx_work, queue_process);
Expand Down

0 comments on commit 42e2cb2

Please sign in to comment.