Previous patch removes the recovery monitor's dependency on driver_recovery, leaving SNOC removal as the only remaining user. Replace the SNOC teardown synchronization with cancel_work_sync() and cancel_delayed_work_sync(), which already provide the required guarantee that recovery work has stopped before resources are freed. Remove the now-unused driver_recovery completion and associated initialization and cleanup code. Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00288-QCARMSWPZ-1 Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00189 Signed-off-by: Kang Yang --- drivers/net/wireless/ath/ath10k/core.c | 3 --- drivers/net/wireless/ath/ath10k/core.h | 1 - drivers/net/wireless/ath/ath10k/mac.c | 1 - drivers/net/wireless/ath/ath10k/snoc.c | 8 ++++---- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 66585cfa6d96..7692e1a8b2e6 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -2617,8 +2617,6 @@ static void ath10k_core_restart(struct work_struct *work) struct ath10k *ar = container_of(work, struct ath10k, restart_work); int ret; - reinit_completion(&ar->driver_recovery); - set_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags); /* Place a barrier to make sure the compiler doesn't reorder @@ -3716,7 +3714,6 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, init_completion(&ar->scan.completed); init_completion(&ar->scan.on_channel); init_completion(&ar->target_suspend); - init_completion(&ar->driver_recovery); init_completion(&ar->wow.wakeup_completed); init_completion(&ar->install_key_done); diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index a1ded2cba103..7c961308d7b9 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -1067,7 +1067,6 @@ struct ath10k { } hif; struct completion target_suspend; - struct completion driver_recovery; const struct ath10k_hw_regs *regs; const struct ath10k_hw_ce_regs *hw_ce_regs; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 693b935536c2..5f828704f8ef 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -8177,7 +8177,6 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw, cancel_delayed_work_sync(&ar->recovery_check_work); /* Clear recovery state. */ - complete(&ar->driver_recovery); atomic_set(&ar->fail_cont_count, 0); atomic_set(&ar->pending_recovery, 0); diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 8f171ab6f4de..1ec58ec1029b 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1916,10 +1916,10 @@ static void ath10k_snoc_remove(struct platform_device *pdev) ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); - reinit_completion(&ar->driver_recovery); - - if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags)) - wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ); + if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags)) { + cancel_work_sync(&ar->restart_work); + cancel_delayed_work_sync(&ar->recovery_check_work); + } ath10k_snoc_free_resources(ar); } -- 2.34.1