tree:
https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: eeb611e5394c56d45c5cc8f7dc484c9f19e93143
commit: fabf035bcf07c8de58a4194b9440b566033892bb [972/1142] net: stmmac: add
stmmac_all_queue_pairs_enable|disable() for XDP setup
config: x86_64-randconfig-r006-20201111 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
874b0a0b9db93f5d3350ffe6b5efda2d908415d0)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
#
https://github.com/intel/linux-intel-lts/commit/fabf035bcf07c8de58a4194b9...
git remote add intel-linux-intel-lts
https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout fabf035bcf07c8de58a4194b9440b566033892bb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:848:3: warning: variable
'sec_inc' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
stmmac_config_sub_second_increment(priv,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/hwif.h:674:2: note: expanded from macro
'stmmac_config_sub_second_increment'
stmmac_do_void_callback(__priv, ptp, config_sub_second_increment, __args)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/hwif.h:14:6: note: expanded from macro
'stmmac_do_void_callback'
if ((__priv)->hw->__module &&
(__priv)->hw->__module->__cname) { \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:853:33: note: uninitialized use
occurs here
temp = div_u64(1000000000ULL, sec_inc);
^~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:848:3: note: remove the 'if'
if its condition is always true
stmmac_config_sub_second_increment(priv,
^
drivers/net/ethernet/stmicro/stmmac/hwif.h:674:2: note: expanded from macro
'stmmac_config_sub_second_increment'
stmmac_do_void_callback(__priv, ptp, config_sub_second_increment, __args)
^
drivers/net/ethernet/stmicro/stmmac/hwif.h:14:2: note: expanded from macro
'stmmac_do_void_callback'
if ((__priv)->hw->__module &&
(__priv)->hw->__module->__cname) { \
^
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:848:3: warning: variable
'sec_inc' is used uninitialized whenever '&&' condition is false
[-Wsometimes-uninitialized]
stmmac_config_sub_second_increment(priv,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/hwif.h:674:2: note: expanded from macro
'stmmac_config_sub_second_increment'
stmmac_do_void_callback(__priv, ptp, config_sub_second_increment, __args)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/hwif.h:14:6: note: expanded from macro
'stmmac_do_void_callback'
if ((__priv)->hw->__module &&
(__priv)->hw->__module->__cname) { \
^~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:853:33: note: uninitialized use
occurs here
temp = div_u64(1000000000ULL, sec_inc);
^~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:848:3: note: remove the
'&&' if its condition is always true
stmmac_config_sub_second_increment(priv,
^
drivers/net/ethernet/stmicro/stmmac/hwif.h:674:2: note: expanded from macro
'stmmac_config_sub_second_increment'
stmmac_do_void_callback(__priv, ptp, config_sub_second_increment, __args)
^
drivers/net/ethernet/stmicro/stmmac/hwif.h:14:6: note: expanded from macro
'stmmac_do_void_callback'
if ((__priv)->hw->__module &&
(__priv)->hw->__module->__cname) { \
^
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:813:13: note: initialize the variable
'sec_inc' to silence this warning
u32 sec_inc;
^
= 0
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1462:6: warning: no previous
prototype for function 'stmmac_alloc_rx_buffers' [-Wmissing-prototypes]
bool stmmac_alloc_rx_buffers(struct stmmac_rx_queue *rx_q, u32 count)
^
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1462:1: note: declare
'static' if the function is not intended to be used outside of this translation
unit
bool stmmac_alloc_rx_buffers(struct stmmac_rx_queue *rx_q, u32 count)
^
static
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5760:5:
warning: no previous prototype for function 'stmmac_all_queue_pairs_enable'
[-Wmissing-prototypes]
int stmmac_all_queue_pairs_enable(struct stmmac_priv
*priv)
^
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5760:1: note: declare
'static' if the function is not intended to be used outside of this translation
unit
int stmmac_all_queue_pairs_enable(struct stmmac_priv *priv)
^
static
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5814:5:
warning: no previous prototype for function 'stmmac_all_queue_pairs_disable'
[-Wmissing-prototypes]
int stmmac_all_queue_pairs_disable(struct stmmac_priv
*priv)
^
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5814:1: note: declare
'static' if the function is not intended to be used outside of this translation
unit
int stmmac_all_queue_pairs_disable(struct stmmac_priv *priv)
^
static
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5837:5: warning: no previous
prototype for function 'stmmac_xdp_xmit' [-Wmissing-prototypes]
int stmmac_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
^
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5837:1: note: declare
'static' if the function is not intended to be used outside of this translation
unit
int stmmac_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
^
static
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:6552:6: warning: no previous
prototype for function 'stmmac_clean_all_tx_rings' [-Wmissing-prototypes]
void stmmac_clean_all_tx_rings(struct stmmac_priv *priv)
^
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:6552:1: note: declare
'static' if the function is not intended to be used outside of this translation
unit
void stmmac_clean_all_tx_rings(struct stmmac_priv *priv)
^
static
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:4364:19: warning: unused function
'stmmac_rx_threshold_count' [-Wunused-function]
static inline int stmmac_rx_threshold_count(struct stmmac_rx_queue *rx_q)
^
8 warnings generated.
vim +/stmmac_all_queue_pairs_enable +5760
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
5759
5760 int stmmac_all_queue_pairs_enable(struct stmmac_priv *priv)
5761 {
5762 int i;
5763
5764 mutex_lock(&priv->lock);
5765
5766 if (stmmac_enabled_xdp(priv))
5767 priv->plat->normal_tx_queue_count = priv->plat->num_queue_pairs;
5768 else
5769 priv->plat->normal_tx_queue_count =
5770 priv->plat->tx_queues_to_use;
5771
5772 for (i = 0; i < priv->plat->num_queue_pairs; i++) {
5773 int err = stmmac_queue_pair_enable(priv, i);
5774
5775 if (err)
5776 return err;
5777 }
5778
5779 mutex_unlock(&priv->lock);
5780
5781 return 0;
5782 }
5783
5784 /**
5785 * stmmac_queue_pair_disable - Disables a queue pair
5786 * @priv: driver private structure
5787 * @queue_pair: queue pair
5788 *
5789 * Returns 0 on success, <0 on failure.
5790 **/
5791 int stmmac_queue_pair_disable(struct stmmac_priv *priv, u16 qid)
5792 {
5793 u16 qp_num = priv->plat->num_queue_pairs;
5794 int ret;
5795
5796 if (qid >= qp_num) {
5797 netdev_err(priv->dev,
5798 "%s: qid (%d) > number of queue pairs (%d)\n",
5799 __func__, qid, qp_num);
5800
5801 return -EINVAL;
5802 }
5803
5804 stmmac_napi_control(priv, qid, false);
5805 ret = stmmac_txrx_irq_control(priv, qid, false);
5806 if (ret)
5807 return ret;
5808 stmmac_txrx_dma_control(priv, qid, false);
5809 stmmac_txrx_desc_control(priv, qid, false);
5810
5811 return ret;
5812 }
5813
5814 int stmmac_all_queue_pairs_disable(struct stmmac_priv *priv)
5815 {
5816 int i;
5817
5818 mutex_lock(&priv->lock);
5819
5820 for (i = 0; i < priv->plat->num_queue_pairs; i++) {
5821 int err = stmmac_queue_pair_disable(priv, i);
5822
5823 if (err)
5824 return err;
5825 }
5826
5827 mutex_unlock(&priv->lock);
5828
5829 return 0;
5830 }
5831
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org