* [PATCH 0/3] wifi: ath12k: fixes for per pdev debugfs
@ 2024-05-29 4:30 Aditya Kumar Singh
2024-05-29 4:30 ` [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration Aditya Kumar Singh
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Aditya Kumar Singh @ 2024-05-29 4:30 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Aditya Kumar Singh
This series aims to fix a few minor issues in per pdev debugfs handling.
More details in each patch.
Aditya Kumar Singh (3):
wifi: ath12k: fix per pdev debugfs registration
wifi: ath12k: unregister per pdev debugfs
wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry
---
drivers/net/wireless/ath/ath12k/core.h | 1 +
drivers/net/wireless/ath/ath12k/debugfs.c | 16 +++++++++++++++-
drivers/net/wireless/ath/ath12k/debugfs.h | 6 +++++-
drivers/net/wireless/ath/ath12k/mac.c | 11 ++++++++---
4 files changed, 29 insertions(+), 5 deletions(-)
base-commit: 2580be9ee6f5d97d6763b5d4ae4f9c0383fdf130
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration
2024-05-29 4:30 [PATCH 0/3] wifi: ath12k: fixes for per pdev debugfs Aditya Kumar Singh
@ 2024-05-29 4:30 ` Aditya Kumar Singh
2024-05-29 18:54 ` Jeff Johnson
2024-06-11 18:45 ` Kalle Valo
2024-05-29 4:30 ` [PATCH 2/3] wifi: ath12k: unregister per pdev debugfs Aditya Kumar Singh
2024-05-29 4:30 ` [PATCH 3/3] wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry Aditya Kumar Singh
2 siblings, 2 replies; 8+ messages in thread
From: Aditya Kumar Singh @ 2024-05-29 4:30 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Aditya Kumar Singh
Function ath12k_debugfs_register() is called once inside the function
ath12k_mac_hw_register(). However, with single wiphy model, there could
be multiple pdevs registered under single hardware. Hence, need to register
debugfs for each one of them.
Move the caller inside the loop which iterates over all underlying pdevs.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Fixes: f8bde02a26b9 ("wifi: ath12k: initial debugfs support")
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 784964ae03ec..beec42d4ec24 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -9077,9 +9077,9 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
ath12k_err(ar->ab, "ath12k regd update failed: %d\n", ret);
goto err_unregister_hw;
}
- }
- ath12k_debugfs_register(ar);
+ ath12k_debugfs_register(ar);
+ }
return 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] wifi: ath12k: unregister per pdev debugfs
2024-05-29 4:30 [PATCH 0/3] wifi: ath12k: fixes for per pdev debugfs Aditya Kumar Singh
2024-05-29 4:30 ` [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration Aditya Kumar Singh
@ 2024-05-29 4:30 ` Aditya Kumar Singh
2024-05-29 18:54 ` Jeff Johnson
2024-05-29 4:30 ` [PATCH 3/3] wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry Aditya Kumar Singh
2 siblings, 1 reply; 8+ messages in thread
From: Aditya Kumar Singh @ 2024-05-29 4:30 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Aditya Kumar Singh
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: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
drivers/net/wireless/ath/ath12k/debugfs.c | 10 ++++++++++
drivers/net/wireless/ath/ath12k/debugfs.h | 6 +++++-
drivers/net/wireless/ath/ath12k/mac.c | 7 ++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/debugfs.c b/drivers/net/wireless/ath/ath12k/debugfs.c
index 8d8ba951093b..3b464cd40da6 100644
--- a/drivers/net/wireless/ath/ath12k/debugfs.c
+++ b/drivers/net/wireless/ath/ath12k/debugfs.c
@@ -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;
+}
diff --git a/drivers/net/wireless/ath/ath12k/debugfs.h b/drivers/net/wireless/ath/ath12k/debugfs.h
index a62f2a550b23..8d64ba03aa9a 100644
--- a/drivers/net/wireless/ath/ath12k/debugfs.h
+++ b/drivers/net/wireless/ath/ath12k/debugfs.h
@@ -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_ */
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index beec42d4ec24..381fee8ca748 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -8836,8 +8836,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);
@@ -9084,6 +9086,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:
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry
2024-05-29 4:30 [PATCH 0/3] wifi: ath12k: fixes for per pdev debugfs Aditya Kumar Singh
2024-05-29 4:30 ` [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration Aditya Kumar Singh
2024-05-29 4:30 ` [PATCH 2/3] wifi: ath12k: unregister per pdev debugfs Aditya Kumar Singh
@ 2024-05-29 4:30 ` Aditya Kumar Singh
2024-05-29 18:54 ` Jeff Johnson
2 siblings, 1 reply; 8+ messages in thread
From: Aditya Kumar Singh @ 2024-05-29 4:30 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Aditya Kumar Singh
Whenever per pdev debugfs directory is created, a symlink to it is also
placed in ieee80211/phy* directory. During clean up of per pdev debugfs,
this symlink also needs to be cleaned up.
Add changes to clean up the symlink whenever the per pdev debugfs is
removed.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
drivers/net/wireless/ath/ath12k/core.h | 1 +
drivers/net/wireless/ath/ath12k/debugfs.c | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 7d20b09c52e6..87cb3fde68c2 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -473,6 +473,7 @@ struct ath12k_fw_stats {
struct ath12k_debug {
struct dentry *debugfs_pdev;
+ struct dentry *debugfs_pdev_symlink;
};
struct ath12k_per_peer_tx_stats {
diff --git a/drivers/net/wireless/ath/ath12k/debugfs.c b/drivers/net/wireless/ath/ath12k/debugfs.c
index 3b464cd40da6..751a9b04386a 100644
--- a/drivers/net/wireless/ath/ath12k/debugfs.c
+++ b/drivers/net/wireless/ath/ath12k/debugfs.c
@@ -80,7 +80,9 @@ void ath12k_debugfs_register(struct ath12k *ar)
/* Create a symlink under ieee80211/phy* */
scnprintf(buf, sizeof(buf), "../../ath12k/%pd2", ar->debug.debugfs_pdev);
- debugfs_create_symlink("ath12k", hw->wiphy->debugfsdir, buf);
+ ar->debug.debugfs_pdev_symlink = debugfs_create_symlink("ath12k",
+ hw->wiphy->debugfsdir,
+ buf);
if (ar->mac.sbands[NL80211_BAND_5GHZ].channels) {
debugfs_create_file("dfs_simulate_radar", 0200,
@@ -94,7 +96,9 @@ void ath12k_debugfs_unregister(struct ath12k *ar)
if (!ar->debug.debugfs_pdev)
return;
- /* TODO: Remove symlink under ieee80211/phy* */
+ /* Remove symlink under ieee80211/phy* */
+ debugfs_remove(ar->debug.debugfs_pdev_symlink);
debugfs_remove_recursive(ar->debug.debugfs_pdev);
+ ar->debug.debugfs_pdev_symlink = NULL;
ar->debug.debugfs_pdev = NULL;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration
2024-05-29 4:30 ` [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration Aditya Kumar Singh
@ 2024-05-29 18:54 ` Jeff Johnson
2024-06-11 18:45 ` Kalle Valo
1 sibling, 0 replies; 8+ messages in thread
From: Jeff Johnson @ 2024-05-29 18:54 UTC (permalink / raw)
To: Aditya Kumar Singh, ath12k; +Cc: linux-wireless
On 5/28/2024 9:30 PM, Aditya Kumar Singh wrote:
> Function ath12k_debugfs_register() is called once inside the function
> ath12k_mac_hw_register(). However, with single wiphy model, there could
> be multiple pdevs registered under single hardware. Hence, need to register
> debugfs for each one of them.
>
> Move the caller inside the loop which iterates over all underlying pdevs.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>
> Fixes: f8bde02a26b9 ("wifi: ath12k: initial debugfs support")
> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] wifi: ath12k: unregister per pdev debugfs
2024-05-29 4:30 ` [PATCH 2/3] wifi: ath12k: unregister per pdev debugfs Aditya Kumar Singh
@ 2024-05-29 18:54 ` Jeff Johnson
0 siblings, 0 replies; 8+ messages in thread
From: Jeff Johnson @ 2024-05-29 18:54 UTC (permalink / raw)
To: Aditya Kumar Singh, ath12k; +Cc: linux-wireless
On 5/28/2024 9:30 PM, Aditya Kumar Singh wrote:
> 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: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry
2024-05-29 4:30 ` [PATCH 3/3] wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry Aditya Kumar Singh
@ 2024-05-29 18:54 ` Jeff Johnson
0 siblings, 0 replies; 8+ messages in thread
From: Jeff Johnson @ 2024-05-29 18:54 UTC (permalink / raw)
To: Aditya Kumar Singh, ath12k; +Cc: linux-wireless
On 5/28/2024 9:30 PM, Aditya Kumar Singh wrote:
> Whenever per pdev debugfs directory is created, a symlink to it is also
> placed in ieee80211/phy* directory. During clean up of per pdev debugfs,
> this symlink also needs to be cleaned up.
>
> Add changes to clean up the symlink whenever the per pdev debugfs is
> removed.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration
2024-05-29 4:30 ` [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration Aditya Kumar Singh
2024-05-29 18:54 ` Jeff Johnson
@ 2024-06-11 18:45 ` Kalle Valo
1 sibling, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2024-06-11 18:45 UTC (permalink / raw)
To: Aditya Kumar Singh; +Cc: ath12k, linux-wireless, Aditya Kumar Singh
Aditya Kumar Singh <quic_adisi@quicinc.com> wrote:
> Function ath12k_debugfs_register() is called once inside the function
> ath12k_mac_hw_register(). However, with single wiphy model, there could
> be multiple pdevs registered under single hardware. Hence, need to register
> debugfs for each one of them.
>
> Move the caller inside the loop which iterates over all underlying pdevs.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>
> Fixes: f8bde02a26b9 ("wifi: ath12k: initial debugfs support")
> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
3 patches applied to ath-next branch of ath.git, thanks.
8dd65ccbdf91 wifi: ath12k: fix per pdev debugfs registration
4e1eff38d37a wifi: ath12k: unregister per pdev debugfs
5a16da9cfb40 wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry
--
https://patchwork.kernel.org/project/linux-wireless/patch/20240529043043.2488031-2-quic_adisi@quicinc.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-06-11 18:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 4:30 [PATCH 0/3] wifi: ath12k: fixes for per pdev debugfs Aditya Kumar Singh
2024-05-29 4:30 ` [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration Aditya Kumar Singh
2024-05-29 18:54 ` Jeff Johnson
2024-06-11 18:45 ` Kalle Valo
2024-05-29 4:30 ` [PATCH 2/3] wifi: ath12k: unregister per pdev debugfs Aditya Kumar Singh
2024-05-29 18:54 ` Jeff Johnson
2024-05-29 4:30 ` [PATCH 3/3] wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry Aditya Kumar Singh
2024-05-29 18:54 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).