Linux wireless drivers development
 help / color / mirror / Atom feed
From: reinette chatre <reinette.chatre@intel.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	johannes@sipsolutions.net, Adel Gadllah <adel.gadllah@gmail.com>
Subject: [PATCH] iwlwifi: recalculate average tpt if not current
Date: Mon, 03 May 2010 10:55:07 -0700	[thread overview]
Message-ID: <1272909307.7879.5759.camel@rchatre-DESK> (raw)
In-Reply-To: <1272908934.7879.5748.camel@rchatre-DESK>

From: Reinette Chatre <reinette.chatre@intel.com>

We currently have this check as a BUG_ON, which is being hit by people.
Previously it was an error with a recalculation if not current, return that
code.

The BUG_ON was introduced by:
commit 3110bef78cb4282c58245bc8fd6d95d9ccb19749
Author: Guy Cohen <guy.cohen@intel.com>
Date:   Tue Sep 9 10:54:54 2008 +0800

    iwlwifi: Added support for 3 antennas

... the portion adding the BUG_ON is reverted since we are encountering the error
and BUG_ON was created with assumption that error is not encountered.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---

 drivers/net/wireless/iwlwifi/iwl-agn-rs.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index b93e491..75a145c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2070,10 +2070,12 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 	}
 	/* Else we have enough samples; calculate estimate of
 	 * actual average throughput */
-
-	/* Sanity-check TPT calculations */
-	BUG_ON(window->average_tpt != ((window->success_ratio *
-			tbl->expected_tpt[index] + 64) / 128));
+	if (window->average_tpt != ((window->success_ratio *
+			tbl->expected_tpt[index] + 64) / 128)) {
+		IWL_ERR(priv, "expected_tpt should have been calculated by now\n");
+		window->average_tpt = ((window->success_ratio *
+					tbl->expected_tpt[index] + 64) / 128);
+	}
 
 	/* If we are searching for better modulation mode, check success. */
 	if (lq_sta->search_better_tbl &&
-- 
1.6.3.3




  reply	other threads:[~2010-05-03 17:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 17:25 [PATCH] iwlagn: Change the TPT calculations sanity-check to WARN_ON John W. Linville
2010-05-03 17:48 ` reinette chatre
2010-05-03 17:55   ` reinette chatre [this message]
2010-05-06 16:11     ` [PATCH] iwlwifi: recalculate average tpt if not current reinette chatre
2010-05-06 18:22       ` John W. Linville
2010-05-06 18:50         ` reinette chatre
2010-05-03 20:29 ` [PATCH] iwlagn: Change the TPT calculations sanity-check to WARN_ON Kalle Valo
2010-05-03 20:48   ` Gábor Stefanik
2010-05-03 21:01     ` Pavel Roskin
2010-05-03 21:10       ` Adel Gadllah
2010-05-03 21:20         ` Gábor Stefanik
  -- strict thread matches above, loose matches on Subject: below --
2010-06-04 16:32 [PATCH] iwlwifi: recalculate average tpt if not current Nils Radtke
2010-06-04 18:03 ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272909307.7879.5759.camel@rchatre-DESK \
    --to=reinette.chatre@intel.com \
    --cc=adel.gadllah@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox