aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2010-04-02 16:38:54 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-04-09 15:41:26 -0400
commit470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 (patch)
tree1d539469c372b2cca3a8c11a1913b527819dad0b /drivers/net/wireless/iwlwifi/iwl-agn-lib.c
parent57e40d36e59f828f43d60b2662041991dcd78044 (diff)
iwlwifi: avoid Tx queue memory allocation in interface down
We used to free all the Tx queues memory when interface is brought down and reallocate them again in interface up. This requires order-4 allocation for txq->cmd[]. In situations like s2ram, this usually leads to allocation failure in the memory subsystem. The patch fixed this problem by allocating the Tx queues memory only at the first time. Later iwl_down/iwl_up only initialize but don't free and reallocate them. The memory is freed at the device removal time. BTW, we have already done this for the Rx queue. This fixed bug https://bugzilla.kernel.org/show_bug.cgi?id=15551 Signed-off-by: Zhu Yi <yi.zhu@intel.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 384b45c519f1..c465c8590833 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -512,10 +512,13 @@ int iwlagn_hw_nic_init(struct iwl_priv *priv)
512 512
513 spin_unlock_irqrestore(&priv->lock, flags); 513 spin_unlock_irqrestore(&priv->lock, flags);
514 514
515 /* Allocate and init all Tx and Command queues */ 515 /* Allocate or reset and init all Tx and Command queues */
516 ret = iwlagn_txq_ctx_reset(priv); 516 if (!priv->txq) {
517 if (ret) 517 ret = iwlagn_txq_ctx_alloc(priv);
518 return ret; 518 if (ret)
519 return ret;
520 } else
521 iwlagn_txq_ctx_reset(priv);
519 522
520 set_bit(STATUS_INIT, &priv->status); 523 set_bit(STATUS_INIT, &priv->status);
521 524