2020-04-10 17:06:28

by Maharaja Kennadyrajan

[permalink] [raw]
Subject: [PATCH] ath11k: Cleanup in pdev destroy and mac register during crash on recovery

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 <[email protected]>
---
drivers/net/wireless/ath/ath11k/debug.c | 3 +++
drivers/net/wireless/ath/ath11k/mac.c | 3 +++
2 files changed, 6 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/debug.c b/drivers/net/wireless/ath/ath11k/debug.c
index 8d48517..825e7ba6 100644
--- a/drivers/net/wireless/ath/ath11k/debug.c
+++ b/drivers/net/wireless/ath/ath11k/debug.c
@@ -803,6 +803,9 @@ static ssize_t ath11k_debug_dump_soc_rx_stats(struct file *file,

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)) {
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 9f8bc19..4783394 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -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;
--
1.9.1


2020-04-10 17:07:09

by Maharaja Kennadyrajan

[permalink] [raw]
Subject: [PATCH] ath11k: Fix rx_filter flags setting for per peer rx_stats

Rx_filter flags are set with default filter flags during
wifi up/down sequence even though the 'ext_rx_stats' debugfs
is enabled as 1. So, that we are not getting proper per peer
rx_stats.
Hence, fixing this by setting the missing rx_filter when
ext_rx_stats is already set/enabled.

Signed-off-by: Maharaja Kennadyrajan <[email protected]>
---
drivers/net/wireless/ath/ath11k/core.h | 1 +
drivers/net/wireless/ath/ath11k/debug.c | 2 ++
drivers/net/wireless/ath/ath11k/debug.h | 10 ++++++++++
drivers/net/wireless/ath/ath11k/mac.c | 4 +++-
4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index b4c3e041..a8ef95f 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -392,6 +392,7 @@ struct ath11k_debug {
u32 pktlog_mode;
u32 pktlog_peer_valid;
u8 pktlog_peer_addr[ETH_ALEN];
+ u32 rx_filter;
};

struct ath11k_per_peer_tx_stats {
diff --git a/drivers/net/wireless/ath/ath11k/debug.c b/drivers/net/wireless/ath/ath11k/debug.c
index 8d48517..e479504 100644
--- a/drivers/net/wireless/ath/ath11k/debug.c
+++ b/drivers/net/wireless/ath/ath11k/debug.c
@@ -698,6 +698,8 @@ static ssize_t ath11k_write_extd_rx_stats(struct file *file,
tlv_filter = ath11k_mac_mon_status_filter_default;
}

+ ar->debug.rx_filter = tlv_filter.rx_filter;
+
ring_id = ar->dp.rx_mon_status_refill_ring.refill_buf_ring.ring_id;
ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, ar->dp.mac_id,
HAL_RXDMA_MONITOR_STATUS,
diff --git a/drivers/net/wireless/ath/ath11k/debug.h b/drivers/net/wireless/ath/ath11k/debug.h
index 4a3ff82..45454fc 100644
--- a/drivers/net/wireless/ath/ath11k/debug.h
+++ b/drivers/net/wireless/ath/ath11k/debug.h
@@ -188,6 +188,11 @@ static inline int ath11k_debug_is_extd_rx_stats_enabled(struct ath11k *ar)
return ar->debug.extd_rx_stats;
}

+static inline int ath11k_debug_rx_filter(struct ath11k *ar)
+{
+ return ar->debug.rx_filter;
+}
+
void ath11k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct dentry *dir);
void
@@ -269,6 +274,11 @@ static inline bool ath11k_debug_is_pktlog_peer_valid(struct ath11k *ar, u8 *addr
return false;
}

+static inline int ath11k_debug_rx_filter(struct ath11k *ar)
+{
+ return 0;
+}
+
static inline void
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
struct ath11k_per_peer_tx_stats *peer_stats,
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 9f8bc19..3665e72 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -3877,8 +3877,10 @@ static int ath11k_mac_config_mon_status_default(struct ath11k *ar, bool enable)
struct htt_rx_ring_tlv_filter tlv_filter = {0};
u32 ring_id;

- if (enable)
+ if (enable) {
tlv_filter = ath11k_mac_mon_status_filter_default;
+ tlv_filter.rx_filter = ath11k_debug_rx_filter(ar);
+ }

ring_id = ar->dp.rx_mon_status_refill_ring.refill_buf_ring.ring_id;

--
1.9.1

2020-04-15 22:23:27

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath11k: Cleanup in pdev destroy and mac register during crash on recovery

Maharaja Kennadyrajan <[email protected]> wrote:

> 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 <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

6fc3b94ef596 ath11k: Cleanup in pdev destroy and mac register during crash on recovery

--
https://patchwork.kernel.org/patch/11483477/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2020-04-15 22:25:05

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath11k: Fix rx_filter flags setting for per peer rx_stats

Maharaja Kennadyrajan <[email protected]> wrote:

> Rx_filter flags are set with default filter flags during
> wifi up/down sequence even though the 'ext_rx_stats' debugfs
> is enabled as 1. So, that we are not getting proper per peer
> rx_stats.
> Hence, fixing this by setting the missing rx_filter when
> ext_rx_stats is already set/enabled.
>
> Signed-off-by: Maharaja Kennadyrajan <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

ec48d28ba291 ath11k: Fix rx_filter flags setting for per peer rx_stats

--
https://patchwork.kernel.org/patch/11483475/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches