]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iwlwifi: mvm: wake the wait queue when the RX sync counter is zero
authorSara Sharon <sara.sharon@intel.com>
Sun, 9 Oct 2016 14:34:24 +0000 (17:34 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 19 Oct 2016 05:50:52 +0000 (08:50 +0300)
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>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index 318efd8140375c1ff26e6387b225bea2f3fbe6e2..1db1dc13e988a93e71cbc18c02dc8ee3174b9905 100644 (file)
@@ -4121,7 +4121,6 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
                                     struct iwl_mvm_internal_rxq_notif *notif,
                                     u32 size)
 {
-       DECLARE_WAIT_QUEUE_HEAD_ONSTACK(notif_waitq);
        u32 qmask = BIT(mvm->trans->num_rx_queues) - 1;
        int ret;
 
@@ -4143,7 +4142,7 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
        }
 
        if (notif->sync)
-               ret = wait_event_timeout(notif_waitq,
+               ret = wait_event_timeout(mvm->rx_sync_waitq,
                                         atomic_read(&mvm->queue_sync_counter) == 0,
                                         HZ);
        WARN_ON_ONCE(!ret);
index d17cbf603f7c7b488e6a7be366a5aeed6f9f4775..c60703e0c246731cc3976dbe03f1f6fabe76f028 100644 (file)
@@ -937,6 +937,7 @@ struct iwl_mvm {
        /* sync d0i3_tx queue and IWL_MVM_STATUS_IN_D0I3 status flag */
        spinlock_t d0i3_tx_lock;
        wait_queue_head_t d0i3_exit_waitq;
+       wait_queue_head_t rx_sync_waitq;
 
        /* BT-Coex */
        struct iwl_bt_coex_profile_notif last_bt_notif;
index 05fe6dd1a2c81652330aec05f743f50bae59bca5..4d35deb628bcaae711851a7e4acaf158883b57f0 100644 (file)
@@ -619,6 +619,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        spin_lock_init(&mvm->refs_lock);
        skb_queue_head_init(&mvm->d0i3_tx);
        init_waitqueue_head(&mvm->d0i3_exit_waitq);
+       init_waitqueue_head(&mvm->rx_sync_waitq);
 
        atomic_set(&mvm->queue_sync_counter, 0);
 
index a57c6ef5bc14f4cd7dd61df53682b18a9c6f7d3a..6c802cee900c925a7734e6a8f461a24f71c5ede6 100644 (file)
@@ -547,7 +547,8 @@ void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
                                  "Received expired RX queue sync message\n");
                        return;
                }
-               atomic_dec(&mvm->queue_sync_counter);
+               if (!atomic_dec_return(&mvm->queue_sync_counter))
+                       wake_up(&mvm->rx_sync_waitq);
        }
 
        switch (internal_notif->type) {