wifi: iwlwifi: mvm: don't abort queue sync in CT-kill
authorJohannes Berg <johannes.berg@intel.com>
Mon, 5 Feb 2024 19:21:03 +0000 (21:21 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Feb 2024 14:00:47 +0000 (15:00 +0100)
CT kill should stop doing a lot of TX etc. to cool down the
NIC, but we don't stop all commands from going to the NIC,
and as such we shouldn't abort queue sync, since it can get
confused if we do, warning that we do it twice at the same
time etc. Only stop it when we'd also not send it in the
first place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240205211151.4e0745e2cd97.I311dc623ce68de6a2da3c21c8d84a387844f714a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index f18c77d88f3a723fd2dfce8150960a5fe0129317..ab1219f4a5dcb234c7ca549f4f6386b0e3e68b60 100644 (file)
@@ -6095,9 +6095,9 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
                lockdep_assert_held(&mvm->mutex);
                ret = wait_event_timeout(mvm->rx_sync_waitq,
                                         READ_ONCE(mvm->queue_sync_state) == 0 ||
-                                        iwl_mvm_is_radio_killed(mvm),
+                                        iwl_mvm_is_radio_hw_killed(mvm),
                                         SYNC_RX_QUEUE_TIMEOUT);
-               WARN_ONCE(!ret && !iwl_mvm_is_radio_killed(mvm),
+               WARN_ONCE(!ret && !iwl_mvm_is_radio_hw_killed(mvm),
                          "queue sync: failed to sync, state is 0x%lx, cookie %d\n",
                          mvm->queue_sync_state,
                          mvm->queue_sync_cookie);
index ad4146d3345a7a8837f3fc595402db0922ca5f60..77dce70eccc480ea00debef64b2c539300a89e93 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -1828,12 +1828,8 @@ static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int hw_queue)
 
 static void iwl_mvm_set_rfkill_state(struct iwl_mvm *mvm)
 {
-       bool state = iwl_mvm_is_radio_killed(mvm);
-
-       if (state)
-               wake_up(&mvm->rx_sync_waitq);
-
-       wiphy_rfkill_set_hw_state(mvm->hw->wiphy, state);
+       wiphy_rfkill_set_hw_state(mvm->hw->wiphy,
+                                 iwl_mvm_is_radio_killed(mvm));
 }
 
 void iwl_mvm_set_hw_ctkill_state(struct iwl_mvm *mvm, bool state)
@@ -1858,10 +1854,12 @@ static bool iwl_mvm_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
        bool rfkill_safe_init_done = READ_ONCE(mvm->rfkill_safe_init_done);
        bool unified = iwl_mvm_has_unified_ucode(mvm);
 
-       if (state)
+       if (state) {
                set_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
-       else
+               wake_up(&mvm->rx_sync_waitq);
+       } else {
                clear_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
+       }
 
        iwl_mvm_set_rfkill_state(mvm);