aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Stezenbach <js@sig21.net>2010-11-30 10:49:23 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-20 13:48:04 -0500
commit9f333281a7da4c3a59bccc0cb53f7590eb850d93 (patch)
tree516ce1c2abc5bf4662f484586654589bb23b63c8
parent56e6417b49132d4f56e9f2241d31942b90b46315 (diff)
mac80211/rt2x00: add ieee80211_tx_status_ni()
All rt2x00 drivers except rt2800pci call ieee80211_tx_status() from a workqueue, which causes "NOHZ: local_softirq_pending 08" messages. To fix it, add ieee80211_tx_status_ni() similar to ieee80211_rx_ni() which can be called from process context, and call it from rt2x00lib_txdone(). For the rt2800pci special case a driver flag is introduced. https://bugzilla.kernel.org/show_bug.cgi?id=24892 Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c9
-rw-r--r--include/net/mac80211.h28
4 files changed, 32 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index b26739535986..09a67905c230 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -912,6 +912,7 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
912 __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); 912 __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
913 __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); 913 __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
914 __set_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags); 914 __set_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags);
915 __set_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags);
915 if (!modparam_nohwcrypt) 916 if (!modparam_nohwcrypt)
916 __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); 917 __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
917 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); 918 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 94fe589acfaa..ab43e7ca2a23 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -664,6 +664,7 @@ enum rt2x00_flags {
664 DRIVER_REQUIRE_COPY_IV, 664 DRIVER_REQUIRE_COPY_IV,
665 DRIVER_REQUIRE_L2PAD, 665 DRIVER_REQUIRE_L2PAD,
666 DRIVER_REQUIRE_TXSTATUS_FIFO, 666 DRIVER_REQUIRE_TXSTATUS_FIFO,
667 DRIVER_REQUIRE_TASKLET_CONTEXT,
667 668
668 /* 669 /*
669 * Driver features 670 * Driver features
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 5ba79b935f09..d019830ca840 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -390,9 +390,12 @@ void rt2x00lib_txdone(struct queue_entry *entry,
390 * through a mac80211 library call (RTS/CTS) then we should not 390 * through a mac80211 library call (RTS/CTS) then we should not
391 * send the status report back. 391 * send the status report back.
392 */ 392 */
393 if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) 393 if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) {
394 ieee80211_tx_status(rt2x00dev->hw, entry->skb); 394 if (test_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags))
395 else 395 ieee80211_tx_status(rt2x00dev->hw, entry->skb);
396 else
397 ieee80211_tx_status_ni(rt2x00dev->hw, entry->skb);
398 } else
396 dev_kfree_skb_any(entry->skb); 399 dev_kfree_skb_any(entry->skb);
397 400
398 /* 401 /*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9fdf982d1286..365359b24177 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2024,8 +2024,8 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw,
2024 * 2024 *
2025 * This function may not be called in IRQ context. Calls to this function 2025 * This function may not be called in IRQ context. Calls to this function
2026 * for a single hardware must be synchronized against each other. Calls 2026 * for a single hardware must be synchronized against each other. Calls
2027 * to this function and ieee80211_tx_status_irqsafe() may not be mixed 2027 * to this function, ieee80211_tx_status_ni() and ieee80211_tx_status_irqsafe()
2028 * for a single hardware. 2028 * may not be mixed for a single hardware.
2029 * 2029 *
2030 * @hw: the hardware the frame was transmitted by 2030 * @hw: the hardware the frame was transmitted by
2031 * @skb: the frame that was transmitted, owned by mac80211 after this call 2031 * @skb: the frame that was transmitted, owned by mac80211 after this call
@@ -2034,13 +2034,33 @@ void ieee80211_tx_status(struct ieee80211_hw *hw,
2034 struct sk_buff *skb); 2034 struct sk_buff *skb);
2035 2035
2036/** 2036/**
2037 * ieee80211_tx_status_ni - transmit status callback (in process context)
2038 *
2039 * Like ieee80211_tx_status() but can be called in process context.
2040 *
2041 * Calls to this function, ieee80211_tx_status() and
2042 * ieee80211_tx_status_irqsafe() may not be mixed
2043 * for a single hardware.
2044 *
2045 * @hw: the hardware the frame was transmitted by
2046 * @skb: the frame that was transmitted, owned by mac80211 after this call
2047 */
2048static inline void ieee80211_tx_status_ni(struct ieee80211_hw *hw,
2049 struct sk_buff *skb)
2050{
2051 local_bh_disable();
2052 ieee80211_tx_status(hw, skb);
2053 local_bh_enable();
2054}
2055
2056/**
2037 * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback 2057 * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback
2038 * 2058 *
2039 * Like ieee80211_tx_status() but can be called in IRQ context 2059 * Like ieee80211_tx_status() but can be called in IRQ context
2040 * (internally defers to a tasklet.) 2060 * (internally defers to a tasklet.)
2041 * 2061 *
2042 * Calls to this function and ieee80211_tx_status() may not be mixed for a 2062 * Calls to this function, ieee80211_tx_status() and
2043 * single hardware. 2063 * ieee80211_tx_status_ni() may not be mixed for a single hardware.
2044 * 2064 *
2045 * @hw: the hardware the frame was transmitted by 2065 * @hw: the hardware the frame was transmitted by
2046 * @skb: the frame that was transmitted, owned by mac80211 after this call 2066 * @skb: the frame that was transmitted, owned by mac80211 after this call