Skip to contentSkip to conversation

pull-request: mac80211 2012-11-09

PATCH In review Johannes Berg 2 participants 8 messages Nov 9, 2012 – Nov 14, 2012 Networking drivers (wireless)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

John,

Here are five more fixes from me for 3.7. There's no theme to them, just various changes all over mac80211, see the commit logs for more information.

Please pull, information below.

johannes

The following changes since commit 6dbda2d00d466225f9db1dc695ff852443f28832:

mac80211: make sure data is accessible in EAPOL check (2012-10-26 22:52:42 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to 20f544eea03db4b498942558b882d463ce575c3e:

mac80211: don't send null data packet when not associated (2012-11-09 17:31:47 +0100)

----------------------------------------------------------------
Arik Nemtsov (1):
mac80211: sync acccess to tx_filtered/ps_tx_buf queues

David Spinadel (1):

      mac80211: init sched_scan_ies

Felix Fietkau (1):
mac80211: do not call ieee80211_configure_filter if no interfaces are up

Johannes Berg (2):
mac80211: fix memory leak in device registration error path
mac80211: don't send null data packet when not associated

 net/mac80211/cfg.c      | 3 +++
 net/mac80211/main.c     | 6 ++++--
 net/mac80211/scan.c     | 2 +-
 net/mac80211/sta_info.c | 5 +++++
 net/mac80211/util.c     | 2 ++
 5 files changed, 15 insertions(+), 3 deletions(-)
author maintainer
#1 lore raw

PATCH 1/2 iwlwifi: handle DMA mapping failures

From: Johannes Berg <[email protected]>

The RX replenish code doesn't handle DMA mapping failures, which will cause issues if there actually is a failure. This was reported by Shuah Khan who found a DMA mapping framework warning ("device driver failed to check map error").

---
 drivers/net/wireless/iwlwifi/pcie/rx.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/pcie/rx.c +21 -2
index 17c8e5d..bb69f8f 100644
@@ -321,6 +321,14 @@ static void iwl_rx_allocate(struct iwl_trans *trans, gfp_t priority)
 			dma_map_page(trans->dev, page, 0,
 				     PAGE_SIZE << trans_pcie->rx_page_order,
 				     DMA_FROM_DEVICE);
+		if (dma_mapping_error(trans->dev, rxb->page_dma)) {
+			rxb->page = NULL;
+			spin_lock_irqsave(&rxq->lock, flags);
+			list_add(&rxb->list, &rxq->rx_used);
+			spin_unlock_irqrestore(&rxq->lock, flags);
+			__free_pages(page, trans_pcie->rx_page_order);
+			return;
+		}
 		/* dma address must be no more than 36 bits */
 		BUG_ON(rxb->page_dma & ~DMA_BIT_MASK(36));
 		/* and also 256 byte aligned! */
@@ -488,8 +496,19 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
 			dma_map_page(trans->dev, rxb->page, 0,
 				     PAGE_SIZE << trans_pcie->rx_page_order,
 				     DMA_FROM_DEVICE);
-		list_add_tail(&rxb->list, &rxq->rx_free);
-		rxq->free_count++;
+		if (dma_mapping_error(trans->dev, rxb->page_dma)) {
+			/*
+			 * free the page(s) as well to not break
+			 * the invariant that the items on the used
+			 * list have no page(s)
+			 */
+			__free_pages(rxb->page, trans_pcie->rx_page_order);
+			rxb->page = NULL;
+			list_add_tail(&rxb->list, &rxq->rx_used);
+		} else {
+			list_add_tail(&rxb->list, &rxq->rx_free);
+			rxq->free_count++;
+		}
 	} else
 		list_add_tail(&rxb->list, &rxq->rx_used);
 	spin_unlock_irqrestore(&rxq->lock, flags);
Signature · 1 line
1.8.0
author maintainer
#2 lore raw

PATCH 2/2 iwlwifi: use ieee80211_free_txskb

From: Johannes Berg <[email protected]>

To let mac80211 clean up any TX information when
a frame is dropped, use ieee80211_free_txskb().

---
 drivers/net/wireless/iwlwifi/dvm/mac80211.c | 2 +-
 drivers/net/wireless/iwlwifi/dvm/main.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/dvm/mac80211.c +1 -1
index ff8162d..fa4d1b8 100644
@@ -521,7 +521,7 @@ static void iwlagn_mac_tx(struct ieee80211_hw *hw,
 		     ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
 
 	if (iwlagn_tx_skb(priv, control->sta, skb))
-		dev_kfree_skb_any(skb);
+		ieee80211_free_txskb(hw, skb);
 }
 
 static void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw,
drivers/net/wireless/iwlwifi/dvm/main.c +1 -1
index 7ff3f14..408132c 100644
@@ -2114,7 +2114,7 @@ static void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
 
 	info = IEEE80211_SKB_CB(skb);
 	iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]);
-	dev_kfree_skb_any(skb);
+	ieee80211_free_txskb(priv->hw, skb);
 }
 
 static void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
Signature · 1 line
1.8.0
author maintainer
#3 lore raw

Re: [PATCH 1/2] iwlwifi: handle DMA mapping failures

In reply to Johannes Berg

Err, ok, copy/paste bug -- I meant to have these as replies to the *iwlwifi* pull request, not the *mac80211* one. Sorry about that!

johannes

author maintainer
#4 lore raw
In reply to Johannes Berg
Quoted 5 lines · Johannes Berg

John,

Here are five more fixes from me for 3.7. There's no theme to them, just various changes all over mac80211, see the commit logs for more information.

Hmm, Felix has another txskb fix, I'll send a new pull request on Monday, please ignore this one.

johannes

author maintainer
#5 lore raw

pull-request: mac80211 2012-11-12

Another day, updated pull request. I'm going to let you merge this one, even if somebody sends me new fixes right now :)

I have a locking fix for some SKB queues, a variable initialization to avoid crashes in a certain failure case, another free_txskb fix from Felix and another fix from him to avoid calling a stopped driver, a fix for a (very unlikely) memory leak and a fix to not send null data packets when resuming while not associated.

Please pull, the entire pull request is below.

johannes

The following changes since commit 6dbda2d00d466225f9db1dc695ff852443f28832:

mac80211: make sure data is accessible in EAPOL check (2012-10-26 22:52:42 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to 1f98ab7fef48a2968f37f422c256c9fbd978c3f0:

mac80211: call skb_dequeue/ieee80211_free_txskb instead of __skb_queue_purge (2012-11-10 21:26:28 +0100)

----------------------------------------------------------------
Arik Nemtsov (1):
mac80211: sync acccess to tx_filtered/ps_tx_buf queues

David Spinadel (1):

      mac80211: init sched_scan_ies

Felix Fietkau (2):
mac80211: do not call ieee80211_configure_filter if no interfaces are up
mac80211: call skb_dequeue/ieee80211_free_txskb instead of __skb_queue_purge

Johannes Berg (2):
mac80211: fix memory leak in device registration error path
mac80211: don't send null data packet when not associated

 net/mac80211/cfg.c         |  3 +++
 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/main.c        |  6 ++++--
 net/mac80211/scan.c        |  2 +-
 net/mac80211/sta_info.c    | 11 ++++++++---
 net/mac80211/status.c      |  9 +++++++++
 net/mac80211/tx.c          |  9 ++++++---
 net/mac80211/util.c        |  2 ++
 8 files changed, 35 insertions(+), 9 deletions(-)
author maintainer
#6 lore raw

Re: pull-request: mac80211 2012-11-12

Quoted 8 lines · Johannes Berg

Another day, updated pull request. I'm going to let you merge this one, even if somebody sends me new fixes right now :)

I have a locking fix for some SKB queues, a variable initialization to avoid crashes in a certain failure case, another free_txskb fix from Felix and another fix from him to avoid calling a stopped driver, a fix for a (very unlikely) memory leak and a fix to not send null data packets when resuming while not associated.

I've amended the branch again, with the regulatory fix. Sorry about that!

johannes

The following changes since commit 6dbda2d00d466225f9db1dc695ff852443f28832:

mac80211: make sure data is accessible in EAPOL check (2012-10-26 22:52:42 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to 43c771a1963ab461a2f194e3c97fded1d5fe262f:

wireless: allow 40 MHz on world roaming channels 12/13 (2012-11-12 16:26:06 +0100)

----------------------------------------------------------------
Arik Nemtsov (1):
mac80211: sync acccess to tx_filtered/ps_tx_buf queues

David Spinadel (1):

      mac80211: init sched_scan_ies

Felix Fietkau (2):
mac80211: do not call ieee80211_configure_filter if no interfaces are up
mac80211: call skb_dequeue/ieee80211_free_txskb instead of __skb_queue_purge

Johannes Berg (3):
mac80211: fix memory leak in device registration error path
mac80211: don't send null data packet when not associated
wireless: allow 40 MHz on world roaming channels 12/13

 net/mac80211/cfg.c         |  3 +++
 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/main.c        |  6 ++++--
 net/mac80211/scan.c        |  2 +-
 net/mac80211/sta_info.c    | 11 ++++++++---
 net/mac80211/status.c      |  9 +++++++++
 net/mac80211/tx.c          |  9 ++++++---
 net/mac80211/util.c        |  2 ++
 net/wireless/reg.c         |  5 ++---
 9 files changed, 37 insertions(+), 12 deletions(-)
#7 lore raw

Re: pull-request: mac80211 2012-11-12

Quoted 10 lines · Johannes Berg
Quoted 8 lines · Johannes Berg

Another day, updated pull request. I'm going to let you merge this one, even if somebody sends me new fixes right now :)

I have a locking fix for some SKB queues, a variable initialization to avoid crashes in a certain failure case, another free_txskb fix from Felix and another fix from him to avoid calling a stopped driver, a fix for a (very unlikely) memory leak and a fix to not send null data packets when resuming while not associated.

Quoted 4 lines

I've amended the branch again, with the regulatory fix. Sorry about that!

johannes

I pulled this one... :-)

Quoted 39 lines

The following changes since commit 6dbda2d00d466225f9db1dc695ff852443f28832:

mac80211: make sure data is accessible in EAPOL check (2012-10-26 22:52:42 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to 43c771a1963ab461a2f194e3c97fded1d5fe262f:

wireless: allow 40 MHz on world roaming channels 12/13 (2012-11-12 16:26:06 +0100)

----------------------------------------------------------------
Arik Nemtsov (1):
mac80211: sync acccess to tx_filtered/ps_tx_buf queues

David Spinadel (1):

      mac80211: init sched_scan_ies

Felix Fietkau (2):
mac80211: do not call ieee80211_configure_filter if no interfaces are up
mac80211: call skb_dequeue/ieee80211_free_txskb instead of __skb_queue_purge

Johannes Berg (3):
mac80211: fix memory leak in device registration error path
mac80211: don't send null data packet when not associated
wireless: allow 40 MHz on world roaming channels 12/13

 net/mac80211/cfg.c         |  3 +++
 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/main.c        |  6 ++++--
 net/mac80211/scan.c        |  2 +-
 net/mac80211/sta_info.c    | 11 ++++++++---
 net/mac80211/status.c      |  9 +++++++++
 net/mac80211/tx.c          |  9 ++++++---
 net/mac80211/util.c        |  2 ++
 net/wireless/reg.c         |  5 ++---
 9 files changed, 37 insertions(+), 12 deletions(-)
Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.