aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSara Sharon <sara.sharon@intel.com>2016-10-09 10:34:24 -0400
committerLuca Coelho <luciano.coelho@intel.com>2016-10-19 01:50:52 -0400
commit3a732c65de427fdae67a243fd331356034b5a1e8 (patch)
treefc046b16a339fcabb803d09c5e4f988cebdfe604
parent5bfadc8255e2cd92be7538fd7dfa777c27f58be0 (diff)
iwlwifi: mvm: wake the wait queue when the RX sync counter is zero
When we sync the RX queues the driver waits to receive echo notification on all the RX queues. The wait queue is set with timeout until all queues have received the notification. However, iwl_mvm_rx_queue_notif() never woke up the wait queue, with the result of the counter value being checked only when the timeout expired. This may cause a latency of up to 1 second. Fixes: 0636b938214c ("iwlwifi: mvm: implement driver RX queues sync command") Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c3
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mvm.h1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/ops.c1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c3
4 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 318efd814037..1db1dc13e988 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -4121,7 +4121,6 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
4121 struct iwl_mvm_internal_rxq_notif *notif, 4121 struct iwl_mvm_internal_rxq_notif *notif,
4122 u32 size) 4122 u32 size)
4123{ 4123{
4124 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(notif_waitq);
4125 u32 qmask = BIT(mvm->trans->num_rx_queues) - 1; 4124 u32 qmask = BIT(mvm->trans->num_rx_queues) - 1;
4126 int ret; 4125 int ret;
4127 4126
@@ -4143,7 +4142,7 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
4143 } 4142 }
4144 4143
4145 if (notif->sync) 4144 if (notif->sync)
4146 ret = wait_event_timeout(notif_waitq, 4145 ret = wait_event_timeout(mvm->rx_sync_waitq,
4147 atomic_read(&mvm->queue_sync_counter) == 0, 4146 atomic_read(&mvm->queue_sync_counter) == 0,
4148 HZ); 4147 HZ);
4149 WARN_ON_ONCE(!ret); 4148 WARN_ON_ONCE(!ret);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index d17cbf603f7c..c60703e0c246 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -937,6 +937,7 @@ struct iwl_mvm {
937 /* sync d0i3_tx queue and IWL_MVM_STATUS_IN_D0I3 status flag */ 937 /* sync d0i3_tx queue and IWL_MVM_STATUS_IN_D0I3 status flag */
938 spinlock_t d0i3_tx_lock; 938 spinlock_t d0i3_tx_lock;
939 wait_queue_head_t d0i3_exit_waitq; 939 wait_queue_head_t d0i3_exit_waitq;
940 wait_queue_head_t rx_sync_waitq;
940 941
941 /* BT-Coex */ 942 /* BT-Coex */
942 struct iwl_bt_coex_profile_notif last_bt_notif; 943 struct iwl_bt_coex_profile_notif last_bt_notif;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 05fe6dd1a2c8..4d35deb628bc 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -619,6 +619,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
619 spin_lock_init(&mvm->refs_lock); 619 spin_lock_init(&mvm->refs_lock);
620 skb_queue_head_init(&mvm->d0i3_tx); 620 skb_queue_head_init(&mvm->d0i3_tx);
621 init_waitqueue_head(&mvm->d0i3_exit_waitq); 621 init_waitqueue_head(&mvm->d0i3_exit_waitq);
622 init_waitqueue_head(&mvm->rx_sync_waitq);
622 623
623 atomic_set(&mvm->queue_sync_counter, 0); 624 atomic_set(&mvm->queue_sync_counter, 0);
624 625
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index a57c6ef5bc14..6c802cee900c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -547,7 +547,8 @@ void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
547 "Received expired RX queue sync message\n"); 547 "Received expired RX queue sync message\n");
548 return; 548 return;
549 } 549 }
550 atomic_dec(&mvm->queue_sync_counter); 550 if (!atomic_dec_return(&mvm->queue_sync_counter))
551 wake_up(&mvm->rx_sync_waitq);
551 } 552 }
552 553
553 switch (internal_notif->type) { 554 switch (internal_notif->type) {