]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iwlwifi: mvm: fix a race in D0i3 vs. Tx path
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 17 Aug 2015 12:54:41 +0000 (15:54 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 18 Aug 2015 07:25:26 +0000 (10:25 +0300)
When we enter D0i3, we must stop TXing otherwise the
sequence number we use might conflict with the firmware's
internal TX. In order to do so, we have
IWL_MVM_STATUS_IN_D0I3 which should prevent any Tx while we
enter D0i3. There is a bug in this code since we may Tx even
if IWL_MVM_STATUS_IN_D0I3 is set. This can happen as long as
mvm->d0i3_ap_sta_id is not set.

To make sure that we don't have any packet in the Tx path
while we set mvm->d0i3_ap_sta_id, call synchronize_net only
after we already set mvm->d0i3_ap_sta_id.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/ops.c

index 02ce18419f20ca0f0f90bc0325ebff00bf44b626..07e68929b005e06ae6c74f298f94e610240eb46d 100644 (file)
@@ -1114,9 +1114,7 @@ int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode)
 
        IWL_DEBUG_RPM(mvm, "MVM entering D0i3\n");
 
-       /* make sure we have no running tx while configuring the qos */
        set_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status);
-       synchronize_net();
 
        /*
         * iwl_mvm_ref_sync takes a reference before checking the flag.
@@ -1144,6 +1142,9 @@ int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode)
                mvm->d0i3_offloading = false;
        }
 
+       /* make sure we have no running tx while configuring the seqno */
+       synchronize_net();
+
        iwl_mvm_set_wowlan_data(mvm, &wowlan_config_cmd, &d0i3_iter_data);
        ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_CONFIGURATION, flags,
                                   sizeof(wowlan_config_cmd),