tree:
https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: be0f563c86400c13b89cfd69a1cd7ca33f21ed54
commit: be0f563c86400c13b89cfd69a1cd7ca33f21ed54 [13/13] net: stmmac: fix wrongly assigned
switch case during free irq
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
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
#
https://github.com/intel/linux-intel-lts/commit/be0f563c86400c13b89cfd69a...
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 be0f563c86400c13b89cfd69a1cd7ca33f21ed54
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
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 >>):
In file included from include/linux/err.h:5,
from include/linux/clk.h:12,
from drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:17:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >=
0 is always true [-Wtype-limits]
182 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) <
max_mapnr)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
| ^~~~~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from ./arch/xtensa/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from arch/xtensa/include/asm/current.h:18,
from include/linux/mutex.h:14,
from include/linux/notifier.h:14,
from include/linux/clk.h:14,
from drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:17:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >=
0 is always true [-Wtype-limits]
182 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) <
max_mapnr)
| ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
include/linux/dma-mapping.h:355:19: note: in expansion of macro 'pfn_valid'
355 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function
'stmmac_hwtstamp_set':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:561:7: warning: variable
'xmac' set but not used [-Wunused-but-set-variable]
561 | bool xmac;
| ^~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: At top level:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1415:6: warning: no previous
prototype for 'stmmac_alloc_rx_buffers' [-Wmissing-prototypes]
1415 | bool stmmac_alloc_rx_buffers(struct stmmac_rx_queue *rx_q, u32 count)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function
'init_dma_rx_desc_rings':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1549:15: warning: comparison of
unsigned expression >= 0 is always true [-Wtype-limits]
1549 | while (queue >= 0) {
| ^~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function
'stmmac_rx_buf1_len':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:4677:6: warning: variable
'ret' set but not used [-Wunused-but-set-variable]
4677 | int ret, coe = priv->hw->rx_csum;
| ^~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: At top level:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5825:5: warning: no previous
prototype for 'stmmac_all_queue_pairs_enable' [-Wmissing-prototypes]
5825 | int stmmac_all_queue_pairs_enable(struct stmmac_priv *priv)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5889:5: warning: no previous
prototype for 'stmmac_all_queue_pairs_disable' [-Wmissing-prototypes]
5889 | int stmmac_all_queue_pairs_disable(struct stmmac_priv *priv)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5915:5: warning: no previous
prototype for 'stmmac_xdp_xmit' [-Wmissing-prototypes]
5915 | int stmmac_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
| ^~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:6615:6: warning: no previous
prototype for 'stmmac_clean_all_tx_rings' [-Wmissing-prototypes]
6615 | void stmmac_clean_all_tx_rings(struct stmmac_priv *priv)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function
'stmmac_free_irq':
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3259:3:
warning: this statement may fall through [-Wimplicit-fallthrough=]
3259 | for
(j = irq_idx - 1; j >= 0; j--) {
| ^~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3263:2: note: here
3263 | case REQ_IRQ_ERR_SFTY_UE:
| ^~~~
vim +3259 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
c66f6c3775bed34 Thierry Reding 2017-03-10 3232
9eb600be731180f Ong Boon Leong 2019-07-26 3233 static void stmmac_free_irq(struct
net_device *dev,
9eb600be731180f Ong Boon Leong 2019-07-26 3234 enum request_irq_err irq_err, int
irq_idx)
9eb600be731180f Ong Boon Leong 2019-07-26 3235 {
9eb600be731180f Ong Boon Leong 2019-07-26 3236 struct stmmac_priv *priv =
netdev_priv(dev);
9eb600be731180f Ong Boon Leong 2019-07-26 3237 int j;
9eb600be731180f Ong Boon Leong 2019-07-26 3238
9eb600be731180f Ong Boon Leong 2019-07-26 3239 switch (irq_err) {
9eb600be731180f Ong Boon Leong 2019-07-26 3240 case REQ_IRQ_ERR_ALL:
83a25aff8a4597c Lay, Kuan Loon 2018-11-12 3241 #ifdef CONFIG_STMMAC_NETWORK_PROXY
83a25aff8a4597c Lay, Kuan Loon 2018-11-12 3242 if (priv->netprox_irq > 0
&& priv->netprox_irq != dev->irq)
83a25aff8a4597c Lay, Kuan Loon 2018-11-12 3243 free_irq(priv->netprox_irq, dev);
83a25aff8a4597c Lay, Kuan Loon 2018-11-12 3244 /* fall through */
83a25aff8a4597c Lay, Kuan Loon 2018-11-12 3245 case REQ_IRQ_ERR_NETWORK_PROXY:
83a25aff8a4597c Lay, Kuan Loon 2018-11-12 3246 #endif
9eb600be731180f Ong Boon Leong 2019-07-26 3247 irq_idx =
priv->plat->tx_queues_to_use;
9eb600be731180f Ong Boon Leong 2019-07-26 3248 /* fall through */
9eb600be731180f Ong Boon Leong 2019-07-26 3249 case REQ_IRQ_ERR_TX:
9eb600be731180f Ong Boon Leong 2019-07-26 3250 for (j = irq_idx - 1; j >= 0; j--)
{
9eb600be731180f Ong Boon Leong 2019-07-26 3251 if (priv->tx_irq[j] > 0)
56a2ef6888738a6 Ong Boon Leong 2019-09-23 3252 free_irq(priv->tx_irq[j],
56a2ef6888738a6 Ong Boon Leong 2019-09-23 3253 get_tx_queue(priv, j));
9eb600be731180f Ong Boon Leong 2019-07-26 3254 }
56a2ef6888738a6 Ong Boon Leong 2019-09-23 3255
9eb600be731180f Ong Boon Leong 2019-07-26 3256 irq_idx =
priv->plat->rx_queues_to_use;
9eb600be731180f Ong Boon Leong 2019-07-26 3257 /* fall through */
9eb600be731180f Ong Boon Leong 2019-07-26 3258 case REQ_IRQ_ERR_RX:
9eb600be731180f Ong Boon Leong 2019-07-26 @3259 for (j = irq_idx - 1; j >= 0; j--)
{
9eb600be731180f Ong Boon Leong 2019-07-26 3260 if (priv->rx_irq[j] > 0)
9eb600be731180f Ong Boon Leong 2019-07-26 3261 free_irq(priv->rx_irq[j],
&priv->rx_queue[j]);
9eb600be731180f Ong Boon Leong 2019-07-26 3262 }
be0f563c86400c1 Voon Weifeng 2020-08-26 3263 case REQ_IRQ_ERR_SFTY_UE:
9eb600be731180f Ong Boon Leong 2019-07-26 3264 if (priv->sfty_ue_irq > 0
&& priv->sfty_ue_irq != dev->irq)
9eb600be731180f Ong Boon Leong 2019-07-26 3265 free_irq(priv->sfty_ue_irq, dev);
9eb600be731180f Ong Boon Leong 2019-07-26 3266 /* fall through */
be0f563c86400c1 Voon Weifeng 2020-08-26 3267 case REQ_IRQ_ERR_SFTY_CE:
9eb600be731180f Ong Boon Leong 2019-07-26 3268 if (priv->sfty_ce_irq > 0
&& priv->sfty_ce_irq != dev->irq)
9eb600be731180f Ong Boon Leong 2019-07-26 3269 free_irq(priv->sfty_ce_irq, dev);
9eb600be731180f Ong Boon Leong 2019-07-26 3270 /* fall through */
be0f563c86400c1 Voon Weifeng 2020-08-26 3271 case REQ_IRQ_ERR_LPI:
9eb600be731180f Ong Boon Leong 2019-07-26 3272 if (priv->lpi_irq > 0 &&
priv->lpi_irq != dev->irq)
9eb600be731180f Ong Boon Leong 2019-07-26 3273 free_irq(priv->lpi_irq, dev);
9eb600be731180f Ong Boon Leong 2019-07-26 3274 /* fall through */
be0f563c86400c1 Voon Weifeng 2020-08-26 3275 case REQ_IRQ_ERR_WOL:
9eb600be731180f Ong Boon Leong 2019-07-26 3276 if (priv->wol_irq > 0 &&
priv->wol_irq != dev->irq)
9eb600be731180f Ong Boon Leong 2019-07-26 3277 free_irq(priv->wol_irq, dev);
9eb600be731180f Ong Boon Leong 2019-07-26 3278 /* fall through */
be0f563c86400c1 Voon Weifeng 2020-08-26 3279 case REQ_IRQ_ERR_MAC:
9eb600be731180f Ong Boon Leong 2019-07-26 3280 free_irq(dev->irq, dev);
9eb600be731180f Ong Boon Leong 2019-07-26 3281 /* fall through */
9eb600be731180f Ong Boon Leong 2019-07-26 3282 case REQ_IRQ_ERR_NO:
9eb600be731180f Ong Boon Leong 2019-07-26 3283 /* If MAC IRQ request error, no more
IRQ to free */
9eb600be731180f Ong Boon Leong 2019-07-26 3284 break;
9eb600be731180f Ong Boon Leong 2019-07-26 3285 }
9eb600be731180f Ong Boon Leong 2019-07-26 3286 }
9eb600be731180f Ong Boon Leong 2019-07-26 3287
:::::: The code at line 3259 was first introduced by commit
:::::: 9eb600be731180fd380fdc3d1ab11711a7a9521d net: stmmac: introduce MSI Interrupt
routines for mac, safety, RX & TX
:::::: TO: Ong Boon Leong <boon.leong.ong(a)intel.com>
:::::: CC: Voon Weifeng <weifeng.voon(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org