diff mbox series

[3/4] ath10k: Fix the wrong updation of SGI in tx_stats debugfs

Message ID 1550820034-18603-4-git-send-email-svishnoi@codeaurora.org (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series Fix inconsistencies observed in population of tx_stats in debugfs | expand

Commit Message

Surabhi Vishnoi Feb. 22, 2019, 7:20 a.m. UTC
The SGI is updated wrongly in tx stats table in debugfs per sta
entry. To know whether the packets/bytes are sent with SHORT GI,
test whether the SGI bit(ATH10K_RATE_INFO_FLAGS_SGI_BIT) is set or
not in the txrate flags.

Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1

Fixes: a904417fc876 ("ath10k: add extended per sta tx statistics support")
Signed-off-by: Surabhi Vishnoi <svishnoi@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/htt_rx.c | 3 ++-
 drivers/net/wireless/ath/ath10k/wmi.h    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

kernel test robot Feb. 24, 2019, 9:13 p.m. UTC | #1
Hi Surabhi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ath6kl/ath-next]
[also build test WARNING on v5.0-rc4 next-20190222]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Surabhi-Vishnoi/Fix-inconsistencies-observed-in-population-of-tx_stats-in-debugfs/20190225-041038
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=alpha 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   In file included from include/linux/bitops.h:19,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/completion.h:12,
                    from drivers/net//wireless/ath/ath10k/core.h:11,
                    from drivers/net//wireless/ath/ath10k/htt_rx.c:8:
   drivers/net//wireless/ath/ath10k/htt_rx.c: In function 'ath10k_update_per_peer_tx_stats':
>> arch/alpha/include/asm/bitops.h:289:37: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL;
                    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   drivers/net//wireless/ath/ath10k/htt_rx.c:2916:16: note: 'flags' was declared here
     unsigned long flags;
                   ^~~~~
--
   In file included from include/linux/bitops.h:19,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/completion.h:12,
                    from drivers/net/wireless/ath/ath10k/core.h:11,
                    from drivers/net/wireless/ath/ath10k/htt_rx.c:8:
   drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_update_per_peer_tx_stats':
>> arch/alpha/include/asm/bitops.h:289:37: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL;
                    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   drivers/net/wireless/ath/ath10k/htt_rx.c:2916:16: note: 'flags' was declared here
     unsigned long flags;
                   ^~~~~

vim +/flags +289 arch/alpha/include/asm/bitops.h

^1da177e include/asm-alpha/bitops.h Linus Torvalds 2005-04-16  285  
^1da177e include/asm-alpha/bitops.h Linus Torvalds 2005-04-16  286  static inline int
^1da177e include/asm-alpha/bitops.h Linus Torvalds 2005-04-16  287  test_bit(int nr, const volatile void * addr)
^1da177e include/asm-alpha/bitops.h Linus Torvalds 2005-04-16  288  {
^1da177e include/asm-alpha/bitops.h Linus Torvalds 2005-04-16 @289  	return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL;
^1da177e include/asm-alpha/bitops.h Linus Torvalds 2005-04-16  290  }
^1da177e include/asm-alpha/bitops.h Linus Torvalds 2005-04-16  291  

:::::: The code at line 289 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Feb. 24, 2019, 9:35 p.m. UTC | #2
Hi Surabhi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ath6kl/ath-next]
[also build test WARNING on v5.0-rc4 next-20190222]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Surabhi-Vishnoi/Fix-inconsistencies-observed-in-population-of-tx_stats-in-debugfs/20190225-041038
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: x86_64-fedora-25 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   In file included from include/linux/bitops.h:19:0,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/completion.h:12,
                    from drivers/net/wireless/ath/ath10k/core.h:11,
                    from drivers/net/wireless/ath/ath10k/htt_rx.c:8:
   drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_update_per_peer_tx_stats':
>> arch/x86/include/asm/bitops.h:325:37: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return ((1UL << (nr & (BITS_PER_LONG-1))) &
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      (addr[nr >> _BITOPS_LONG_SHIFT])) != 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   drivers/net/wireless/ath/ath10k/htt_rx.c:2916:16: note: 'flags' was declared here
     unsigned long flags;
                   ^~~~~
--
   In file included from include/linux/bitops.h:19:0,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/completion.h:12,
                    from drivers/net//wireless/ath/ath10k/core.h:11,
                    from drivers/net//wireless/ath/ath10k/htt_rx.c:8:
   drivers/net//wireless/ath/ath10k/htt_rx.c: In function 'ath10k_update_per_peer_tx_stats':
>> arch/x86/include/asm/bitops.h:325:37: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return ((1UL << (nr & (BITS_PER_LONG-1))) &
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      (addr[nr >> _BITOPS_LONG_SHIFT])) != 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   drivers/net//wireless/ath/ath10k/htt_rx.c:2916:16: note: 'flags' was declared here
     unsigned long flags;
                   ^~~~~

vim +/flags +325 arch/x86/include/asm/bitops.h

1c54d770 include/asm-x86/bitops.h      Jeremy Fitzhardinge 2008-01-30  321  
117780ee arch/x86/include/asm/bitops.h H. Peter Anvin      2016-06-08  322  static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr)
1c54d770 include/asm-x86/bitops.h      Jeremy Fitzhardinge 2008-01-30  323  {
9b710506 arch/x86/include/asm/bitops.h H. Peter Anvin      2013-07-16  324  	return ((1UL << (nr & (BITS_PER_LONG-1))) &
9b710506 arch/x86/include/asm/bitops.h H. Peter Anvin      2013-07-16 @325  		(addr[nr >> _BITOPS_LONG_SHIFT])) != 0;
1c54d770 include/asm-x86/bitops.h      Jeremy Fitzhardinge 2008-01-30  326  }
1c54d770 include/asm-x86/bitops.h      Jeremy Fitzhardinge 2008-01-30  327  

:::::: The code at line 325 was first introduced by commit
:::::: 9b710506a03b01a9fdd83962912bc9d8237b82e8 x86, bitops: Change bitops to be native operand size

:::::: TO: H. Peter Anvin <hpa@linux.intel.com>
:::::: CC: H. Peter Anvin <hpa@linux.intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 3a02a76..5b1dd58 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2924,12 +2924,13 @@  static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate)
 	struct rate_info *txrate = &arsta->txrate;
 	struct ath10k_htt_tx_stats *tx_stats;
 	int idx, ht_idx, gi, mcs, bw, nss;
+	unsigned long flags;
 
 	if (!arsta->tx_stats)
 		return;
 
 	tx_stats = arsta->tx_stats;
-	gi = (arsta->txrate.flags & RATE_INFO_FLAGS_SHORT_GI);
+	gi = test_bit(ATH10K_RATE_INFO_FLAGS_SGI_BIT, &flags);
 	ht_idx = txrate->mcs + txrate->nss * 8;
 	mcs = txrate->mcs;
 	bw = txrate->bw;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 7053db4..b727232 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -5062,6 +5062,7 @@  enum wmi_rate_preamble {
 #define ATH10K_GI_NUM		2
 #define ATH10K_HT_MCS_NUM	32
 #define ATH10K_RATE_TABLE_NUM	320
+#define ATH10K_RATE_INFO_FLAGS_SGI_BIT	2
 
 /* Value to disable fixed rate setting */
 #define WMI_FIXED_RATE_NONE    (0xff)