Commit 4e1eff38 authored by Aditya Kumar Singh's avatar Aditya Kumar Singh Committed by Kalle Valo
Browse files

wifi: ath12k: unregister per pdev debugfs



During normal de-initialization path or if any error happens while
registering the hardware, there is no support to unregister the per pdev
debugfs. Add support for the same.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: default avatarAditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240529043043.2488031-3-quic_adisi@quicinc.com
parent 8dd65ccb
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -88,3 +88,13 @@ void ath12k_debugfs_register(struct ath12k *ar)
				    &fops_simulate_radar);
	}
}

void ath12k_debugfs_unregister(struct ath12k *ar)
{
	if (!ar->debug.debugfs_pdev)
		return;

	/* TODO: Remove symlink under ieee80211/phy* */
	debugfs_remove_recursive(ar->debug.debugfs_pdev);
	ar->debug.debugfs_pdev = NULL;
}
+5 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
void ath12k_debugfs_soc_create(struct ath12k_base *ab);
void ath12k_debugfs_soc_destroy(struct ath12k_base *ab);
void ath12k_debugfs_register(struct ath12k *ar);

void ath12k_debugfs_unregister(struct ath12k *ar);
#else
static inline void ath12k_debugfs_soc_create(struct ath12k_base *ab)
{
@@ -25,6 +25,10 @@ static inline void ath12k_debugfs_register(struct ath12k *ar)
{
}

static inline void ath12k_debugfs_unregister(struct ath12k *ar)
{
}

#endif /* CONFIG_ATH12K_DEBUGFS */

#endif /* _ATH12K_DEBUGFS_H_ */
+6 −1
Original line number Diff line number Diff line
@@ -8892,8 +8892,10 @@ static void ath12k_mac_hw_unregister(struct ath12k_hw *ah)
	struct ath12k *ar;
	int i;

	for_each_ar(ah, ar, i)
	for_each_ar(ah, ar, i) {
		cancel_work_sync(&ar->regd_update_work);
		ath12k_debugfs_unregister(ar);
	}

	ieee80211_unregister_hw(hw);

@@ -9140,6 +9142,9 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
	return 0;

err_unregister_hw:
	for_each_ar(ah, ar, i)
		ath12k_debugfs_unregister(ar);

	ieee80211_unregister_hw(hw);

err_free_if_combs: