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

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
...@@ -88,3 +88,13 @@ void ath12k_debugfs_register(struct ath12k *ar) ...@@ -88,3 +88,13 @@ void ath12k_debugfs_register(struct ath12k *ar)
&fops_simulate_radar); &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;
}
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
void ath12k_debugfs_soc_create(struct ath12k_base *ab); void ath12k_debugfs_soc_create(struct ath12k_base *ab);
void ath12k_debugfs_soc_destroy(struct ath12k_base *ab); void ath12k_debugfs_soc_destroy(struct ath12k_base *ab);
void ath12k_debugfs_register(struct ath12k *ar); void ath12k_debugfs_register(struct ath12k *ar);
void ath12k_debugfs_unregister(struct ath12k *ar);
#else #else
static inline void ath12k_debugfs_soc_create(struct ath12k_base *ab) static inline void ath12k_debugfs_soc_create(struct ath12k_base *ab)
{ {
...@@ -25,6 +25,10 @@ static inline void ath12k_debugfs_register(struct ath12k *ar) ...@@ -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 /* CONFIG_ATH12K_DEBUGFS */
#endif /* _ATH12K_DEBUGFS_H_ */ #endif /* _ATH12K_DEBUGFS_H_ */
...@@ -8892,8 +8892,10 @@ static void ath12k_mac_hw_unregister(struct ath12k_hw *ah) ...@@ -8892,8 +8892,10 @@ static void ath12k_mac_hw_unregister(struct ath12k_hw *ah)
struct ath12k *ar; struct ath12k *ar;
int i; int i;
for_each_ar(ah, ar, i) for_each_ar(ah, ar, i) {
cancel_work_sync(&ar->regd_update_work); cancel_work_sync(&ar->regd_update_work);
ath12k_debugfs_unregister(ar);
}
ieee80211_unregister_hw(hw); ieee80211_unregister_hw(hw);
...@@ -9140,6 +9142,9 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) ...@@ -9140,6 +9142,9 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
return 0; return 0;
err_unregister_hw: err_unregister_hw:
for_each_ar(ah, ar, i)
ath12k_debugfs_unregister(ar);
ieee80211_unregister_hw(hw); ieee80211_unregister_hw(hw);
err_free_if_combs: err_free_if_combs:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment