]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: pcie: fix erroneous print
authorSara Sharon <sara.sharon@intel.com>
Thu, 16 Aug 2018 10:01:09 +0000 (13:01 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 14 Dec 2018 11:04:47 +0000 (13:04 +0200)
When removing the driver, the following flow can happen:
1. host command is in progress, for example at index 68.
2. RX interrupt is received with the response.
3. Before it is processed, the remove flow kicks in, and
   calls iwl_pcie_txq_unmap. The function cleans all DMA,
   and promotes the read pointer to 69.
4. RX thread proceeds with the processing, and is calling
   iwl_pcie_cmdq_reclaim, which will print this error:
   iwl_pcie_cmdq_reclaim: Read index for DMA queue txq id (0),
   index 4 is out of range [0-256] 69 69.

Detect this situation, and avoid the print. Change it to
warning while at it, to make such issues more noticeable
in the future.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx.c

index 87b7225fe2898da2ee864bdb219c8f74acc7470f..3d53842ee60e0a408cea69f759bab5181c70ff41 100644 (file)
@@ -1245,11 +1245,11 @@ void iwl_pcie_cmdq_reclaim(struct iwl_trans *trans, int txq_id, int idx)
 
        if (idx >= trans->cfg->base_params->max_tfd_queue_size ||
            (!iwl_queue_used(txq, idx))) {
-               IWL_ERR(trans,
-                       "%s: Read index for DMA queue txq id (%d), index %d is out of range [0-%d] %d %d.\n",
-                       __func__, txq_id, idx,
-                       trans->cfg->base_params->max_tfd_queue_size,
-                       txq->write_ptr, txq->read_ptr);
+               WARN_ONCE(test_bit(txq_id, trans_pcie->queue_used),
+                         "%s: Read index for DMA queue txq id (%d), index %d is out of range [0-%d] %d %d.\n",
+                         __func__, txq_id, idx,
+                         trans->cfg->base_params->max_tfd_queue_size,
+                         txq->write_ptr, txq->read_ptr);
                return;
        }