CC: kbuild-all(a)lists.01.org In-Reply-To: <20210606201705.31307-4-dariobin@libero.it> References: <20210606201705.31307-4-dariobin@libero.it> TO: Dario Binacchi TO: linux-kernel(a)vger.kernel.org CC: Gianluca Falavigna CC: Dario Binacchi CC: Jakub Kicinski CC: "Marc Kleine-Budde" CC: Oliver Hartkopp CC: Tong Zhang CC: Vincent Mailhol CC: Wolfgang Grandegger CC: YueHaibing Hi Dario, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mkl-can-next/testing] [also build test WARNING on linux/master net/master linus/master v5.13-rc5] [cannot apply to net-next/master sparc-next/master next-20210604] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Dario-Binacchi/can-c_can-cache-frames-to-operate-as-a-true-FIFO/20210607-042041 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git testing :::::: branch date: 14 hours ago :::::: commit date: 14 hours ago config: h8300-randconfig-s031-20210607 (attached as .config) compiler: h8300-linux-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://github.com/0day-ci/linux/commit/19123a06211906a51c0647c1a427b6549635172f git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Dario-Binacchi/can-c_can-cache-frames-to-operate-as-a-true-FIFO/20210607-042041 git checkout 19123a06211906a51c0647c1a427b6549635172f # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=h8300 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/net/can/c_can/c_can.c:491:9: sparse: sparse: context imbalance in 'c_can_start_xmit' - different lock contexts for basic block vim +/c_can_start_xmit +491 drivers/net/can/c_can/c_can.c 5098c41911740f Dario Binacchi 2021-06-06 452 881ff67ad45041 Bhupesh Sharma 2011-02-13 453 static netdev_tx_t c_can_start_xmit(struct sk_buff *skb, 881ff67ad45041 Bhupesh Sharma 2011-02-13 454 struct net_device *dev) 881ff67ad45041 Bhupesh Sharma 2011-02-13 455 { 881ff67ad45041 Bhupesh Sharma 2011-02-13 456 struct can_frame *frame = (struct can_frame *)skb->data; 35bdafb576c5c0 Thomas Gleixner 2014-04-11 457 struct c_can_priv *priv = netdev_priv(dev); 5098c41911740f Dario Binacchi 2021-06-06 458 struct c_can_tx_ring *tx_ring = &priv->tx; 19123a06211906 Dario Binacchi 2021-06-06 459 u32 idx, obj, cmd = IF_COMM_TX; 881ff67ad45041 Bhupesh Sharma 2011-02-13 460 881ff67ad45041 Bhupesh Sharma 2011-02-13 461 if (can_dropped_invalid_skb(dev, skb)) 881ff67ad45041 Bhupesh Sharma 2011-02-13 462 return NETDEV_TX_OK; 35bdafb576c5c0 Thomas Gleixner 2014-04-11 463 5098c41911740f Dario Binacchi 2021-06-06 464 if (c_can_tx_busy(priv, tx_ring)) 5098c41911740f Dario Binacchi 2021-06-06 465 return NETDEV_TX_BUSY; 5098c41911740f Dario Binacchi 2021-06-06 466 5098c41911740f Dario Binacchi 2021-06-06 467 idx = c_can_get_tx_head(tx_ring); 5098c41911740f Dario Binacchi 2021-06-06 468 tx_ring->head++; 5098c41911740f Dario Binacchi 2021-06-06 469 if (c_can_get_tx_free(tx_ring) == 0) 881ff67ad45041 Bhupesh Sharma 2011-02-13 470 netif_stop_queue(dev); 5098c41911740f Dario Binacchi 2021-06-06 471 19123a06211906 Dario Binacchi 2021-06-06 472 spin_lock_bh(&priv->tx_lock); 19123a06211906 Dario Binacchi 2021-06-06 473 if (idx < c_can_get_tx_tail(tx_ring)) 19123a06211906 Dario Binacchi 2021-06-06 474 cmd &= ~IF_COMM_TXRQST; /* Cache the message */ 19123a06211906 Dario Binacchi 2021-06-06 475 else 19123a06211906 Dario Binacchi 2021-06-06 476 spin_unlock_bh(&priv->tx_lock); 5098c41911740f Dario Binacchi 2021-06-06 477 172f6d3a031b5e Marc Kleine-Budde 2021-03-04 478 /* Store the message in the interface so we can call 35bdafb576c5c0 Thomas Gleixner 2014-04-11 479 * can_put_echo_skb(). We must do this before we enable 35bdafb576c5c0 Thomas Gleixner 2014-04-11 480 * transmit as we might race against do_tx(). 35bdafb576c5c0 Thomas Gleixner 2014-04-11 481 */ 939415973fdfb2 Thomas Gleixner 2014-04-11 482 c_can_setup_tx_object(dev, IF_TX, frame, idx); c7b74967799b1a Oliver Hartkopp 2020-11-20 483 priv->dlc[idx] = frame->len; 1dcb6e57db8334 Vincent Mailhol 2021-01-11 484 can_put_echo_skb(skb, dev, idx, 0); 19123a06211906 Dario Binacchi 2021-06-06 485 obj = idx + priv->msg_obj_tx_first; 19123a06211906 Dario Binacchi 2021-06-06 486 c_can_object_put(dev, IF_TX, obj, cmd); 35bdafb576c5c0 Thomas Gleixner 2014-04-11 487 19123a06211906 Dario Binacchi 2021-06-06 488 if (spin_is_locked(&priv->tx_lock)) 19123a06211906 Dario Binacchi 2021-06-06 489 spin_unlock_bh(&priv->tx_lock); 881ff67ad45041 Bhupesh Sharma 2011-02-13 490 881ff67ad45041 Bhupesh Sharma 2011-02-13 @491 return NETDEV_TX_OK; 881ff67ad45041 Bhupesh Sharma 2011-02-13 492 } 881ff67ad45041 Bhupesh Sharma 2011-02-13 493 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org