Skip to content

Commit 6c2d49f

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: mvm: flush queue before deleting ROC
Before deleting a time event (remain-on-channel instance), flush the queue so that frames cannot get stuck on it. We already flush the AUX STA queues, but a separate station is used for the P2P Device queue. Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
1 parent 567deca commit 6c2d49f

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ struct iwl_mvm {
10611061
* @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
10621062
* @IWL_MVM_STATUS_D3_RECONFIG: D3 reconfiguration is being done
10631063
* @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running
1064+
* @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA
10641065
*/
10651066
enum iwl_mvm_status {
10661067
IWL_MVM_STATUS_HW_RFKILL,
@@ -1072,6 +1073,7 @@ enum iwl_mvm_status {
10721073
IWL_MVM_STATUS_ROC_AUX_RUNNING,
10731074
IWL_MVM_STATUS_D3_RECONFIG,
10741075
IWL_MVM_STATUS_FIRMWARE_RUNNING,
1076+
IWL_MVM_STATUS_NEED_FLUSH_P2P,
10751077
};
10761078

10771079
/* Keep track of completed init configuration */

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,24 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)
132132
* executed, and a new time event means a new command.
133133
*/
134134
iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true, CMD_ASYNC);
135+
136+
/* Do the same for the P2P device queue (STA) */
137+
if (test_and_clear_bit(IWL_MVM_STATUS_NEED_FLUSH_P2P, &mvm->status)) {
138+
struct iwl_mvm_vif *mvmvif;
139+
140+
/*
141+
* NB: access to this pointer would be racy, but the flush bit
142+
* can only be set when we had a P2P-Device VIF, and we have a
143+
* flush of this work in iwl_mvm_prepare_mac_removal() so it's
144+
* not really racy.
145+
*/
146+
147+
if (!WARN_ON(!mvm->p2p_device_vif)) {
148+
mvmvif = iwl_mvm_vif_from_mac80211(mvm->p2p_device_vif);
149+
iwl_mvm_flush_sta(mvm, &mvmvif->bcast_sta, true,
150+
CMD_ASYNC);
151+
}
152+
}
135153
}
136154

137155
static void iwl_mvm_roc_finished(struct iwl_mvm *mvm)
@@ -855,10 +873,12 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
855873

856874
mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
857875

858-
if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE)
876+
if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) {
859877
iwl_mvm_remove_time_event(mvm, mvmvif, te_data);
860-
else
878+
set_bit(IWL_MVM_STATUS_NEED_FLUSH_P2P, &mvm->status);
879+
} else {
861880
iwl_mvm_remove_aux_roc_te(mvm, mvmvif, te_data);
881+
}
862882

863883
iwl_mvm_roc_finished(mvm);
864884
}

0 commit comments

Comments
 (0)