Skip to content

Commit 750084b

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
2 parents 1ab5ecb + 3780d03 commit 750084b

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

drivers/net/wireless/iwlegacy/3945-mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2475,7 +2475,7 @@ il3945_bg_alive_start(struct work_struct *data)
24752475
container_of(data, struct il_priv, alive_start.work);
24762476

24772477
mutex_lock(&il->mutex);
2478-
if (test_bit(S_EXIT_PENDING, &il->status))
2478+
if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL)
24792479
goto out;
24802480

24812481
il3945_alive_start(il);

drivers/net/wireless/iwlegacy/3945.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,11 +1870,12 @@ il3945_bg_reg_txpower_periodic(struct work_struct *work)
18701870
struct il_priv *il = container_of(work, struct il_priv,
18711871
_3945.thermal_periodic.work);
18721872

1873-
if (test_bit(S_EXIT_PENDING, &il->status))
1874-
return;
1875-
18761873
mutex_lock(&il->mutex);
1874+
if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL)
1875+
goto out;
1876+
18771877
il3945_reg_txpower_periodic(il);
1878+
out:
18781879
mutex_unlock(&il->mutex);
18791880
}
18801881

drivers/net/wireless/rt2x00/rt2x00dev.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,14 @@ void rt2x00lib_txdone(struct queue_entry *entry,
426426
/*
427427
* If the data queue was below the threshold before the txdone
428428
* handler we must make sure the packet queue in the mac80211 stack
429-
* is reenabled when the txdone handler has finished.
429+
* is reenabled when the txdone handler has finished. This has to be
430+
* serialized with rt2x00mac_tx(), otherwise we can wake up queue
431+
* before it was stopped.
430432
*/
433+
spin_lock_bh(&entry->queue->tx_lock);
431434
if (!rt2x00queue_threshold(entry->queue))
432435
rt2x00queue_unpause_queue(entry->queue);
436+
spin_unlock_bh(&entry->queue->tx_lock);
433437
}
434438
EXPORT_SYMBOL_GPL(rt2x00lib_txdone);
435439

drivers/net/wireless/rt2x00/rt2x00mac.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,22 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
152152
if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false)))
153153
goto exit_fail;
154154

155+
/*
156+
* Pausing queue has to be serialized with rt2x00lib_txdone(). Note
157+
* we should not use spin_lock_bh variant as bottom halve was already
158+
* disabled before ieee80211_xmit() call.
159+
*/
160+
spin_lock(&queue->tx_lock);
155161
if (rt2x00queue_threshold(queue))
156162
rt2x00queue_pause_queue(queue);
163+
spin_unlock(&queue->tx_lock);
157164

158165
return;
159166

160167
exit_fail:
168+
spin_lock(&queue->tx_lock);
161169
rt2x00queue_pause_queue(queue);
170+
spin_unlock(&queue->tx_lock);
162171
exit_free_skb:
163172
ieee80211_free_txskb(hw, skb);
164173
}

drivers/net/wireless/rt2x00/rt2x00queue.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,9 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
619619
else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags))
620620
rt2x00queue_align_frame(skb);
621621

622+
/*
623+
* That function must be called with bh disabled.
624+
*/
622625
spin_lock(&queue->tx_lock);
623626

624627
if (unlikely(rt2x00queue_full(queue))) {

0 commit comments

Comments
 (0)