From e0498146c8792b1ebc321c0e29e633b6a0918a6e Mon Sep 17 00:00:00 2001
From: Sara Sharon <sara.sharon@intel.com>
Date: Thu, 4 Jan 2018 13:53:55 +0200
Subject: [PATCH] iwlwifi: pcie: allocate shorter TX queues for 22000 devices
Git-commit: e0498146c8792b1ebc321c0e29e633b6a0918a6e
Patch-mainline: v4.18-rc1
References: FATE#326294
When support for shorter TX queues was introduced, it
didn't include the actual allocation of shorter queue,
which is the main motive for the change.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 2 +-
drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -994,7 +994,7 @@ static void iwl_pcie_gen2_txq_free_memor
/* De-alloc circular buffer of TFDs */
if (txq->tfds) {
dma_free_coherent(dev,
- trans_pcie->tfd_size * TFD_QUEUE_SIZE_MAX,
+ trans_pcie->tfd_size * txq->n_window,
txq->tfds, txq->dma_addr);
dma_free_coherent(dev,
sizeof(*txq->first_tb_bufs) * txq->n_window,
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -495,6 +495,9 @@ int iwl_pcie_txq_alloc(struct iwl_trans
if (WARN_ON(txq->entries || txq->tfds))
return -EINVAL;
+ if (trans->cfg->use_tfh)
+ tfd_sz = trans_pcie->tfd_size * slots_num;
+
setup_timer(&txq->stuck_timer, iwl_pcie_txq_stuck_timer,
(unsigned long)txq);
txq->trans_pcie = trans_pcie;