All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] ath9k: FFT fixes and improvements
@ 2018-09-19 10:37 Simon Wunderlich
  2018-09-19 10:37 ` [PATCH 1/5] ath9k: add counters for good and errorneous FFT/spectral frames Simon Wunderlich
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Simon Wunderlich @ 2018-09-19 10:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath9k-devel, Simon Wunderlich

During FFT evaluation on an AR9462 adapter, we noticed that there were
way less FFT samples received than we would expect. This patchset adds
some counters to be able to check for received (and discarded) FFT
samples, and fixes a variety of issues I found while debugging.

Cheers,
     Simon

Simon Wunderlich (5):
  ath9k: add counters for good and errorneous FFT/spectral frames
  ath9k: return when short FFT frame was handled
  ath9k: fix and simplify FFT max index retrieval
  ath9k: FFT magnitude check: don't consider lower 3 data bits
  ath9k: fix reporting calculated new FFT upper max

 drivers/net/wireless/ath/ath9k/common-debug.c    |  2 +
 drivers/net/wireless/ath/ath9k/common-debug.h    |  4 ++
 drivers/net/wireless/ath/ath9k/common-spectral.c | 83 +++++++++---------------
 drivers/net/wireless/ath/ath9k/common-spectral.h | 17 +++++
 4 files changed, 55 insertions(+), 51 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] ath9k: add counters for good and errorneous FFT/spectral frames
  2018-09-19 10:37 [PATCH 0/5] ath9k: FFT fixes and improvements Simon Wunderlich
@ 2018-09-19 10:37 ` Simon Wunderlich
  2018-10-02  4:44   ` Kalle Valo
  2018-09-19 10:37 ` [PATCH 2/5] ath9k: return when short FFT frame was handled Simon Wunderlich
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Simon Wunderlich @ 2018-09-19 10:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath9k-devel, Simon Wunderlich

This is helpful to see whether spectral samples get discarded.

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 drivers/net/wireless/ath/ath9k/common-debug.c    |  2 ++
 drivers/net/wireless/ath/ath9k/common-debug.h    |  4 ++++
 drivers/net/wireless/ath/ath9k/common-spectral.c | 15 +++++++++++++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c b/drivers/net/wireless/ath/ath9k/common-debug.c
index 239429f10378..53ca4b063eb9 100644
--- a/drivers/net/wireless/ath/ath9k/common-debug.c
+++ b/drivers/net/wireless/ath/ath9k/common-debug.c
@@ -144,6 +144,8 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
 	RXS_ERR("BEACONS", rx_beacons);
 	RXS_ERR("FRAGS", rx_frags);
 	RXS_ERR("SPECTRAL", rx_spectral);
+	RXS_ERR("SPECTRAL SMPL GOOD", rx_spectral_sample_good);
+	RXS_ERR("SPECTRAL SMPL ERR", rx_spectral_sample_err);
 
 	RXS_ERR("CRC ERR", crc_err);
 	RXS_ERR("DECRYPT CRC ERR", decrypt_crc_err);
diff --git a/drivers/net/wireless/ath/ath9k/common-debug.h b/drivers/net/wireless/ath/ath9k/common-debug.h
index 3376990d3a24..2938b5b96b07 100644
--- a/drivers/net/wireless/ath/ath9k/common-debug.h
+++ b/drivers/net/wireless/ath/ath9k/common-debug.h
@@ -39,6 +39,8 @@
  * @rx_beacons:  No. of beacons received.
  * @rx_frags:  No. of rx-fragements received.
  * @rx_spectral: No of spectral packets received.
+ * @rx_spectral_sample_good: No. of good spectral samples
+ * @rx_spectral_sample_err: No. of good spectral samples
  */
 struct ath_rx_stats {
 	u32 rx_pkts_all;
@@ -58,6 +60,8 @@ struct ath_rx_stats {
 	u32 rx_beacons;
 	u32 rx_frags;
 	u32 rx_spectral;
+	u32 rx_spectral_sample_good;
+	u32 rx_spectral_sample_err;
 };
 
 #ifdef CONFIG_ATH9K_COMMON_DEBUG
diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.c b/drivers/net/wireless/ath/ath9k/common-spectral.c
index 440e16e641e4..0c5559009a28 100644
--- a/drivers/net/wireless/ath/ath9k/common-spectral.c
+++ b/drivers/net/wireless/ath/ath9k/common-spectral.c
@@ -501,6 +501,7 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
 	u8 sample_buf[SPECTRAL_SAMPLE_MAX_LEN] = {0};
 	struct ath_hw *ah = spec_priv->ah;
 	struct ath_common *common = ath9k_hw_common(spec_priv->ah);
+	struct ath_softc *sc = (struct ath_softc *)common->priv;
 	u8 num_bins, *vdata = (u8 *)hdr;
 	struct ath_radar_info *radar_info;
 	int len = rs->rs_datalen;
@@ -649,8 +650,13 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
 						       sample_buf, sample_len,
 						       sample_bytes);
 
-				fft_handler(rs, spec_priv, sample_buf,
-					    tsf, freq, chan_type);
+				ret = fft_handler(rs, spec_priv, sample_buf,
+						  tsf, freq, chan_type);
+
+				if (ret == 0)
+					RX_STAT_INC(rx_spectral_sample_good);
+				else
+					RX_STAT_INC(rx_spectral_sample_err);
 
 				memset(sample_buf, 0, SPECTRAL_SAMPLE_MAX_LEN);
 
@@ -665,6 +671,11 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
 				ret = fft_handler(rs, spec_priv, sample_start,
 						  tsf, freq, chan_type);
 
+				if (ret == 0)
+					RX_STAT_INC(rx_spectral_sample_good);
+				else
+					RX_STAT_INC(rx_spectral_sample_err);
+
 				/* Mix the received bins to the /dev/random
 				 * pool
 				 */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] ath9k: return when short FFT frame was handled
  2018-09-19 10:37 [PATCH 0/5] ath9k: FFT fixes and improvements Simon Wunderlich
  2018-09-19 10:37 ` [PATCH 1/5] ath9k: add counters for good and errorneous FFT/spectral frames Simon Wunderlich
@ 2018-09-19 10:37 ` Simon Wunderlich
  2018-09-19 10:37 ` [PATCH 3/5] ath9k: fix and simplify FFT max index retrieval Simon Wunderlich
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Simon Wunderlich @ 2018-09-19 10:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath9k-devel, Simon Wunderlich, Nick Kossifidis

With the loop break like this, there are false "FFT report truncated"
messages because the iterator is not advanced as the check expects.

Instead, just return, for a single frame there is nothing left to be
done anyways.

Cc: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 drivers/net/wireless/ath/ath9k/common-spectral.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.c b/drivers/net/wireless/ath/ath9k/common-spectral.c
index 0c5559009a28..f6dd0ecfbbf3 100644
--- a/drivers/net/wireless/ath/ath9k/common-spectral.c
+++ b/drivers/net/wireless/ath/ath9k/common-spectral.c
@@ -686,7 +686,7 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
 			 * loop.
 			 */
 			if (len <= fft_len + 2)
-				break;
+				return 1;
 
 			sample_start = &vdata[i + 1];
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] ath9k: fix and simplify FFT max index retrieval
  2018-09-19 10:37 [PATCH 0/5] ath9k: FFT fixes and improvements Simon Wunderlich
  2018-09-19 10:37 ` [PATCH 1/5] ath9k: add counters for good and errorneous FFT/spectral frames Simon Wunderlich
  2018-09-19 10:37 ` [PATCH 2/5] ath9k: return when short FFT frame was handled Simon Wunderlich
@ 2018-09-19 10:37 ` Simon Wunderlich
  2018-09-19 10:37 ` [PATCH 4/5] ath9k: FFT magnitude check: don't consider lower 3 data bits Simon Wunderlich
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Simon Wunderlich @ 2018-09-19 10:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath9k-devel, Simon Wunderlich, Nick Kossifidis

FFT max index retrieval was not retrieved correctly for HT20/HT40 FFT
frames. Fixing the retrieval allows us to remove the fixup function as
well. While at it, split the spectral_max_index function into versions
for ht20 and ht40 to simplify the code.

Cc: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 drivers/net/wireless/ath/ath9k/common-spectral.c | 45 ++++--------------------
 drivers/net/wireless/ath/ath9k/common-spectral.h | 17 +++++++++
 2 files changed, 23 insertions(+), 39 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.c b/drivers/net/wireless/ath/ath9k/common-spectral.c
index f6dd0ecfbbf3..d10e3f29c356 100644
--- a/drivers/net/wireless/ath/ath9k/common-spectral.c
+++ b/drivers/net/wireless/ath/ath9k/common-spectral.c
@@ -59,8 +59,7 @@ ath_cmn_max_idx_verify_ht20_fft(u8 *sample_end, int bytes_read)
 
 	sample = sample_end - SPECTRAL_HT20_SAMPLE_LEN + 1;
 
-	max_index = spectral_max_index(mag_info->all_bins,
-				       SPECTRAL_HT20_NUM_BINS);
+	max_index = spectral_max_index_ht20(mag_info->all_bins);
 	max_magnitude = spectral_max_magnitude(mag_info->all_bins);
 
 	max_exp = mag_info->max_exp & 0xf;
@@ -100,12 +99,10 @@ ath_cmn_max_idx_verify_ht20_40_fft(u8 *sample_end, int bytes_read)
 	sample = sample_end - SPECTRAL_HT20_40_SAMPLE_LEN + 1;
 
 	lower_mag = spectral_max_magnitude(mag_info->lower_bins);
-	lower_max_index = spectral_max_index(mag_info->lower_bins,
-					     SPECTRAL_HT20_40_NUM_BINS);
+	lower_max_index = spectral_max_index_ht40(mag_info->lower_bins);
 
 	upper_mag = spectral_max_magnitude(mag_info->upper_bins);
-	upper_max_index = spectral_max_index(mag_info->upper_bins,
-					     SPECTRAL_HT20_40_NUM_BINS);
+	upper_max_index = spectral_max_index_ht40(mag_info->upper_bins);
 
 	max_exp = mag_info->max_exp & 0xf;
 
@@ -117,17 +114,6 @@ ath_cmn_max_idx_verify_ht20_40_fft(u8 *sample_end, int bytes_read)
 	   ((upper_max_index < 1) || (lower_max_index < 1)))
 		return -1;
 
-	/* Some time hardware messes up the index and adds
-	 * the index of the middle point (dc_pos). Try to fix it.
-	 */
-	if ((upper_max_index - dc_pos > 0) &&
-	   (sample[upper_max_index] == (upper_mag >> max_exp)))
-		upper_max_index -= dc_pos;
-
-	if ((lower_max_index - dc_pos > 0) &&
-	   (sample[lower_max_index - dc_pos] == (lower_mag >> max_exp)))
-		lower_max_index -= dc_pos;
-
 	if ((sample[upper_max_index + dc_pos] != (upper_mag >> max_exp)) ||
 	   (sample[lower_max_index] != (lower_mag >> max_exp)))
 		return -1;
@@ -169,8 +155,7 @@ ath_cmn_process_ht20_fft(struct ath_rx_status *rs,
 	magnitude = spectral_max_magnitude(mag_info->all_bins);
 	fft_sample_20.max_magnitude = __cpu_to_be16(magnitude);
 
-	max_index = spectral_max_index(mag_info->all_bins,
-					SPECTRAL_HT20_NUM_BINS);
+	max_index = spectral_max_index_ht20(mag_info->all_bins);
 	fft_sample_20.max_index = max_index;
 
 	bitmap_w = spectral_bitmap_weight(mag_info->all_bins);
@@ -302,12 +287,10 @@ ath_cmn_process_ht20_40_fft(struct ath_rx_status *rs,
 	upper_mag = spectral_max_magnitude(mag_info->upper_bins);
 	fft_sample_40.upper_max_magnitude = __cpu_to_be16(upper_mag);
 
-	lower_max_index = spectral_max_index(mag_info->lower_bins,
-					SPECTRAL_HT20_40_NUM_BINS);
+	lower_max_index = spectral_max_index_ht40(mag_info->lower_bins);
 	fft_sample_40.lower_max_index = lower_max_index;
 
-	upper_max_index = spectral_max_index(mag_info->upper_bins,
-					SPECTRAL_HT20_40_NUM_BINS);
+	upper_max_index = spectral_max_index_ht40(mag_info->upper_bins);
 	fft_sample_40.upper_max_index = upper_max_index;
 
 	lower_bitmap_w = spectral_bitmap_weight(mag_info->lower_bins);
@@ -331,22 +314,6 @@ ath_cmn_process_ht20_40_fft(struct ath_rx_status *rs,
 					upper_mag >> max_exp,
 					upper_max_index);
 
-	/* Some time hardware messes up the index and adds
-	 * the index of the middle point (dc_pos). Try to fix it.
-	 */
-	if ((upper_max_index - dc_pos > 0) &&
-	   (fft_sample_40.data[upper_max_index] == (upper_mag >> max_exp))) {
-		upper_max_index -= dc_pos;
-		fft_sample_40.upper_max_index = upper_max_index;
-	}
-
-	if ((lower_max_index - dc_pos > 0) &&
-	   (fft_sample_40.data[lower_max_index - dc_pos] ==
-	   (lower_mag >> max_exp))) {
-		lower_max_index -= dc_pos;
-		fft_sample_40.lower_max_index = lower_max_index;
-	}
-
 	/* Check if we got the expected magnitude values at
 	 * the expected bins
 	 */
diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.h b/drivers/net/wireless/ath/ath9k/common-spectral.h
index 303ab470ce34..011d8ab8b974 100644
--- a/drivers/net/wireless/ath/ath9k/common-spectral.h
+++ b/drivers/net/wireless/ath/ath9k/common-spectral.h
@@ -145,6 +145,23 @@ static inline u8 spectral_max_index(u8 *bins, int num_bins)
 	return m;
 }
 
+static inline u8 spectral_max_index_ht40(u8 *bins)
+{
+	u8 idx;
+
+	idx = spectral_max_index(bins, SPECTRAL_HT20_40_NUM_BINS);
+
+	/* positive values and zero are starting at the beginning
+	 * of the data field.
+	 */
+	return idx % (SPECTRAL_HT20_40_NUM_BINS / 2);
+}
+
+static inline u8 spectral_max_index_ht20(u8 *bins)
+{
+	return spectral_max_index(bins, SPECTRAL_HT20_NUM_BINS);
+}
+
 /* return the bitmap weight from the all/upper/lower bins */
 static inline u8 spectral_bitmap_weight(u8 *bins)
 {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] ath9k: FFT magnitude check: don't consider lower 3 data bits
  2018-09-19 10:37 [PATCH 0/5] ath9k: FFT fixes and improvements Simon Wunderlich
                   ` (2 preceding siblings ...)
  2018-09-19 10:37 ` [PATCH 3/5] ath9k: fix and simplify FFT max index retrieval Simon Wunderlich
@ 2018-09-19 10:37 ` Simon Wunderlich
  2018-09-19 10:37 ` [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max Simon Wunderlich
  2018-09-28 13:09 ` [PATCH 0/5] ath9k: FFT fixes and improvements Tom Psyborg
  5 siblings, 0 replies; 12+ messages in thread
From: Simon Wunderlich @ 2018-09-19 10:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath9k-devel, Simon Wunderlich, Nick Kossifidis

There were a lot of Magnitude Mismatch while getting FFT samples on my
hardware (Atheros AR9462. I've compared the reported magnitude with
the data in the FFT bin, and the FFT bin was less accurate:

[ 5395.193030] ath: phy0: FFT HT20 frame: max mag 0x89,max_mag_idx 28,
,magnitude 0x89 max_exp 0, data[28] = 0x88
[ 5395.194525] ath: phy0: FFT HT20 frame: max mag 0x89,max_mag_idx 28,
,magnitude 0x89 max_exp 0, data[28] = 0x88
[ 5395.196012] ath: phy0: FFT HT20 frame: max mag 0x88,max_mag_idx 28,
,magnitude 0x88 max_exp 0, data[28] = 0x88
[ 5395.197509] ath: phy0: FFT HT20 frame: max mag 0x6C,max_mag_idx 28,
,magnitude 0x6C max_exp 0, data[28] = 0x68
[ 5395.199015] ath: phy0: FFT HT20 frame: max mag 0x78,max_mag_idx 28,
,magnitude 0x78 max_exp 0, data[28] = 0x78
[ 5395.200497] ath: phy0: FFT HT20 frame: max mag 0xA1,max_mag_idx 28,
,magnitude 0xA1 max_exp 0, data[28] = 0xA0
[ 5395.202011] ath: phy0: FFT HT20 frame: max mag 0x91,max_mag_idx 28,
,magnitude 0x91 max_exp 0, data[28] = 0x90
[ 5395.203482] ath: phy0: FFT HT20 frame: max mag 0x89,max_mag_idx 28,
,magnitude 0x89 max_exp 0, data[28] = 0x88
[ 5395.204999] ath: phy0: FFT HT20 frame: max mag 0x27,max_mag_idx 4,
,magnitude 0x27 max_exp 0, data[4] = 0x20
[ 5395.206461] ath: phy0: FFT HT20 frame: max mag 0x41,max_mag_idx 28,
,magnitude 0x41 max_exp 0, data[28] = 0x40
[ 5395.207977] ath: phy0: FFT HT20 frame: max mag 0x51,max_mag_idx 28,
,magnitude 0x51 max_exp 0, data[28] = 0x50
[ 5395.209454] ath: phy0: FFT HT20 frame: max mag 0x53,max_mag_idx 28,
,magnitude 0x53 max_exp 0, data[28] = 0x50
[ 5395.210940] ath: phy0: FFT HT20 frame: max mag 0x40,max_mag_idx 28,
,magnitude 0x40 max_exp 0, data[28] = 0x40
[ 5395.212441] ath: phy0: FFT HT20 frame: max mag 0x59,max_mag_idx 28,
,magnitude 0x59 max_exp 0, data[28] = 0x58
[ 5395.213932] ath: phy0: FFT HT20 frame: max mag 0x53,max_mag_idx 28,
,magnitude 0x53 max_exp 0, data[28] = 0x50
[ 5395.215428] ath: phy0: FFT HT20 frame: max mag 0x7D,max_mag_idx 28,
,magnitude 0x7D max_exp 0, data[28] = 0x78
[ 5395.216910] ath: phy0: FFT HT20 frame: max mag 0x8C,max_mag_idx 28,
,magnitude 0x8C max_exp 0, data[28] = 0x88
[ 5395.218413] ath: phy0: FFT HT20 frame: max mag 0x7B,max_mag_idx 28,
,magnitude 0x7B max_exp 0, data[28] = 0x78
[ 5395.219900] ath: phy0: FFT HT20 frame: max mag 0x43,max_mag_idx 28,
,magnitude 0x43 max_exp 0, data[28] = 0x40

It seems like the lower 3 bits on my hardware are always zeroed, but the
magnitude matches otherwise. Therefore, let's not make the magnitude
check so strict so we can get those samples released to userspace.

Cc: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 drivers/net/wireless/ath/ath9k/common-spectral.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.c b/drivers/net/wireless/ath/ath9k/common-spectral.c
index d10e3f29c356..70ddaf6199a0 100644
--- a/drivers/net/wireless/ath/ath9k/common-spectral.c
+++ b/drivers/net/wireless/ath/ath9k/common-spectral.c
@@ -71,7 +71,7 @@ ath_cmn_max_idx_verify_ht20_fft(u8 *sample_end, int bytes_read)
 	if (bytes_read < SPECTRAL_HT20_SAMPLE_LEN && max_index < 1)
 		return -1;
 
-	if (sample[max_index] != (max_magnitude >> max_exp))
+	if ((sample[max_index] & 0xf8) != ((max_magnitude >> max_exp) & 0xf8))
 		return -1;
 	else
 		return 0;
@@ -114,8 +114,10 @@ ath_cmn_max_idx_verify_ht20_40_fft(u8 *sample_end, int bytes_read)
 	   ((upper_max_index < 1) || (lower_max_index < 1)))
 		return -1;
 
-	if ((sample[upper_max_index + dc_pos] != (upper_mag >> max_exp)) ||
-	   (sample[lower_max_index] != (lower_mag >> max_exp)))
+	if (((sample[upper_max_index + dc_pos] & 0xf8) !=
+	     ((upper_mag >> max_exp) & 0xf8)) ||
+	    ((sample[lower_max_index] & 0xf8) !=
+	     ((lower_mag >> max_exp) & 0xf8)))
 		return -1;
 	else
 		return 0;
@@ -173,7 +175,8 @@ ath_cmn_process_ht20_fft(struct ath_rx_status *rs,
 					magnitude >> max_exp,
 					max_index);
 
-	if (fft_sample_20.data[max_index] != (magnitude >> max_exp)) {
+	if ((fft_sample_20.data[max_index] & 0xf8) !=
+	    ((magnitude >> max_exp) & 0xf8)) {
 		ath_dbg(common, SPECTRAL_SCAN, "Magnitude mismatch !\n");
 		ret = -1;
 	}
@@ -317,10 +320,10 @@ ath_cmn_process_ht20_40_fft(struct ath_rx_status *rs,
 	/* Check if we got the expected magnitude values at
 	 * the expected bins
 	 */
-	if ((fft_sample_40.data[upper_max_index + dc_pos]
-	    != (upper_mag >> max_exp)) ||
-	   (fft_sample_40.data[lower_max_index]
-	    != (lower_mag >> max_exp))) {
+	if (((fft_sample_40.data[upper_max_index + dc_pos] & 0xf8)
+	    != ((upper_mag >> max_exp) & 0xf8)) ||
+	   ((fft_sample_40.data[lower_max_index] & 0xf8)
+	    != ((lower_mag >> max_exp) & 0xf8))) {
 		ath_dbg(common, SPECTRAL_SCAN, "Magnitude mismatch !\n");
 		ret = -1;
 	}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max
  2018-09-19 10:37 [PATCH 0/5] ath9k: FFT fixes and improvements Simon Wunderlich
                   ` (3 preceding siblings ...)
  2018-09-19 10:37 ` [PATCH 4/5] ath9k: FFT magnitude check: don't consider lower 3 data bits Simon Wunderlich
@ 2018-09-19 10:37 ` Simon Wunderlich
  2018-10-01 14:07   ` Kalle Valo
       [not found]   ` <20181001140755.6242260128@smtp.codeaurora.org>
  2018-09-28 13:09 ` [PATCH 0/5] ath9k: FFT fixes and improvements Tom Psyborg
  5 siblings, 2 replies; 12+ messages in thread
From: Simon Wunderlich @ 2018-09-19 10:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath9k-devel, Simon Wunderlich, Nick Kossifidis

Cc: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 drivers/net/wireless/ath/ath9k/common-spectral.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.c b/drivers/net/wireless/ath/ath9k/common-spectral.c
index 70ddaf6199a0..6a43d26276e5 100644
--- a/drivers/net/wireless/ath/ath9k/common-spectral.c
+++ b/drivers/net/wireless/ath/ath9k/common-spectral.c
@@ -381,7 +381,7 @@ ath_cmn_process_ht20_40_fft(struct ath_rx_status *rs,
 
 		ath_dbg(common, SPECTRAL_SCAN,
 			"Calculated new upper max 0x%X at %i\n",
-			tmp_mag, i);
+			tmp_mag, fft_sample_40.upper_max_index);
 	} else
 	for (i = dc_pos; i < SPECTRAL_HT20_40_NUM_BINS; i++) {
 		if (fft_sample_40.data[i] == (upper_mag >> max_exp))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] ath9k: FFT fixes and improvements
  2018-09-19 10:37 [PATCH 0/5] ath9k: FFT fixes and improvements Simon Wunderlich
                   ` (4 preceding siblings ...)
  2018-09-19 10:37 ` [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max Simon Wunderlich
@ 2018-09-28 13:09 ` Tom Psyborg
  5 siblings, 0 replies; 12+ messages in thread
From: Tom Psyborg @ 2018-09-28 13:09 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: linux-wireless, kvalo, ath9k-devel

compiles OK, no interfere with normal card operations (IBSS) so it
should be merged.

On 19/09/2018, Simon Wunderlich <sw@simonwunderlich.de> wrote:
> During FFT evaluation on an AR9462 adapter, we noticed that there were
> way less FFT samples received than we would expect. This patchset adds
> some counters to be able to check for received (and discarded) FFT
> samples, and fixes a variety of issues I found while debugging.
>
> Cheers,
>      Simon
>
> Simon Wunderlich (5):
>   ath9k: add counters for good and errorneous FFT/spectral frames
>   ath9k: return when short FFT frame was handled
>   ath9k: fix and simplify FFT max index retrieval
>   ath9k: FFT magnitude check: don't consider lower 3 data bits
>   ath9k: fix reporting calculated new FFT upper max
>
>  drivers/net/wireless/ath/ath9k/common-debug.c    |  2 +
>  drivers/net/wireless/ath/ath9k/common-debug.h    |  4 ++
>  drivers/net/wireless/ath/ath9k/common-spectral.c | 83
> +++++++++---------------
>  drivers/net/wireless/ath/ath9k/common-spectral.h | 17 +++++
>  4 files changed, 55 insertions(+), 51 deletions(-)
>
> --
> 2.11.0
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max
  2018-09-19 10:37 ` [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max Simon Wunderlich
@ 2018-10-01 14:07   ` Kalle Valo
       [not found]   ` <20181001140755.6242260128@smtp.codeaurora.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2018-10-01 14:07 UTC (permalink / raw)
  To: Simon Wunderlich
  Cc: linux-wireless, ath9k-devel, Simon Wunderlich, Nick Kossifidis

Simon Wunderlich <sw@simonwunderlich.de> wrote:

> Cc: Nick Kossifidis <mickflemm@gmail.com>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

No empty commit logs, please. But I can add that, just tell me what to add.

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

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max
       [not found]   ` <20181001140755.6242260128@smtp.codeaurora.org>
@ 2018-10-01 14:26     ` Simon Wunderlich
  2018-10-01 14:31       ` Kalle Valo
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Wunderlich @ 2018-10-01 14:26 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, ath9k-devel, Nick Kossifidis

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

On Monday, October 1, 2018 2:07:55 PM CEST Kalle Valo wrote:
> Simon Wunderlich <sw@simonwunderlich.de> wrote:
> > Cc: Nick Kossifidis <mickflemm@gmail.com>
> > Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> 
> No empty commit logs, please. But I can add that, just tell me what to add.

How about:

Since the debug print code is outside of the loop, it shouldn't use the loop 
iterator anymore but instead print the found maximum index.





Let me know if you need me to resend or anything else.

Thank you,
      Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max
  2018-10-01 14:26     ` Simon Wunderlich
@ 2018-10-01 14:31       ` Kalle Valo
  2018-10-01 14:32         ` Simon Wunderlich
  0 siblings, 1 reply; 12+ messages in thread
From: Kalle Valo @ 2018-10-01 14:31 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: linux-wireless, ath9k-devel, Nick Kossifidis

Simon Wunderlich <sw@simonwunderlich.de> writes:

> On Monday, October 1, 2018 2:07:55 PM CEST Kalle Valo wrote:
>> Simon Wunderlich <sw@simonwunderlich.de> wrote:
>> > Cc: Nick Kossifidis <mickflemm@gmail.com>
>> > Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
>> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>> 
>> No empty commit logs, please. But I can add that, just tell me what to add.
>
> How about:
>
> Since the debug print code is outside of the loop, it shouldn't use the loop 
> iterator anymore but instead print the found maximum index.

Perfect, thanks.

> Let me know if you need me to resend or anything else.

No need, I added this to the patch in the (not yet pushed) pending
branch.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max
  2018-10-01 14:31       ` Kalle Valo
@ 2018-10-01 14:32         ` Simon Wunderlich
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Wunderlich @ 2018-10-01 14:32 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, ath9k-devel, Nick Kossifidis

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

On Monday, October 1, 2018 5:31:42 PM CEST Kalle Valo wrote:
> Simon Wunderlich <sw@simonwunderlich.de> writes:
> > On Monday, October 1, 2018 2:07:55 PM CEST Kalle Valo wrote:
> >> Simon Wunderlich <sw@simonwunderlich.de> wrote:
> >> > Cc: Nick Kossifidis <mickflemm@gmail.com>
> >> > Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> >> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> >> 
> >> No empty commit logs, please. But I can add that, just tell me what to
> >> add.
> > 
> > How about:
> > 
> > Since the debug print code is outside of the loop, it shouldn't use the
> > loop iterator anymore but instead print the found maximum index.
> 
> Perfect, thanks.
> 
> > Let me know if you need me to resend or anything else.
> 
> No need, I added this to the patch in the (not yet pushed) pending
> branch.

Awesome, thank you!

Cheers,
     Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] ath9k: add counters for good and errorneous FFT/spectral frames
  2018-09-19 10:37 ` [PATCH 1/5] ath9k: add counters for good and errorneous FFT/spectral frames Simon Wunderlich
@ 2018-10-02  4:44   ` Kalle Valo
  0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2018-10-02  4:44 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: linux-wireless, ath9k-devel, Simon Wunderlich

Simon Wunderlich <sw@simonwunderlich.de> wrote:

> This is helpful to see whether spectral samples get discarded.
> 
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

5 patches applied to ath-next branch of ath.git, thanks.

03224678c013 ath9k: add counters for good and errorneous FFT/spectral frames
b796a6c04e65 ath9k: return when short FFT frame was handled
2f85786b8a57 ath9k: fix and simplify FFT max index retrieval
4e7a3fa5394e ath9k: FFT magnitude check: don't consider lower 3 data bits
4fb5837ac2bd ath9k: fix reporting calculated new FFT upper max

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

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-10-02  4:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19 10:37 [PATCH 0/5] ath9k: FFT fixes and improvements Simon Wunderlich
2018-09-19 10:37 ` [PATCH 1/5] ath9k: add counters for good and errorneous FFT/spectral frames Simon Wunderlich
2018-10-02  4:44   ` Kalle Valo
2018-09-19 10:37 ` [PATCH 2/5] ath9k: return when short FFT frame was handled Simon Wunderlich
2018-09-19 10:37 ` [PATCH 3/5] ath9k: fix and simplify FFT max index retrieval Simon Wunderlich
2018-09-19 10:37 ` [PATCH 4/5] ath9k: FFT magnitude check: don't consider lower 3 data bits Simon Wunderlich
2018-09-19 10:37 ` [PATCH 5/5] ath9k: fix reporting calculated new FFT upper max Simon Wunderlich
2018-10-01 14:07   ` Kalle Valo
     [not found]   ` <20181001140755.6242260128@smtp.codeaurora.org>
2018-10-01 14:26     ` Simon Wunderlich
2018-10-01 14:31       ` Kalle Valo
2018-10-01 14:32         ` Simon Wunderlich
2018-09-28 13:09 ` [PATCH 0/5] ath9k: FFT fixes and improvements Tom Psyborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.