Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350266
b: refs/heads/master
c: 23663c8
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Feb 9, 2013
1 parent 6c0681c commit 3df0ac1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 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: ad72b3bea744b4db01c89af0f86f3e8920d354df
refs/heads/master: 23663c873154f01220ef679558e1ca110c4c4ca4
31 changes: 17 additions & 14 deletions trunk/drivers/net/wimax/i2400m/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void i2400m_wake_tx_work(struct work_struct *ws)
struct i2400m *i2400m = container_of(ws, struct i2400m, wake_tx_ws);
struct net_device *net_dev = i2400m->wimax_dev.net_dev;
struct device *dev = i2400m_dev(i2400m);
struct sk_buff *skb = i2400m->wake_tx_skb;
struct sk_buff *skb;
unsigned long flags;

spin_lock_irqsave(&i2400m->tx_lock, flags);
Expand Down Expand Up @@ -236,23 +236,26 @@ void i2400m_tx_prep_header(struct sk_buff *skb)
void i2400m_net_wake_stop(struct i2400m *i2400m)
{
struct device *dev = i2400m_dev(i2400m);
struct sk_buff *wake_tx_skb;
unsigned long flags;

d_fnstart(3, dev, "(i2400m %p)\n", i2400m);
/* See i2400m_hard_start_xmit(), references are taken there
* and here we release them if the work was still
* pending. Note we can't differentiate work not pending vs
* never scheduled, so the NULL check does that. */
if (cancel_work_sync(&i2400m->wake_tx_ws) == 0
&& i2400m->wake_tx_skb != NULL) {
unsigned long flags;
struct sk_buff *wake_tx_skb;
spin_lock_irqsave(&i2400m->tx_lock, flags);
wake_tx_skb = i2400m->wake_tx_skb; /* compat help */
i2400m->wake_tx_skb = NULL; /* compat help */
spin_unlock_irqrestore(&i2400m->tx_lock, flags);
/*
* See i2400m_hard_start_xmit(), references are taken there and
* here we release them if the packet was still pending.
*/
cancel_work_sync(&i2400m->wake_tx_ws);

spin_lock_irqsave(&i2400m->tx_lock, flags);
wake_tx_skb = i2400m->wake_tx_skb;
i2400m->wake_tx_skb = NULL;
spin_unlock_irqrestore(&i2400m->tx_lock, flags);

if (wake_tx_skb) {
i2400m_put(i2400m);
kfree_skb(wake_tx_skb);
}

d_fnend(3, dev, "(i2400m %p) = void\n", i2400m);
}

Expand Down Expand Up @@ -288,7 +291,7 @@ int i2400m_net_wake_tx(struct i2400m *i2400m, struct net_device *net_dev,
* and if pending, release those resources. */
result = 0;
spin_lock_irqsave(&i2400m->tx_lock, flags);
if (!work_pending(&i2400m->wake_tx_ws)) {
if (!i2400m->wake_tx_skb) {
netif_stop_queue(net_dev);
i2400m_get(i2400m);
i2400m->wake_tx_skb = skb_get(skb); /* transfer ref count */
Expand Down

0 comments on commit 3df0ac1

Please sign in to comment.