diff options
author | Zhu Yi <yi.zhu@intel.com> | 2010-04-02 16:38:54 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-04-09 15:41:26 -0400 |
commit | 470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 (patch) | |
tree | 1d539469c372b2cca3a8c11a1913b527819dad0b /drivers/net/wireless/iwlwifi/iwl-tx.c | |
parent | 57e40d36e59f828f43d60b2662041991dcd78044 (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-tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index aea6a2eee9c3..c3c6505a8c69 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -394,6 +394,26 @@ out_free_arrays: | |||
394 | } | 394 | } |
395 | EXPORT_SYMBOL(iwl_tx_queue_init); | 395 | EXPORT_SYMBOL(iwl_tx_queue_init); |
396 | 396 | ||
397 | void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq, | ||
398 | int slots_num, u32 txq_id) | ||
399 | { | ||
400 | int actual_slots = slots_num; | ||
401 | |||
402 | if (txq_id == IWL_CMD_QUEUE_NUM) | ||
403 | actual_slots++; | ||
404 | |||
405 | memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots); | ||
406 | |||
407 | txq->need_update = 0; | ||
408 | |||
409 | /* Initialize queue's high/low-water marks, and head/tail indexes */ | ||
410 | iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id); | ||
411 | |||
412 | /* Tell device where to find queue */ | ||
413 | priv->cfg->ops->lib->txq_init(priv, txq); | ||
414 | } | ||
415 | EXPORT_SYMBOL(iwl_tx_queue_reset); | ||
416 | |||
397 | /*************** HOST COMMAND QUEUE FUNCTIONS *****/ | 417 | /*************** HOST COMMAND QUEUE FUNCTIONS *****/ |
398 | 418 | ||
399 | /** | 419 | /** |