Intel recomends to include those two patches in Fedora.
Emmanuel Grumbach (2): iwlwifi: pcie: fix race in queue unmapping iwlwifi: pcie: wake the queue if stopped when being unmapped
drivers/net/wireless/iwlwifi/pcie/tx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
From: Emmanuel Grumbach emmanuel.grumbach@intel.com
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 emmanuel.grumbach@intel.com Signed-off-by: Johannes Berg johannes.berg@intel.com --- 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); }
From: Emmanuel Grumbach emmanuel.grumbach@intel.com
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 emmanuel.grumbach@intel.com Signed-off-by: Johannes Berg johannes.berg@intel.com --- 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); }
/*
On Fri, Jun 21, 2013 at 03:21:50PM +0200, Stanislaw Gruszka wrote:
Intel recomends to include those two patches in Fedora.
Emmanuel Grumbach (2): iwlwifi: pcie: fix race in queue unmapping iwlwifi: pcie: wake the queue if stopped when being unmapped
drivers/net/wireless/iwlwifi/pcie/tx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Ok. I can grab these.
They don't seem to be in the net_39.mbox that DaveM sent to stable a couple days ago. Are they still in someone else's tree at the moment?
josh
On Fri, Jun 21, 2013 at 09:29:03AM -0400, Josh Boyer wrote:
On Fri, Jun 21, 2013 at 03:21:50PM +0200, Stanislaw Gruszka wrote:
Intel recomends to include those two patches in Fedora.
Emmanuel Grumbach (2): iwlwifi: pcie: fix race in queue unmapping iwlwifi: pcie: wake the queue if stopped when being unmapped
drivers/net/wireless/iwlwifi/pcie/tx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Ok. I can grab these.
They don't seem to be in the net_39.mbox that DaveM sent to stable a couple days ago. Are they still in someone else's tree at the moment?
They were refused by upstream maintainers as fixes proper to 3.10-rc5 or later -rc. Instead patches were pushed to -next and queued to 3.11. Anyway fixes are small, look sane and are intended to -stable.
Stanislaw
On Fri, Jun 21, 2013 at 03:51:16PM +0200, Stanislaw Gruszka wrote:
On Fri, Jun 21, 2013 at 09:29:03AM -0400, Josh Boyer wrote:
On Fri, Jun 21, 2013 at 03:21:50PM +0200, Stanislaw Gruszka wrote:
Intel recomends to include those two patches in Fedora.
Emmanuel Grumbach (2): iwlwifi: pcie: fix race in queue unmapping iwlwifi: pcie: wake the queue if stopped when being unmapped
drivers/net/wireless/iwlwifi/pcie/tx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Ok. I can grab these.
They don't seem to be in the net_39.mbox that DaveM sent to stable a couple days ago. Are they still in someone else's tree at the moment?
They were refused by upstream maintainers as fixes proper to 3.10-rc5 or later -rc. Instead patches were pushed to -next and queued to 3.11. Anyway fixes are small, look sane and are intended to -stable.
OK. I've applied them to all branches on 3.9. Thanks!
josh
kernel@lists.fedoraproject.org