From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [intel-linux-intel-lts:5.4/yocto 972/1142] drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5781 stmmac_all_queue_pairs_enable() warn: inconsistent returns 'priv->lock'.
Date: Thu, 26 Nov 2020 03:50:18 +0800 [thread overview]
Message-ID: <202011260314.eCNonbrm-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6918 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Ong Boon Leong <boon.leong.ong@intel.com>
CC: "Li, Yifan" <yifan2.li@intel.com>
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
:::::: branch date: 3 months ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-m001-20201125 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5781 stmmac_all_queue_pairs_enable() warn: inconsistent returns 'priv->lock'.
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5829 stmmac_all_queue_pairs_disable() warn: inconsistent returns 'priv->lock'.
Old smatch warnings:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:853 stmmac_init_ptp() error: uninitialized symbol 'sec_inc'.
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1488 stmmac_alloc_rx_buffers() warn: always true condition '(--i >= 0) => (0-u32max >= 0)'
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1488 stmmac_alloc_rx_buffers() warn: always true condition '(--i >= 0) => (0-u32max >= 0)'
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1596 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1596 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
vim +5781 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5759
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5760 int stmmac_all_queue_pairs_enable(struct stmmac_priv *priv)
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5761 {
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5762 int i;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5763
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5764 mutex_lock(&priv->lock);
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5765
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5766 if (stmmac_enabled_xdp(priv))
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5767 priv->plat->normal_tx_queue_count = priv->plat->num_queue_pairs;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5768 else
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5769 priv->plat->normal_tx_queue_count =
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5770 priv->plat->tx_queues_to_use;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5771
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5772 for (i = 0; i < priv->plat->num_queue_pairs; i++) {
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5773 int err = stmmac_queue_pair_enable(priv, i);
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5774
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5775 if (err)
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5776 return err;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5777 }
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5778
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5779 mutex_unlock(&priv->lock);
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5780
fabf035bcf07c8d Ong Boon Leong 2020-05-27 @5781 return 0;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5782 }
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5783
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5784 /**
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5785 * stmmac_queue_pair_disable - Disables a queue pair
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5786 * @priv: driver private structure
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5787 * @queue_pair: queue pair
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5788 *
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5789 * Returns 0 on success, <0 on failure.
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5790 **/
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5791 int stmmac_queue_pair_disable(struct stmmac_priv *priv, u16 qid)
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5792 {
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5793 u16 qp_num = priv->plat->num_queue_pairs;
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5794 int ret;
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5795
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5796 if (qid >= qp_num) {
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5797 netdev_err(priv->dev,
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5798 "%s: qid (%d) > number of queue pairs (%d)\n",
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5799 __func__, qid, qp_num);
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5800
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5801 return -EINVAL;
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5802 }
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5803
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5804 stmmac_napi_control(priv, qid, false);
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5805 ret = stmmac_txrx_irq_control(priv, qid, false);
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5806 if (ret)
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5807 return ret;
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5808 stmmac_txrx_dma_control(priv, qid, false);
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5809 stmmac_txrx_desc_control(priv, qid, false);
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5810
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5811 return ret;
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5812 }
3d7b7b3cc2288f5 Ong Boon Leong 2019-09-28 5813
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5814 int stmmac_all_queue_pairs_disable(struct stmmac_priv *priv)
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5815 {
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5816 int i;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5817
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5818 mutex_lock(&priv->lock);
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5819
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5820 for (i = 0; i < priv->plat->num_queue_pairs; i++) {
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5821 int err = stmmac_queue_pair_disable(priv, i);
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5822
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5823 if (err)
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5824 return err;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5825 }
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5826
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5827 mutex_unlock(&priv->lock);
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5828
fabf035bcf07c8d Ong Boon Leong 2020-05-27 @5829 return 0;
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5830 }
fabf035bcf07c8d Ong Boon Leong 2020-05-27 5831
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31686 bytes --]
next reply other threads:[~2020-11-25 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 19:50 kernel test robot [this message]
2021-06-15 21:45 [intel-linux-intel-lts:5.4/yocto 972/1142] drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5781 stmmac_all_queue_pairs_enable() warn: inconsistent returns '&priv->lock' kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202011260314.eCNonbrm-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.