[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212112013.54g9Z8eq-lkp@intel.com>
Date: Sun, 11 Dec 2022 20:05:35 +0800
From: kernel test robot <lkp@...el.com>
To: Piergiorgio Beruto <piergiorgio.beruto@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Oleksij Rempel <o.rempel@...gutronix.de>
Subject: Re: [PATCH v6 net-next 3/5] drivers/net/phy: add connection between
ethtool and phylib for PLCA
Hi Piergiorgio,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Piergiorgio-Beruto/add-PLCA-RS-support-and-onsemi-NCN26000/20221211-064827
patch link: https://lore.kernel.org/r/75cb0eab15e62fc350e86ba9e5b0af72ea45b484.1670712151.git.piergiorgio.beruto%40gmail.com
patch subject: [PATCH v6 net-next 3/5] drivers/net/phy: add connection between ethtool and phylib for PLCA
config: m68k-randconfig-s043-20221211
compiler: m68k-linux-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/333e7a2a5e52756e9320c13b6fbe1f5e9aef65d4
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Piergiorgio-Beruto/add-PLCA-RS-support-and-onsemi-NCN26000/20221211-064827
git checkout 333e7a2a5e52756e9320c13b6fbe1f5e9aef65d4
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/phy/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/net/phy/phy.c:593:46: sparse: sparse: Using plain integer as NULL pointer
vim +593 drivers/net/phy/phy.c
580
581 /**
582 * phy_ethtool_set_plca_cfg - Set PLCA RS configuration
583 *
584 * @phydev: the phy_device struct
585 * @extack: extack for reporting useful error messages
586 * @plca_cfg: new PLCA configuration to apply
587 */
588 int phy_ethtool_set_plca_cfg(struct phy_device *phydev,
589 const struct phy_plca_cfg *plca_cfg,
590 struct netlink_ext_ack *extack)
591 {
592 int ret;
> 593 struct phy_plca_cfg *curr_plca_cfg = 0;
594
595 if (!phydev->drv) {
596 ret = -EIO;
597 goto out;
598 }
599
600 if (!phydev->drv->set_plca_cfg ||
601 !phydev->drv->get_plca_cfg) {
602 ret = -EOPNOTSUPP;
603 goto out;
604 }
605
606 curr_plca_cfg = kmalloc(sizeof(*curr_plca_cfg), GFP_KERNEL);
607 memset(curr_plca_cfg, 0xFF, sizeof(*curr_plca_cfg));
608
609 mutex_lock(&phydev->lock);
610
611 ret = phydev->drv->get_plca_cfg(phydev, curr_plca_cfg);
612 if (ret)
613 goto out_drv;
614
615 if (curr_plca_cfg->enabled < 0 && plca_cfg->enabled >= 0) {
616 NL_SET_ERR_MSG(extack,
617 "PHY does not support changing the PLCA 'enable' attribute");
618 ret = -EINVAL;
619 goto out_drv;
620 }
621
622 if (curr_plca_cfg->node_id < 0 && plca_cfg->node_id >= 0) {
623 NL_SET_ERR_MSG(extack,
624 "PHY does not support changing the PLCA 'local node ID' attribute");
625 ret = -EINVAL;
626 goto out_drv;
627 }
628
629 if (curr_plca_cfg->node_cnt < 0 && plca_cfg->node_cnt >= 0) {
630 NL_SET_ERR_MSG(extack,
631 "PHY does not support changing the PLCA 'node count' attribute");
632 ret = -EINVAL;
633 goto out_drv;
634 }
635
636 if (curr_plca_cfg->to_tmr < 0 && plca_cfg->to_tmr >= 0) {
637 NL_SET_ERR_MSG(extack,
638 "PHY does not support changing the PLCA 'TO timer' attribute");
639 ret = -EINVAL;
640 goto out_drv;
641 }
642
643 if (curr_plca_cfg->burst_cnt < 0 && plca_cfg->burst_cnt >= 0) {
644 NL_SET_ERR_MSG(extack,
645 "PHY does not support changing the PLCA 'burst count' attribute");
646 ret = -EINVAL;
647 goto out_drv;
648 }
649
650 if (curr_plca_cfg->burst_tmr < 0 && plca_cfg->burst_tmr >= 0) {
651 NL_SET_ERR_MSG(extack,
652 "PHY does not support changing the PLCA 'burst timer' attribute");
653 ret = -EINVAL;
654 goto out_drv;
655 }
656
657 // if enabling PLCA, perform additional sanity checks
658 if (plca_cfg->enabled > 0) {
659 if (!linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT,
660 phydev->advertising)) {
661 ret = -EOPNOTSUPP;
662 NL_SET_ERR_MSG(extack,
663 "Point to Multi-Point mode is not enabled");
664 }
665
666 // allow setting node_id concurrently with enabled
667 if (plca_cfg->node_id >= 0)
668 curr_plca_cfg->node_id = plca_cfg->node_id;
669
670 if (curr_plca_cfg->node_id >= 255) {
671 NL_SET_ERR_MSG(extack, "PLCA node ID is not set");
672 ret = -EINVAL;
673 goto out_drv;
674 }
675 }
676
677 ret = phydev->drv->set_plca_cfg(phydev, plca_cfg);
678 if (ret)
679 goto out_drv;
680
681 out_drv:
682 kfree(curr_plca_cfg);
683 mutex_unlock(&phydev->lock);
684 out:
685 return ret;
686 }
687
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (162368 bytes)
Powered by blists - more mailing lists