Skip to content

Commit 556857a

Browse files
benzeaKalle Valo
authored andcommitted
wifi: ath11k: rely on mac80211 debugfs handling for vif
mac80211 started to delete debugfs entries in certain cases, causing a ath11k to crash when it tried to delete the entries later. Fix this by relying on mac80211 to delete the entries when appropriate and adding them from the vif_add_debugfs handler. Fixes: 0a3d898 ("wifi: mac80211: add/remove driver debugfs entries as appropriate") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218364 Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240115101805.1277949-1-benjamin@sipsolutions.net
1 parent 989cd9f commit 556857a

File tree

4 files changed

+13
-40
lines changed

4 files changed

+13
-40
lines changed

drivers/net/wireless/ath/ath11k/core.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@ struct ath11k_vif {
368368
struct ieee80211_chanctx_conf chanctx;
369369
struct ath11k_arp_ns_offload arp_ns_offload;
370370
struct ath11k_rekey_data rekey_data;
371-
372-
#ifdef CONFIG_ATH11K_DEBUGFS
373-
struct dentry *debugfs_twt;
374-
#endif /* CONFIG_ATH11K_DEBUGFS */
375371
};
376372

377373
struct ath11k_vif_iter {

drivers/net/wireless/ath/ath11k/debugfs.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,35 +1893,30 @@ static const struct file_operations ath11k_fops_twt_resume_dialog = {
18931893
.open = simple_open
18941894
};
18951895

1896-
void ath11k_debugfs_add_interface(struct ath11k_vif *arvif)
1896+
void ath11k_debugfs_op_vif_add(struct ieee80211_hw *hw,
1897+
struct ieee80211_vif *vif)
18971898
{
1899+
struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
18981900
struct ath11k_base *ab = arvif->ar->ab;
1901+
struct dentry *debugfs_twt;
18991902

19001903
if (arvif->vif->type != NL80211_IFTYPE_AP &&
19011904
!(arvif->vif->type == NL80211_IFTYPE_STATION &&
19021905
test_bit(WMI_TLV_SERVICE_STA_TWT, ab->wmi_ab.svc_map)))
19031906
return;
19041907

1905-
arvif->debugfs_twt = debugfs_create_dir("twt",
1906-
arvif->vif->debugfs_dir);
1907-
debugfs_create_file("add_dialog", 0200, arvif->debugfs_twt,
1908+
debugfs_twt = debugfs_create_dir("twt",
1909+
arvif->vif->debugfs_dir);
1910+
debugfs_create_file("add_dialog", 0200, debugfs_twt,
19081911
arvif, &ath11k_fops_twt_add_dialog);
19091912

1910-
debugfs_create_file("del_dialog", 0200, arvif->debugfs_twt,
1913+
debugfs_create_file("del_dialog", 0200, debugfs_twt,
19111914
arvif, &ath11k_fops_twt_del_dialog);
19121915

1913-
debugfs_create_file("pause_dialog", 0200, arvif->debugfs_twt,
1916+
debugfs_create_file("pause_dialog", 0200, debugfs_twt,
19141917
arvif, &ath11k_fops_twt_pause_dialog);
19151918

1916-
debugfs_create_file("resume_dialog", 0200, arvif->debugfs_twt,
1919+
debugfs_create_file("resume_dialog", 0200, debugfs_twt,
19171920
arvif, &ath11k_fops_twt_resume_dialog);
19181921
}
19191922

1920-
void ath11k_debugfs_remove_interface(struct ath11k_vif *arvif)
1921-
{
1922-
if (!arvif->debugfs_twt)
1923-
return;
1924-
1925-
debugfs_remove_recursive(arvif->debugfs_twt);
1926-
arvif->debugfs_twt = NULL;
1927-
}

drivers/net/wireless/ath/ath11k/debugfs.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ static inline int ath11k_debugfs_rx_filter(struct ath11k *ar)
306306
return ar->debug.rx_filter;
307307
}
308308

309-
void ath11k_debugfs_add_interface(struct ath11k_vif *arvif);
310-
void ath11k_debugfs_remove_interface(struct ath11k_vif *arvif);
309+
void ath11k_debugfs_op_vif_add(struct ieee80211_hw *hw,
310+
struct ieee80211_vif *vif);
311311
void ath11k_debugfs_add_dbring_entry(struct ath11k *ar,
312312
enum wmi_direct_buffer_module id,
313313
enum ath11k_dbg_dbr_event event,
@@ -386,14 +386,6 @@ static inline int ath11k_debugfs_get_fw_stats(struct ath11k *ar,
386386
return 0;
387387
}
388388

389-
static inline void ath11k_debugfs_add_interface(struct ath11k_vif *arvif)
390-
{
391-
}
392-
393-
static inline void ath11k_debugfs_remove_interface(struct ath11k_vif *arvif)
394-
{
395-
}
396-
397389
static inline void
398390
ath11k_debugfs_add_dbring_entry(struct ath11k *ar,
399391
enum wmi_direct_buffer_module id,

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6750,13 +6750,6 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
67506750
goto err;
67516751
}
67526752

6753-
/* In the case of hardware recovery, debugfs files are
6754-
* not deleted since ieee80211_ops.remove_interface() is
6755-
* not invoked. In such cases, try to delete the files.
6756-
* These will be re-created later.
6757-
*/
6758-
ath11k_debugfs_remove_interface(arvif);
6759-
67606753
memset(arvif, 0, sizeof(*arvif));
67616754

67626755
arvif->ar = ar;
@@ -6933,8 +6926,6 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
69336926

69346927
ath11k_dp_vdev_tx_attach(ar, arvif);
69356928

6936-
ath11k_debugfs_add_interface(arvif);
6937-
69386929
if (vif->type != NL80211_IFTYPE_MONITOR &&
69396930
test_bit(ATH11K_FLAG_MONITOR_CONF_ENABLED, &ar->monitor_flags)) {
69406931
ret = ath11k_mac_monitor_vdev_create(ar);
@@ -7050,8 +7041,6 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw,
70507041
/* Recalc txpower for remaining vdev */
70517042
ath11k_mac_txpower_recalc(ar);
70527043

7053-
ath11k_debugfs_remove_interface(arvif);
7054-
70557044
/* TODO: recal traffic pause state based on the available vdevs */
70567045

70577046
mutex_unlock(&ar->conf_mutex);
@@ -9149,6 +9138,7 @@ static const struct ieee80211_ops ath11k_ops = {
91499138
#endif
91509139

91519140
#ifdef CONFIG_ATH11K_DEBUGFS
9141+
.vif_add_debugfs = ath11k_debugfs_op_vif_add,
91529142
.sta_add_debugfs = ath11k_debugfs_sta_op_add,
91539143
#endif
91549144

0 commit comments

Comments
 (0)