diff --git a/iwlwifi-pcie-fix-race-in-queue-unmapping.patch b/iwlwifi-pcie-fix-race-in-queue-unmapping.patch new file mode 100644 index 0000000..ad9194a --- /dev/null +++ b/iwlwifi-pcie-fix-race-in-queue-unmapping.patch @@ -0,0 +1,56 @@ +From: Emmanuel Grumbach + +When a queue is disabled, it frees all its entries. Later, +the op_mode might still get notifications from the firmware +that triggers to free entries in the tx queue. The transport +should be prepared for these races and know to ignore +reclaim calls on queues that have been disabled and whose +entries have been freed. + +Cc: stable@vger.kernel.org +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Johannes Berg +--- + drivers/net/wireless/iwlwifi/pcie/tx.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c +index cb5c679..faaf77c 100644 +--- a/drivers/net/wireless/iwlwifi/pcie/tx.c ++++ b/drivers/net/wireless/iwlwifi/pcie/tx.c +@@ -578,9 +578,12 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id) + + spin_lock_bh(&txq->lock); + while (q->write_ptr != q->read_ptr) { ++ IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n", ++ txq_id, q->read_ptr); + iwl_pcie_txq_free_tfd(trans, txq); + q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd); + } ++ txq->active = false; + spin_unlock_bh(&txq->lock); + } + +@@ -929,6 +932,12 @@ void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn, + + spin_lock_bh(&txq->lock); + ++ if (!txq->active) { ++ IWL_DEBUG_TX_QUEUES(trans, "Q %d inactive - ignoring idx %d\n", ++ txq_id, ssn); ++ goto out; ++ } ++ + if (txq->q.read_ptr == tfd_num) + goto out; + +@@ -1105,6 +1114,7 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo, + (fifo << SCD_QUEUE_STTS_REG_POS_TXF) | + (1 << SCD_QUEUE_STTS_REG_POS_WSL) | + SCD_QUEUE_STTS_REG_MSK); ++ trans_pcie->txq[txq_id].active = true; + IWL_DEBUG_TX_QUEUES(trans, "Activate queue %d on FIFO %d WrPtr: %d\n", + txq_id, fifo, ssn & 0xff); + } +-- +1.7.11.7 diff --git a/iwlwifi-pcie-wake-the-queue-if-stopped-when-being-unmapped.patch b/iwlwifi-pcie-wake-the-queue-if-stopped-when-being-unmapped.patch new file mode 100644 index 0000000..661fc50 --- /dev/null +++ b/iwlwifi-pcie-wake-the-queue-if-stopped-when-being-unmapped.patch @@ -0,0 +1,35 @@ +From: Emmanuel Grumbach + +When the queue is unmapped while it was so loaded that +mac80211's was stopped, we need to wake the queue after +having freed all the packets in the queue. +Not doing so can result in weird stuff like: + +* run lots of traffic (mac80211's queue gets stopped) +* RFKILL +* de-assert RFKILL +* no traffic + +Cc: stable@vger.kernel.org +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Johannes Berg +--- + drivers/net/wireless/iwlwifi/pcie/tx.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c +index faaf77c..4e7b8d4 100644 +--- a/drivers/net/wireless/iwlwifi/pcie/tx.c ++++ b/drivers/net/wireless/iwlwifi/pcie/tx.c +@@ -585,6 +585,9 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id) + } + txq->active = false; + spin_unlock_bh(&txq->lock); ++ ++ /* just in case - this queue may have been stopped */ ++ iwl_wake_queue(trans, txq); + } + + /* +-- +1.7.11.7 diff --git a/kernel.spec b/kernel.spec index 3387bf5..c12ad6b 100644 --- a/kernel.spec +++ b/kernel.spec @@ -769,6 +769,9 @@ Patch25046: KVM-x86-handle-idiv-overflow-at-kvm_write_tsc.patch #rhbz 967271 Patch25049: carl9170-fix-frame-drop-and-WARN-due-to-minstrel_ht-.patch +Patch25050: iwlwifi-pcie-fix-race-in-queue-unmapping.patch +Patch25051: iwlwifi-pcie-wake-the-queue-if-stopped-when-being-unmapped.patch + # END OF PATCH DEFINITIONS %endif @@ -1492,6 +1495,9 @@ ApplyPatch KVM-x86-handle-idiv-overflow-at-kvm_write_tsc.patch #rhbz 967271 ApplyPatch carl9170-fix-frame-drop-and-WARN-due-to-minstrel_ht-.patch +ApplyPatch iwlwifi-pcie-fix-race-in-queue-unmapping.patch +ApplyPatch iwlwifi-pcie-wake-the-queue-if-stopped-when-being-unmapped.patch + # END OF PATCH APPLICATIONS %endif @@ -2344,6 +2350,7 @@ fi # '-' %changelog * Fri Jun 21 2013 Josh Boyer +- Add two patches to fix iwlwifi issues in unmapping - Add patch to fix carl9170 oops (rhbz 967271) * Thu Jun 20 2013 Justin M. Forbes