Skip to contentSkip to conversation

be6b38bcb175613f239e0b302607db346472c6b6. v2.6.34-rc3-406 oops with 4965AGN wireless

REVERT Jeff Chua 5 participants 7 messages Apr 8, 2010 Networking drivers (wireless)

lore
Share & tools
lore

Jeff Chua

author
#0 lore raw

Linus,

I'm having problem with the latest git pull 2 days ago with the 4965AGN wireless.

Starting the wireless with WPA2 resulted in system hard freeze. Reverting the commit below solves the problem.

Thanks,
Jeff

commit be6b38bcb175613f239e0b302607db346472c6b6

Author: Wey-Yi Guy <[email protected]>
Date:   Thu Mar 18 09:05:00 2010 -0700

iwlwifi: counting number of tfds can be free for 4965

Forget one hunk in 4965 during "iwlwifi: error checking for number of tfds in queue" patch.

drivers/net/wireless/iwlwifi/iwl-4965.c +2 -4
index 1bd2cd8..83c52a6 100644
@@ -2041,16 +2041,14 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 				   tx_resp->failure_frame);
 
 		freed = iwl_tx_queue_reclaim(priv, txq_id, index);
-		if (qc && likely(sta_id != IWL_INVALID_STATION))
-			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
+		iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
 
 		if (priv->mac80211_registered &&
 		    (iwl_queue_space(&txq->q) > txq->q.low_mark))
 			iwl_wake_queue(priv, txq_id);
 	}
 
-	if (qc && likely(sta_id != IWL_INVALID_STATION))
-		iwl_txq_check_empty(priv, sta_id, tid, txq_id);
+	iwl_txq_check_empty(priv, sta_id, tid, txq_id);
 
 	if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
 		IWL_ERR(priv, "TODO:  Implement Tx ABORT REQUIRED!!!\n");
#1 lore raw
Quoted 6 lines · Jeff Chua

I'm having problem with the latest git pull 2 days ago with the 4965AGN wireless.

Starting the wireless with WPA2 resulted in system hard freeze. Reverting the commit below solves the problem.

I don't mind reverting patches, but I hate doing it blind and without _any_ chance for the guilty party to try to fix it first.

Can you post the oops that your subject implies happened? Maybe the driver authors can find the proper fix without a revert?

I'll revert if if I hear no updates in a couple of days - please remind me.

Linus

#2 lore raw
Quoted 9 lines · Linus Torvalds
Quoted 6 lines · Jeff Chua

I'm having problem with the latest git pull 2 days ago with the 4965AGN wireless.

Starting the wireless with WPA2 resulted in system hard freeze. Reverting the commit below solves the problem.

Quoted 8 lines

I don't mind reverting patches, but I hate doing it blind and without _any_ chance for the guilty party to try to fix it first.

Can you post the oops that your subject implies happened? Maybe the driver authors can find the proper fix without a revert?

I'll revert if if I hear no updates in a couple of days - please remind me.

Does remind me of the iwlagn trouble I had, see
https://bugzilla.kernel.org/show_bug.cgi?id=15667 and
https://bugzilla.kernel.org/attachment.cgi?id=25881 for a patch that seems to have cured my laptop.

#3 lore raw
In reply to Jeff Chua

Hi Jeff,

Quoted 5 lines · Jeff Chua

Linus,

I'm having problem with the latest git pull 2 days ago with the 4965AGN wireless.

Quoted 8 lines

Starting the wireless with WPA2 resulted in system hard freeze. Reverting the commit below solves the problem.

Thanks,
Jeff

Sorry for the problem caused by this patch, it is my mistake using the similar approach for 4965 like the newer devices. could you try the attach patch to see if this fix your system freeze problem.

Regards
Wey

Quoted 1 line

From 0c441b5c684709152cd322e91ce59914159ea513 Mon Sep 17 00:00:00 2001

From: Wey-Yi Guy <[email protected]>
Date: Thu, 8 Apr 2010 11:41:24 -0700
Subject: [PATCH 1/1] iwlwifi: need check for valid qos packet before free

For 4965, need to check it is valid qos frame before free, only valid QoS frame has the tid used to free the packets.

---
 drivers/net/wireless/iwlwifi/iwl-4965.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +5 -3
index c710b26..4113909 100644
@@ -2014,7 +2014,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 			IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn "
 					   "%d index %d\n", scd_ssn , index);
 			freed = iwlagn_tx_queue_reclaim(priv, txq_id, index);
-			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+			if (qc && likely(sta_id != IWL_INVALID_STATION))
+				iwl_free_tfds_in_queue(priv, sta_id,
+						       tid, freed);
 
 			if (priv->mac80211_registered &&
 			    (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
@@ -2046,8 +2048,8 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 		    (iwl_queue_space(&txq->q) > txq->q.low_mark))
 			iwl_wake_queue(priv, txq_id);
 	}
-
-	iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
+	if (qc && likely(sta_id != IWL_INVALID_STATION))
+		iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
 
 	iwl_check_abort_status(priv, tx_resp->frame_count, status);
 }
Signature · 1 line
1.5.6.3
#4 lore raw
In reply to Jeff Chua

drivers/net/wireless/iwlwifi/iwl-4965.c static void iwl4965_rx_reply_tx(struct iwl_priv *priv, · line 2044

Quoted 11 lines · Jeff Chua

index 1bd2cd8..83c52a6 100644

drivers/net/wireless/iwlwifi/iwl-4965.c +1 -2
@@ -2041,16 +2041,14 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 				   tx_resp->failure_frame);
 
 		freed = iwl_tx_queue_reclaim(priv, txq_id, index);
-		if (qc && likely(sta_id != IWL_INVALID_STATION))
-			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
+		iwl_free_tfds_in_queue(priv, sta_id, tid, freed);

So what happens if we hit sta_id == IWL_INVALID_STATION and !txq->sched_retry?

AFAICS, IWL_INVALID_STATION is 255 and priv->stations[] has only 32 elements. And code around that place is

        if (txq->sched_retry && unlikely(sta_id == IWL_INVALID_STATION)) {
                IWL_ERR(priv, "Station not known\n");
                return;
        }
        if (txq->sched_retry) {
		....
	} else {
		....
		the code modified in that chunk
		....
	}

so this removal of check for sta_id doesn't look apriori safe...

I'm not familiar with that code and I don't have the hardware, so this is just from RTFS, but... might make sense to replace that call of iwl_free_tfds_in_queue with

		if (sta_id == IWL_INVALID_STATION)
			printk(KERN_ERR "buggered");
		else
			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);

and see if that helps and if printk gets triggered.

#5 lore raw
Quoted 34 lines · Al Viro

drivers/net/wireless/iwlwifi/iwl-4965.c static void iwl4965_rx_reply_tx(struct iwl_priv *priv, · line 2044

Quoted 11 lines · Jeff Chua

index 1bd2cd8..83c52a6 100644

drivers/net/wireless/iwlwifi/iwl-4965.c +1 -2
@@ -2041,16 +2041,14 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 				   tx_resp->failure_frame);
 
 		freed = iwl_tx_queue_reclaim(priv, txq_id, index);
-		if (qc && likely(sta_id != IWL_INVALID_STATION))
-			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
+		iwl_free_tfds_in_queue(priv, sta_id, tid, freed);

So what happens if we hit sta_id == IWL_INVALID_STATION and !txq->sched_retry?

AFAICS, IWL_INVALID_STATION is 255 and priv->stations[] has only 32 elements. And code around that place is

        if (txq->sched_retry && unlikely(sta_id == IWL_INVALID_STATION)) {
                IWL_ERR(priv, "Station not known\n");
                return;
        }
        if (txq->sched_retry) {
		....
	} else {
		....
		the code modified in that chunk
		....
	}

so this removal of check for sta_id doesn't look apriori safe...

I'm not familiar with that code and I don't have the hardware, so this is just from RTFS, but... might make sense to replace that call of iwl_free_tfds_in_queue with

Quoted 6 lines
		if (sta_id == IWL_INVALID_STATION)
			printk(KERN_ERR "buggered");
		else
			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);

and see if that helps and if printk gets triggered.

We can check for IWL_INVALID_STATION and print log, but need to check for qc to make sure it is valid; maybe something like

			if (qc && likely(sta_id != IWL_INVALID_STATION))
				iwl_free_tfds_in_queue(priv, sta_id,
						       tid, freed);
			else {
				if (sta_id == IWL_INVALID_STATION)
					IWL_ERR(priv, "invalid station"");
			} 

Wey

#6 lore raw
In reply to Al Viro

Hi Viro and Jeff,

Quoted 34 lines · Al Viro

drivers/net/wireless/iwlwifi/iwl-4965.c static void iwl4965_rx_reply_tx(struct iwl_priv *priv, · line 2044

Quoted 11 lines · Jeff Chua

index 1bd2cd8..83c52a6 100644

drivers/net/wireless/iwlwifi/iwl-4965.c +1 -2
@@ -2041,16 +2041,14 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 				   tx_resp->failure_frame);
 
 		freed = iwl_tx_queue_reclaim(priv, txq_id, index);
-		if (qc && likely(sta_id != IWL_INVALID_STATION))
-			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
+		iwl_free_tfds_in_queue(priv, sta_id, tid, freed);

So what happens if we hit sta_id == IWL_INVALID_STATION and !txq->sched_retry?

AFAICS, IWL_INVALID_STATION is 255 and priv->stations[] has only 32 elements. And code around that place is

        if (txq->sched_retry && unlikely(sta_id == IWL_INVALID_STATION)) {
                IWL_ERR(priv, "Station not known\n");
                return;
        }
        if (txq->sched_retry) {
		....
	} else {
		....
		the code modified in that chunk
		....
	}

so this removal of check for sta_id doesn't look apriori safe...

I'm not familiar with that code and I don't have the hardware, so this is just from RTFS, but... might make sense to replace that call of iwl_free_tfds_in_queue with

Quoted 6 lines
		if (sta_id == IWL_INVALID_STATION)
			printk(KERN_ERR "buggered");
		else
			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);

and see if that helps and if printk gets triggered.

Maybe this patch looks better, if sched_rety and sta_id == IWL_INVALID_ID_STATION, this function already return before reach iwl_free_tfds_in_queue, so do not have to check for sta_id == IWL_INVALID_ID_STATION. the other case, print log if sta_id == IWL_INVALID_ID_STATION.

Wey

Quoted 1 line

From f3a5f691e32c0edfbc42a1e8687392dc3efe396e Mon Sep 17 00:00:00 2001

From: Wey-Yi Guy <[email protected]>
Date: Thu, 8 Apr 2010 13:17:37 -0700
Subject: [PATCH 1/1] iwlwifi: need check for valid qos packet before free

For 4965, need to check it is valid qos frame before free, only valid QoS frame has the tid used to free the packets.

---
 drivers/net/wireless/iwlwifi/iwl-4965.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +9 -4
index c710b26..2e3cda7 100644
@@ -2014,7 +2014,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 			IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn "
 					   "%d index %d\n", scd_ssn , index);
 			freed = iwlagn_tx_queue_reclaim(priv, txq_id, index);
-			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+			if (qc)
+				iwl_free_tfds_in_queue(priv, sta_id,
+						       tid, freed);
 
 			if (priv->mac80211_registered &&
 			    (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
@@ -2040,14 +2042,17 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 				   tx_resp->failure_frame);
 
 		freed = iwlagn_tx_queue_reclaim(priv, txq_id, index);
-		iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+		if (qc && likely(sta_id != IWL_INVALID_STATION))
+			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+		else if (sta_id == IWL_INVALID_STATION)
+			IWL_DEBUG_TX_REPLY(priv, "Station not known\n");
 
 		if (priv->mac80211_registered &&
 		    (iwl_queue_space(&txq->q) > txq->q.low_mark))
 			iwl_wake_queue(priv, txq_id);
 	}
-
-	iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
+	if (qc && likely(sta_id != IWL_INVALID_STATION))
+		iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
 
 	iwl_check_abort_status(priv, tx_resp->frame_count, status);
 }
Signature · 1 line
1.5.6.3