linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems
@ 2011-04-28 12:08 Stanislaw Gruszka
  2011-04-28 12:08 ` [PATCH 2.6.38 1/4] iwlwifi: do not set tx power when channel is changing Stanislaw Gruszka
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Stanislaw Gruszka @ 2011-04-28 12:08 UTC (permalink / raw)
  To: stable, kernel; +Cc: Stanislaw Gruszka, Kyle McMartin, linux-wireless

This patchset fixes several problems related with hw scanning
on 3945 (see patch 3 for details). It is intended to 2.6.38,
on older kernels software scanning does not work. All patches
are currently in Linus' tree.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2.6.38 1/4] iwlwifi: do not set tx power when channel is changing
  2011-04-28 12:08 [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Stanislaw Gruszka
@ 2011-04-28 12:08 ` Stanislaw Gruszka
  2011-04-28 14:42   ` Guy, Wey-Yi
  2011-04-28 12:08 ` [PATCH 2.6.38 2/4] iwl3945: do not deprecate software scan Stanislaw Gruszka
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Stanislaw Gruszka @ 2011-04-28 12:08 UTC (permalink / raw)
  To: stable, kernel; +Cc: Stanislaw Gruszka, Kyle McMartin, linux-wireless

commit f844a709a7d8f8be61a571afc31dfaca9e779621 upstream.

Mac80211 can request for tx power and channel change in one ->config
call. If that happens, *_send_tx_power functions will try to setup tx
power for old channel, what can be not correct because we already change
the band. I.e  error  "Failed to get channel info for channel 140 [0]",
can be printed frequently when operating in software scanning mode.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl-3945.c     |    2 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c     |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-rxon.c |    5 ++---
 drivers/net/wireless/iwlwifi/iwl-core.c     |   13 ++++++++++---
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 39b6f16..4e7b58b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -1823,7 +1823,7 @@ int iwl3945_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 
 	/* If we issue a new RXON command which required a tune then we must
 	 * send a new TXPOWER command or we won't be able to Tx any frames */
-	rc = priv->cfg->ops->lib->send_tx_power(priv);
+	rc = iwl_set_tx_power(priv, priv->tx_power_next, true);
 	if (rc) {
 		IWL_ERR(priv, "Error setting Tx power (%d).\n", rc);
 		return rc;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 91a9f52..992caa0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -1571,7 +1571,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
 
 	/* If we issue a new RXON command which required a tune then we must
 	 * send a new TXPOWER command or we won't be able to Tx any frames */
-	ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
+	ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
 	if (ret) {
 		IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
 		return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 6d140bd..ee802fe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -288,10 +288,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 	 * If we issue a new RXON command which required a tune then we must
 	 * send a new TXPOWER command or we won't be able to Tx any frames.
 	 *
-	 * FIXME: which RXON requires a tune? Can we optimise this out in
-	 *        some cases?
+	 * It's expected we set power here if channel is changing.
 	 */
-	ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
+	ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
 	if (ret) {
 		IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
 		return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index efbde1f..91cac6f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1161,6 +1161,8 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
 {
 	int ret;
 	s8 prev_tx_power;
+	bool defer;
+	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
 
 	lockdep_assert_held(&priv->mutex);
 
@@ -1188,10 +1190,15 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
 	if (!iwl_is_ready_rf(priv))
 		return -EIO;
 
-	/* scan complete use tx_power_next, need to be updated */
+	/* scan complete and commit_rxon use tx_power_next value,
+	 * it always need to be updated for newest request */
 	priv->tx_power_next = tx_power;
-	if (test_bit(STATUS_SCANNING, &priv->status) && !force) {
-		IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n");
+
+	/* do not set tx power when scanning or channel changing */
+	defer = test_bit(STATUS_SCANNING, &priv->status) ||
+		memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging));
+	if (defer && !force) {
+		IWL_DEBUG_INFO(priv, "Deferring tx power set\n");
 		return 0;
 	}
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2.6.38 2/4] iwl3945: do not deprecate software scan
  2011-04-28 12:08 [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Stanislaw Gruszka
  2011-04-28 12:08 ` [PATCH 2.6.38 1/4] iwlwifi: do not set tx power when channel is changing Stanislaw Gruszka
@ 2011-04-28 12:08 ` Stanislaw Gruszka
  2011-04-28 12:08 ` [PATCH 2.6.38 3/4] iwl3945: disable hw scan by default Stanislaw Gruszka
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Stanislaw Gruszka @ 2011-04-28 12:08 UTC (permalink / raw)
  To: stable, kernel; +Cc: Stanislaw Gruszka, Kyle McMartin, linux-wireless

commit 3bda50e3eaf58a4b9c4ce34204e5faa15c8b1b97 upstream.

Software scanning can be used for workaround some performance problems,
so do not deprecate it.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 371abbf..cf0699a 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3995,8 +3995,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
 	 * "the hard way", rather than using device's scan.
 	 */
 	if (iwl3945_mod_params.disable_hw_scan) {
-		dev_printk(KERN_DEBUG, &(pdev->dev),
-			"sw scan support is deprecated\n");
+		IWL_DEBUG_INFO(priv, "Disabling hw_scan\n");
 		iwl3945_hw_ops.hw_scan = NULL;
 	}
 
@@ -4318,8 +4317,7 @@ MODULE_PARM_DESC(debug, "debug output mask");
 #endif
 module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan,
 		   int, S_IRUGO);
-MODULE_PARM_DESC(disable_hw_scan,
-		 "disable hardware scanning (default 0) (deprecated)");
+MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
 module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, S_IRUGO);
 MODULE_PARM_DESC(fw_restart3945, "restart firmware in case of error");
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2.6.38 3/4] iwl3945: disable hw scan by default
  2011-04-28 12:08 [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Stanislaw Gruszka
  2011-04-28 12:08 ` [PATCH 2.6.38 1/4] iwlwifi: do not set tx power when channel is changing Stanislaw Gruszka
  2011-04-28 12:08 ` [PATCH 2.6.38 2/4] iwl3945: do not deprecate software scan Stanislaw Gruszka
@ 2011-04-28 12:08 ` Stanislaw Gruszka
  2011-04-29 17:41   ` Dan Williams
  2011-04-28 12:08 ` [PATCH 2.6.38 4/4] iwlwifi: fix tx_power initialization Stanislaw Gruszka
  2011-04-29 16:23 ` [stable] [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Greg KH
  4 siblings, 1 reply; 8+ messages in thread
From: Stanislaw Gruszka @ 2011-04-28 12:08 UTC (permalink / raw)
  To: stable, kernel; +Cc: Stanislaw Gruszka, Kyle McMartin, linux-wireless

commit 0263aa45293838b514b8af674a03faf040991a90 upstream.

After new NetworkManager 0.8.996 changes, hardware scanning is causing
microcode errors as reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=683571
and sometimes kernel crashes:
https://bugzilla.redhat.com/show_bug.cgi?id=688252

Also with hw scan there are very bad performance on some systems
as reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=671366

Since Intel no longer supports 3945, there is no chance to get proper
firmware fixes, we need workaround problems by disable hardware scanning
by default.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index cf0699a..a8340f7 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -94,6 +94,7 @@ MODULE_LICENSE("GPL");
 struct iwl_mod_params iwl3945_mod_params = {
 	.sw_crypto = 1,
 	.restart_fw = 1,
+	.disable_hw_scan = 1,
 	/* the rest are 0 by default */
 };
 
@@ -4317,7 +4318,7 @@ MODULE_PARM_DESC(debug, "debug output mask");
 #endif
 module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan,
 		   int, S_IRUGO);
-MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
+MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 1)");
 module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, S_IRUGO);
 MODULE_PARM_DESC(fw_restart3945, "restart firmware in case of error");
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2.6.38 4/4] iwlwifi: fix tx_power initialization
  2011-04-28 12:08 [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Stanislaw Gruszka
                   ` (2 preceding siblings ...)
  2011-04-28 12:08 ` [PATCH 2.6.38 3/4] iwl3945: disable hw scan by default Stanislaw Gruszka
@ 2011-04-28 12:08 ` Stanislaw Gruszka
  2011-04-29 16:23 ` [stable] [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Greg KH
  4 siblings, 0 replies; 8+ messages in thread
From: Stanislaw Gruszka @ 2011-04-28 12:08 UTC (permalink / raw)
  To: stable, kernel; +Cc: Stanislaw Gruszka, Kyle McMartin, linux-wireless

commit 332704a51498a7e29aa92c19dc03f11f80b71bfe upstream.

priv->tx_power_next is not initialized to max supported power,
but instead default value is used, what cause errors like

[   58.597834] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
[   58.597839] iwl3945 0000:03:00.0: Error setting Tx power (-22).

if maximum tx power read from the eeprom is smaller than default.
In consequence card is unable to initialize properly. Fix the problem
and cleanup tx power initialization.

Reported-and-tested-by: Robin Dong <hao.bigrat@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl-3945-hw.h  |    2 --
 drivers/net/wireless/iwlwifi/iwl-agn.c      |    6 ------
 drivers/net/wireless/iwlwifi/iwl-core.c     |    9 +++++++--
 drivers/net/wireless/iwlwifi/iwl-eeprom.c   |    7 -------
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    4 ----
 5 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
index 65b5834..c2dd4cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
@@ -74,8 +74,6 @@
 /* RSSI to dBm */
 #define IWL39_RSSI_OFFSET	95
 
-#define IWL_DEFAULT_TX_POWER	0x0F
-
 /*
  * EEPROM related constants, enums, and structures.
  */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index c1cfd99..35239f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3841,12 +3841,6 @@ static int iwl_init_drv(struct iwl_priv *priv)
 		priv->dynamic_frag_thresh = BT_FRAG_THRESHOLD_DEF;
 	}
 
-	/* Set the tx_power_user_lmt to the lowest power level
-	 * this value will get overwritten by channel max power avg
-	 * from eeprom */
-	priv->tx_power_user_lmt = IWLAGN_TX_POWER_TARGET_POWER_MIN;
-	priv->tx_power_next = IWLAGN_TX_POWER_TARGET_POWER_MIN;
-
 	ret = iwl_init_channel_map(priv);
 	if (ret) {
 		IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 91cac6f..294e9fc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -168,6 +168,7 @@ int iwlcore_init_geos(struct iwl_priv *priv)
 	struct ieee80211_channel *geo_ch;
 	struct ieee80211_rate *rates;
 	int i = 0;
+	s8 max_tx_power = 0;
 
 	if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
 	    priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
@@ -244,8 +245,8 @@ int iwlcore_init_geos(struct iwl_priv *priv)
 
 			geo_ch->flags |= ch->ht40_extension_channel;
 
-			if (ch->max_power_avg > priv->tx_power_device_lmt)
-				priv->tx_power_device_lmt = ch->max_power_avg;
+			if (ch->max_power_avg > max_tx_power)
+				max_tx_power = ch->max_power_avg;
 		} else {
 			geo_ch->flags |= IEEE80211_CHAN_DISABLED;
 		}
@@ -258,6 +259,10 @@ int iwlcore_init_geos(struct iwl_priv *priv)
 				 geo_ch->flags);
 	}
 
+	priv->tx_power_device_lmt = max_tx_power;
+	priv->tx_power_user_lmt = max_tx_power;
+	priv->tx_power_next = max_tx_power;
+
 	if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
 	     priv->cfg->sku & IWL_SKU_A) {
 		IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 358cfd7..8b3c127 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -724,13 +724,6 @@ int iwl_init_channel_map(struct iwl_priv *priv)
 					     flags & EEPROM_CHANNEL_RADAR))
 				       ? "" : "not ");
 
-			/* Set the tx_power_user_lmt to the highest power
-			 * supported by any channel */
-			if (eeprom_ch_info[ch].max_power_avg >
-						priv->tx_power_user_lmt)
-				priv->tx_power_user_lmt =
-				    eeprom_ch_info[ch].max_power_avg;
-
 			ch_info++;
 		}
 	}
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a8340f7..64917ed 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3859,10 +3859,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
 	priv->force_reset[IWL_FW_RESET].reset_duration =
 		IWL_DELAY_NEXT_FORCE_FW_RELOAD;
 
-
-	priv->tx_power_user_lmt = IWL_DEFAULT_TX_POWER;
-	priv->tx_power_next = IWL_DEFAULT_TX_POWER;
-
 	if (eeprom->version < EEPROM_3945_EEPROM_VERSION) {
 		IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n",
 			 eeprom->version);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.38 1/4] iwlwifi: do not set tx power when channel is changing
  2011-04-28 12:08 ` [PATCH 2.6.38 1/4] iwlwifi: do not set tx power when channel is changing Stanislaw Gruszka
@ 2011-04-28 14:42   ` Guy, Wey-Yi
  0 siblings, 0 replies; 8+ messages in thread
From: Guy, Wey-Yi @ 2011-04-28 14:42 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: stable@kernel.org, kernel@lists.fedoraproject.org, Kyle McMartin,
	linux-wireless@vger.kernel.org

On Thu, 2011-04-28 at 05:08 -0700, Stanislaw Gruszka wrote:
> commit f844a709a7d8f8be61a571afc31dfaca9e779621 upstream.
> 
> Mac80211 can request for tx power and channel change in one ->config
> call. If that happens, *_send_tx_power functions will try to setup tx
> power for old channel, what can be not correct because we already change
> the band. I.e  error  "Failed to get channel info for channel 140 [0]",
> can be printed frequently when operating in software scanning mode.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-3945.c     |    2 +-
>  drivers/net/wireless/iwlwifi/iwl-4965.c     |    2 +-
>  drivers/net/wireless/iwlwifi/iwl-agn-rxon.c |    5 ++---
>  drivers/net/wireless/iwlwifi/iwl-core.c     |   13 ++++++++++---
>  4 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> index 39b6f16..4e7b58b 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> @@ -1823,7 +1823,7 @@ int iwl3945_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
>  
>  	/* If we issue a new RXON command which required a tune then we must
>  	 * send a new TXPOWER command or we won't be able to Tx any frames */
> -	rc = priv->cfg->ops->lib->send_tx_power(priv);
> +	rc = iwl_set_tx_power(priv, priv->tx_power_next, true);
>  	if (rc) {
>  		IWL_ERR(priv, "Error setting Tx power (%d).\n", rc);
>  		return rc;
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
> index 91a9f52..992caa0 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-4965.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
> @@ -1571,7 +1571,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
>  
>  	/* If we issue a new RXON command which required a tune then we must
>  	 * send a new TXPOWER command or we won't be able to Tx any frames */
> -	ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
> +	ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
>  	if (ret) {
>  		IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
>  		return ret;
> diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
> index 6d140bd..ee802fe 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
> @@ -288,10 +288,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
>  	 * If we issue a new RXON command which required a tune then we must
>  	 * send a new TXPOWER command or we won't be able to Tx any frames.
>  	 *
> -	 * FIXME: which RXON requires a tune? Can we optimise this out in
> -	 *        some cases?
> +	 * It's expected we set power here if channel is changing.
>  	 */
> -	ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
> +	ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
>  	if (ret) {
>  		IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
>  		return ret;
> diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
> index efbde1f..91cac6f 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-core.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-core.c
> @@ -1161,6 +1161,8 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
>  {
>  	int ret;
>  	s8 prev_tx_power;
> +	bool defer;
> +	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
>  
>  	lockdep_assert_held(&priv->mutex);
>  
> @@ -1188,10 +1190,15 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
>  	if (!iwl_is_ready_rf(priv))
>  		return -EIO;
>  
> -	/* scan complete use tx_power_next, need to be updated */
> +	/* scan complete and commit_rxon use tx_power_next value,
> +	 * it always need to be updated for newest request */
>  	priv->tx_power_next = tx_power;
> -	if (test_bit(STATUS_SCANNING, &priv->status) && !force) {
> -		IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n");
> +
> +	/* do not set tx power when scanning or channel changing */
> +	defer = test_bit(STATUS_SCANNING, &priv->status) ||
> +		memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging));
> +	if (defer && !force) {
> +		IWL_DEBUG_INFO(priv, "Deferring tx power set\n");
>  		return 0;
>  	}
>  



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [stable] [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems
  2011-04-28 12:08 [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Stanislaw Gruszka
                   ` (3 preceding siblings ...)
  2011-04-28 12:08 ` [PATCH 2.6.38 4/4] iwlwifi: fix tx_power initialization Stanislaw Gruszka
@ 2011-04-29 16:23 ` Greg KH
  4 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2011-04-29 16:23 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: stable, kernel, linux-wireless, Kyle McMartin

On Thu, Apr 28, 2011 at 02:08:11PM +0200, Stanislaw Gruszka wrote:
> This patchset fixes several problems related with hw scanning
> on 3945 (see patch 3 for details). It is intended to 2.6.38,
> on older kernels software scanning does not work. All patches
> are currently in Linus' tree.

Now queued up.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.38 3/4] iwl3945: disable hw scan by default
  2011-04-28 12:08 ` [PATCH 2.6.38 3/4] iwl3945: disable hw scan by default Stanislaw Gruszka
@ 2011-04-29 17:41   ` Dan Williams
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Williams @ 2011-04-29 17:41 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: stable, kernel, Kyle McMartin, linux-wireless

On Thu, 2011-04-28 at 14:08 +0200, Stanislaw Gruszka wrote:
> commit 0263aa45293838b514b8af674a03faf040991a90 upstream.
> 
> After new NetworkManager 0.8.996 changes, hardware scanning is causing
> microcode errors as reported here:
> https://bugzilla.redhat.com/show_bug.cgi?id=683571
> and sometimes kernel crashes:
> https://bugzilla.redhat.com/show_bug.cgi?id=688252

Note that the only difference with NM 0.8.996 here is that
wpa_supplicant 0.7 + nl80211 is used rather than WEXT, so this issue is
likely related to the change from WEXT -> nl80211, if anything...

Dan

> Also with hw scan there are very bad performance on some systems
> as reported here:
> https://bugzilla.redhat.com/show_bug.cgi?id=671366
> 
> Since Intel no longer supports 3945, there is no chance to get proper
> firmware fixes, we need workaround problems by disable hardware scanning
> by default.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl3945-base.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> index cf0699a..a8340f7 100644
> --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> @@ -94,6 +94,7 @@ MODULE_LICENSE("GPL");
>  struct iwl_mod_params iwl3945_mod_params = {
>  	.sw_crypto = 1,
>  	.restart_fw = 1,
> +	.disable_hw_scan = 1,
>  	/* the rest are 0 by default */
>  };
>  
> @@ -4317,7 +4318,7 @@ MODULE_PARM_DESC(debug, "debug output mask");
>  #endif
>  module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan,
>  		   int, S_IRUGO);
> -MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
> +MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 1)");
>  module_param_named(fw_restart3945, iwl3945_mod_params.restart_fw, int, S_IRUGO);
>  MODULE_PARM_DESC(fw_restart3945, "restart firmware in case of error");
>  



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-29 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 12:08 [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Stanislaw Gruszka
2011-04-28 12:08 ` [PATCH 2.6.38 1/4] iwlwifi: do not set tx power when channel is changing Stanislaw Gruszka
2011-04-28 14:42   ` Guy, Wey-Yi
2011-04-28 12:08 ` [PATCH 2.6.38 2/4] iwl3945: do not deprecate software scan Stanislaw Gruszka
2011-04-28 12:08 ` [PATCH 2.6.38 3/4] iwl3945: disable hw scan by default Stanislaw Gruszka
2011-04-29 17:41   ` Dan Williams
2011-04-28 12:08 ` [PATCH 2.6.38 4/4] iwlwifi: fix tx_power initialization Stanislaw Gruszka
2011-04-29 16:23 ` [stable] [PATCH 2.6.38 0/4] iwlwifi: fix hw scan related problems Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).