Re: [REVERT] be6b38bcb175613f239e0b302607db346472c6b6. v2.6.34-rc3-406 oops with 4965AGN wireless

Previous thread: [RFC] Initial OLPC Viafb merge by Jonathan Corbet on Thursday, April 8, 2010 - 10:15 am. (53 messages)

Next thread: [PATCH #2] reiserfs: Fix permissions on .reiserfs_priv by Jeff Mahoney on Thursday, April 8, 2010 - 10:30 am. (1 message)
From: Jeff Chua
Date: Thursday, April 8, 2010 - 10:16 am

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 <wey-yi.w.guy@intel.com>
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.

     Reported-by: Shanyu Zhao <shanyu.zhao@intel.com>
     Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
     Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
     CC: stable@kernel.org

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 1bd2cd8..83c52a6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -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");
--

From: Linus Torvalds
Date: Thursday, April 8, 2010 - 10:19 am

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
--

From: Peter Zijlstra
Date: Thursday, April 8, 2010 - 12:47 pm

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.

--

From: Guy, Wey-Yi
Date: Thursday, April 8, 2010 - 11:50 am

Hi 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
From: Al Viro
Date: Thursday, April 8, 2010 - 11:13 am

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.
--

From: Guy, Wey-Yi
Date: Thursday, April 8, 2010 - 1:09 pm

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



--

From: Guy, Wey-Yi
Date: Thursday, April 8, 2010 - 1:24 pm

Hi Viro and Jeff,


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
Previous thread: [RFC] Initial OLPC Viafb merge by Jonathan Corbet on Thursday, April 8, 2010 - 10:15 am. (53 messages)

Next thread: [PATCH #2] reiserfs: Fix permissions on .reiserfs_priv by Jeff Mahoney on Thursday, April 8, 2010 - 10:30 am. (1 message)