All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jedrzej Jagielski <jedrzej.jagielski@intel.com>,
	intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org,
	Jedrzej Jagielski <jedrzej.jagielski@intel.com>,
	anthony.l.nguyen@intel.com, oe-kbuild-all@lists.linux.dev
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 3/3] ixgbe: Cleanup after type convertion
Date: Sat, 20 Jan 2024 14:06:48 +0800	[thread overview]
Message-ID: <202401201343.wjSFEBK2-lkp@intel.com> (raw)
In-Reply-To: <20240118134332.470907-3-jedrzej.jagielski@intel.com>

Hi Jedrzej,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tnguy-next-queue/dev-queue]

url:    https://github.com/intel-lab-lkp/linux/commits/Jedrzej-Jagielski/ixgbe-Fix-smatch-warnings-after-type-convertion/20240119-015659
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
patch link:    https://lore.kernel.org/r/20240118134332.470907-3-jedrzej.jagielski%40intel.com
patch subject: [PATCH iwl-next v3 3/3] ixgbe: Cleanup after type convertion
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20240120/202401201343.wjSFEBK2-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240120/202401201343.wjSFEBK2-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401201343.wjSFEBK2-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c: In function 'ixgbe_setup_mac_link_82599':
   drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c:774:34: error: 'autoc2' undeclared (first use in this function)
     774 |         u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
         |                                  ^~~~~~
   drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c:774:34: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c:776:13: warning: unused variable 'autoc2' [-Wunused-variable]
     776 |         u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
         |             ^~~~~~


vim +/autoc2 +776 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c

   761	
   762	/**
   763	 *  ixgbe_setup_mac_link_82599 - Set MAC link speed
   764	 *  @hw: pointer to hardware structure
   765	 *  @speed: new link speed
   766	 *  @autoneg_wait_to_complete: true when waiting for completion is needed
   767	 *
   768	 *  Set the link speed in the AUTOC register and restarts link.
   769	 **/
   770	static int ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
   771					      ixgbe_link_speed speed,
   772					      bool autoneg_wait_to_complete)
   773	{
   774		u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
   775		ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
 > 776		u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
   777		u32 pma_pmd_1g, link_mode, links_reg, i;
   778		bool autoneg = false;
   779		int status;
   780	
   781		/* holds the value of AUTOC register at this current point in time */
   782		u32 current_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
   783		/* holds the cached value of AUTOC register */
   784		u32 orig_autoc = 0;
   785		/* temporary variable used for comparison purposes */
   786		u32 autoc = current_autoc;
   787	
   788		/* Check to see if speed passed in is supported. */
   789		status = hw->mac.ops.get_link_capabilities(hw, &link_capabilities,
   790							   &autoneg);
   791		if (status)
   792			return status;
   793	
   794		speed &= link_capabilities;
   795	
   796		if (speed == IXGBE_LINK_SPEED_UNKNOWN)
   797			return -EINVAL;
   798	
   799		/* Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support*/
   800		if (hw->mac.orig_link_settings_stored)
   801			orig_autoc = hw->mac.orig_autoc;
   802		else
   803			orig_autoc = autoc;
   804	
   805		link_mode = autoc & IXGBE_AUTOC_LMS_MASK;
   806		pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
   807	
   808		if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
   809		    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
   810		    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
   811			/* Set KX4/KX/KR support according to speed requested */
   812			autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP);
   813			if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
   814				if (orig_autoc & IXGBE_AUTOC_KX4_SUPP)
   815					autoc |= IXGBE_AUTOC_KX4_SUPP;
   816				if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) &&
   817				    (hw->phy.smart_speed_active == false))
   818					autoc |= IXGBE_AUTOC_KR_SUPP;
   819			}
   820			if (speed & IXGBE_LINK_SPEED_1GB_FULL)
   821				autoc |= IXGBE_AUTOC_KX_SUPP;
   822		} else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) &&
   823			   (link_mode == IXGBE_AUTOC_LMS_1G_LINK_NO_AN ||
   824			    link_mode == IXGBE_AUTOC_LMS_1G_AN)) {
   825			/* Switch from 1G SFI to 10G SFI if requested */
   826			if ((speed == IXGBE_LINK_SPEED_10GB_FULL) &&
   827			    (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI)) {
   828				autoc &= ~IXGBE_AUTOC_LMS_MASK;
   829				autoc |= IXGBE_AUTOC_LMS_10G_SERIAL;
   830			}
   831		} else if ((pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI) &&
   832			   (link_mode == IXGBE_AUTOC_LMS_10G_SERIAL)) {
   833			/* Switch from 10G SFI to 1G SFI if requested */
   834			if ((speed == IXGBE_LINK_SPEED_1GB_FULL) &&
   835			    (pma_pmd_1g == IXGBE_AUTOC_1G_SFI)) {
   836				autoc &= ~IXGBE_AUTOC_LMS_MASK;
   837				if (autoneg)
   838					autoc |= IXGBE_AUTOC_LMS_1G_AN;
   839				else
   840					autoc |= IXGBE_AUTOC_LMS_1G_LINK_NO_AN;
   841			}
   842		}
   843	
   844		if (autoc != current_autoc) {
   845			/* Restart link */
   846			status = hw->mac.ops.prot_autoc_write(hw, autoc, false);
   847			if (status)
   848				return status;
   849	
   850			/* Only poll for autoneg to complete if specified to do so */
   851			if (autoneg_wait_to_complete) {
   852				if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
   853				    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
   854				    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
   855					links_reg = 0; /*Just in case Autoneg time=0*/
   856					for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
   857						links_reg =
   858						       IXGBE_READ_REG(hw, IXGBE_LINKS);
   859						if (links_reg & IXGBE_LINKS_KX_AN_COMP)
   860							break;
   861						msleep(100);
   862					}
   863					if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
   864						status = -EIO;
   865						hw_dbg(hw, "Autoneg did not complete.\n");
   866					}
   867				}
   868			}
   869	
   870			/* Add delay to filter out noises during initial link setup */
   871			msleep(50);
   872		}
   873	
   874		return status;
   875	}
   876	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Jedrzej Jagielski <jedrzej.jagielski@intel.com>,
	intel-wired-lan@lists.osuosl.org
Cc: oe-kbuild-all@lists.linux.dev, anthony.l.nguyen@intel.com,
	netdev@vger.kernel.org,
	Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Subject: Re: [PATCH iwl-next v3 3/3] ixgbe: Cleanup after type convertion
Date: Sat, 20 Jan 2024 14:06:48 +0800	[thread overview]
Message-ID: <202401201343.wjSFEBK2-lkp@intel.com> (raw)
In-Reply-To: <20240118134332.470907-3-jedrzej.jagielski@intel.com>

Hi Jedrzej,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tnguy-next-queue/dev-queue]

url:    https://github.com/intel-lab-lkp/linux/commits/Jedrzej-Jagielski/ixgbe-Fix-smatch-warnings-after-type-convertion/20240119-015659
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
patch link:    https://lore.kernel.org/r/20240118134332.470907-3-jedrzej.jagielski%40intel.com
patch subject: [PATCH iwl-next v3 3/3] ixgbe: Cleanup after type convertion
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20240120/202401201343.wjSFEBK2-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240120/202401201343.wjSFEBK2-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401201343.wjSFEBK2-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c: In function 'ixgbe_setup_mac_link_82599':
   drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c:774:34: error: 'autoc2' undeclared (first use in this function)
     774 |         u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
         |                                  ^~~~~~
   drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c:774:34: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c:776:13: warning: unused variable 'autoc2' [-Wunused-variable]
     776 |         u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
         |             ^~~~~~


vim +/autoc2 +776 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c

   761	
   762	/**
   763	 *  ixgbe_setup_mac_link_82599 - Set MAC link speed
   764	 *  @hw: pointer to hardware structure
   765	 *  @speed: new link speed
   766	 *  @autoneg_wait_to_complete: true when waiting for completion is needed
   767	 *
   768	 *  Set the link speed in the AUTOC register and restarts link.
   769	 **/
   770	static int ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
   771					      ixgbe_link_speed speed,
   772					      bool autoneg_wait_to_complete)
   773	{
   774		u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
   775		ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
 > 776		u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
   777		u32 pma_pmd_1g, link_mode, links_reg, i;
   778		bool autoneg = false;
   779		int status;
   780	
   781		/* holds the value of AUTOC register at this current point in time */
   782		u32 current_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
   783		/* holds the cached value of AUTOC register */
   784		u32 orig_autoc = 0;
   785		/* temporary variable used for comparison purposes */
   786		u32 autoc = current_autoc;
   787	
   788		/* Check to see if speed passed in is supported. */
   789		status = hw->mac.ops.get_link_capabilities(hw, &link_capabilities,
   790							   &autoneg);
   791		if (status)
   792			return status;
   793	
   794		speed &= link_capabilities;
   795	
   796		if (speed == IXGBE_LINK_SPEED_UNKNOWN)
   797			return -EINVAL;
   798	
   799		/* Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support*/
   800		if (hw->mac.orig_link_settings_stored)
   801			orig_autoc = hw->mac.orig_autoc;
   802		else
   803			orig_autoc = autoc;
   804	
   805		link_mode = autoc & IXGBE_AUTOC_LMS_MASK;
   806		pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
   807	
   808		if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
   809		    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
   810		    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
   811			/* Set KX4/KX/KR support according to speed requested */
   812			autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP);
   813			if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
   814				if (orig_autoc & IXGBE_AUTOC_KX4_SUPP)
   815					autoc |= IXGBE_AUTOC_KX4_SUPP;
   816				if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) &&
   817				    (hw->phy.smart_speed_active == false))
   818					autoc |= IXGBE_AUTOC_KR_SUPP;
   819			}
   820			if (speed & IXGBE_LINK_SPEED_1GB_FULL)
   821				autoc |= IXGBE_AUTOC_KX_SUPP;
   822		} else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) &&
   823			   (link_mode == IXGBE_AUTOC_LMS_1G_LINK_NO_AN ||
   824			    link_mode == IXGBE_AUTOC_LMS_1G_AN)) {
   825			/* Switch from 1G SFI to 10G SFI if requested */
   826			if ((speed == IXGBE_LINK_SPEED_10GB_FULL) &&
   827			    (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI)) {
   828				autoc &= ~IXGBE_AUTOC_LMS_MASK;
   829				autoc |= IXGBE_AUTOC_LMS_10G_SERIAL;
   830			}
   831		} else if ((pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI) &&
   832			   (link_mode == IXGBE_AUTOC_LMS_10G_SERIAL)) {
   833			/* Switch from 10G SFI to 1G SFI if requested */
   834			if ((speed == IXGBE_LINK_SPEED_1GB_FULL) &&
   835			    (pma_pmd_1g == IXGBE_AUTOC_1G_SFI)) {
   836				autoc &= ~IXGBE_AUTOC_LMS_MASK;
   837				if (autoneg)
   838					autoc |= IXGBE_AUTOC_LMS_1G_AN;
   839				else
   840					autoc |= IXGBE_AUTOC_LMS_1G_LINK_NO_AN;
   841			}
   842		}
   843	
   844		if (autoc != current_autoc) {
   845			/* Restart link */
   846			status = hw->mac.ops.prot_autoc_write(hw, autoc, false);
   847			if (status)
   848				return status;
   849	
   850			/* Only poll for autoneg to complete if specified to do so */
   851			if (autoneg_wait_to_complete) {
   852				if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
   853				    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
   854				    link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
   855					links_reg = 0; /*Just in case Autoneg time=0*/
   856					for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
   857						links_reg =
   858						       IXGBE_READ_REG(hw, IXGBE_LINKS);
   859						if (links_reg & IXGBE_LINKS_KX_AN_COMP)
   860							break;
   861						msleep(100);
   862					}
   863					if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
   864						status = -EIO;
   865						hw_dbg(hw, "Autoneg did not complete.\n");
   866					}
   867				}
   868			}
   869	
   870			/* Add delay to filter out noises during initial link setup */
   871			msleep(50);
   872		}
   873	
   874		return status;
   875	}
   876	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2024-01-20  6:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 13:43 [Intel-wired-lan] [PATCH iwl-next v3 1/3] ixgbe: Convert ret val type from s32 to int Jedrzej Jagielski
2024-01-18 13:43 ` Jedrzej Jagielski
2024-01-18 13:43 ` [Intel-wired-lan] [PATCH iwl-next v3 2/3] ixgbe: Fix smatch warnings after type convertion Jedrzej Jagielski
2024-01-18 13:43   ` Jedrzej Jagielski
2024-01-18 14:02   ` [Intel-wired-lan] " Dan Carpenter
2024-01-18 14:02     ` Dan Carpenter
2024-01-18 13:43 ` [Intel-wired-lan] [PATCH iwl-next v3 3/3] ixgbe: Cleanup " Jedrzej Jagielski
2024-01-18 13:43   ` Jedrzej Jagielski
2024-01-18 14:28   ` [Intel-wired-lan] " Paul Menzel
2024-01-18 14:28     ` Paul Menzel
2024-01-18 14:33   ` Przemek Kitszel
2024-01-18 14:33     ` Przemek Kitszel
2024-01-24 12:34     ` [Intel-wired-lan] " Jagielski, Jedrzej
2024-01-24 12:34       ` Jagielski, Jedrzej
2024-01-19 16:02   ` [Intel-wired-lan] " Simon Horman
2024-01-19 16:02     ` Simon Horman
2024-01-20  6:06   ` kernel test robot [this message]
2024-01-20  6:06     ` kernel test robot
2024-01-20  8:16   ` [Intel-wired-lan] " kernel test robot
2024-01-20  8:16     ` kernel test robot
2024-01-22 21:18 ` [Intel-wired-lan] [PATCH iwl-next v3 1/3] ixgbe: Convert ret val type from s32 to int Tony Nguyen
2024-01-22 21:18   ` Tony Nguyen
2024-01-25 10:16   ` [Intel-wired-lan] " Jagielski, Jedrzej
2024-01-25 10:16     ` Jagielski, Jedrzej
2024-01-25 19:31     ` [Intel-wired-lan] " Tony Nguyen
2024-01-25 19:31       ` Tony Nguyen

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=202401201343.wjSFEBK2-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jedrzej.jagielski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.