ath11k: Cleanup in pdev destroy and mac register during crash on recovery
authorMaharaja Kennadyrajan <mkenna@codeaurora.org>
Fri, 10 Apr 2020 17:06:43 +0000 (22:36 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 15 Apr 2020 07:56:59 +0000 (10:56 +0300)
Debugfs pdev entries should be cleaned up during the crash
on recovery. If not, mac register will fail for the reason
that it is already registered during core reconfigure.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1586538405-16226-1-git-send-email-mkenna@codeaurora.org
drivers/net/wireless/ath/ath11k/debug.c
drivers/net/wireless/ath/ath11k/mac.c

index 8d48517..825e7ba 100644 (file)
@@ -803,6 +803,9 @@ static const struct file_operations fops_soc_rx_stats = {
 
 int ath11k_debug_pdev_create(struct ath11k_base *ab)
 {
+       if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags))
+               return 0;
+
        ab->debugfs_soc = debugfs_create_dir(ab->hw_params.name, ab->debugfs_ath11k);
 
        if (IS_ERR_OR_NULL(ab->debugfs_soc)) {
index 9f8bc19..4783394 100644 (file)
@@ -5891,6 +5891,9 @@ int ath11k_mac_register(struct ath11k_base *ab)
        int i;
        int ret;
 
+       if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags))
+               return 0;
+
        for (i = 0; i < ab->num_radios; i++) {
                pdev = &ab->pdevs[i];
                ar = pdev->ar;