llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH RFC net-next 9/9] net: pcs: xpcs: avoid reading STAT1 more than once
       [not found] <E1pxWYT-002Qsg-Rg@rmk-PC.armlinux.org.uk>
@ 2023-05-12 19:49 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-05-12 19:49 UTC (permalink / raw)
  To: Russell King (Oracle); +Cc: llvm, oe-kbuild-all

Hi Russell,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Russell-King-Oracle/net-phylink-remove-duplicated-linkmode-pause-resolution/20230513-013023
base:   net-next/main
patch link:    https://lore.kernel.org/r/E1pxWYT-002Qsg-Rg%40rmk-PC.armlinux.org.uk
patch subject: [PATCH RFC net-next 9/9] net: pcs: xpcs: avoid reading STAT1 more than once
config: x86_64-randconfig-a003 (https://download.01.org/0day-ci/archive/20230513/202305130351.NXLzJBVi-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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-lab-lkp/linux/commit/b53ffb41edb525ad6831e2b00b2e06389b8ef97c
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Russell-King-Oracle/net-phylink-remove-duplicated-linkmode-pause-resolution/20230513-013023
        git checkout b53ffb41edb525ad6831e2b00b2e06389b8ef97c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/pcs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305130351.NXLzJBVi-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/net/pcs/pcs-xpcs.c:868:10: error: use of undeclared identifier 'stat1'; did you mean 'state'?
                   return stat1;
                          ^~~~~
                          state
   drivers/net/pcs/pcs-xpcs.c:853:37: note: 'state' declared here
                                 struct phylink_link_state *state,
                                                            ^
>> drivers/net/pcs/pcs-xpcs.c:868:10: warning: incompatible pointer to integer conversion returning 'struct phylink_link_state *' from a function with result type 'int' [-Wint-conversion]
                   return stat1;
                          ^~~~~
   drivers/net/pcs/pcs-xpcs.c:872:19: error: use of undeclared identifier 'stat1'
           state->link = !!(stat1 & MDIO_STAT1_LSTATUS);
                            ^
   1 warning and 2 errors generated.


vim +868 drivers/net/pcs/pcs-xpcs.c

   851	
   852	static int xpcs_get_state_c73(struct dw_xpcs *xpcs,
   853				      struct phylink_link_state *state,
   854				      const struct xpcs_compat *compat)
   855	{
   856		bool an_enabled;
   857		int pcs_stat1;
   858		int an_stat1;
   859		int ret;
   860	
   861		/* The link status bit is latching-low, so it is important to
   862		 * avoid unnecessary re-reads of this register to avoid missing
   863		 * a link-down event.
   864		 */
   865		pcs_stat1 = xpcs_read(xpcs, MDIO_MMD_PCS, MDIO_STAT1);
   866		if (pcs_stat1 < 0) {
   867			state->link = false;
 > 868			return stat1;
   869		}
   870	
   871		/* Link needs to be read first ... */
   872		state->link = !!(stat1 & MDIO_STAT1_LSTATUS);
   873	
   874		/* ... and then we check the faults. */
   875		ret = xpcs_read_fault_c73(xpcs, state, pcs_stat1);
   876		if (ret) {
   877			ret = xpcs_soft_reset(xpcs, compat);
   878			if (ret)
   879				return ret;
   880	
   881			state->link = 0;
   882	
   883			return xpcs_do_config(xpcs, state->interface, MLO_AN_INBAND, NULL);
   884		}
   885	
   886		/* There is no point doing anything else if the link is down. */
   887		if (!state->link)
   888			return 0;
   889	
   890		an_enabled = linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
   891					       state->advertising);
   892		if (an_enabled) {
   893			/* The link status bit is latching-low, so it is important to
   894			 * avoid unnecessary re-reads of this register to avoid missing
   895			 * a link-down event.
   896			 */
   897			an_stat1 = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_STAT1);
   898			if (an_stat1 < 0) {
   899				state->link = false;
   900				return an_stat1;
   901			}
   902	
   903			state->an_complete = xpcs_aneg_done_c73(xpcs, state, compat,
   904								an_stat1);
   905			if (!state->an_complete) {
   906				state->link = false;
   907				return 0;
   908			}
   909	
   910			ret = xpcs_read_lpa_c73(xpcs, state, an_stat1);
   911			if (ret < 0) {
   912				state->link = false;
   913				return ret;
   914			}
   915	
   916			phylink_resolve_c73(state);
   917		} else {
   918			xpcs_resolve_pma(xpcs, state);
   919		}
   920	
   921		return 0;
   922	}
   923	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-12 19:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1pxWYT-002Qsg-Rg@rmk-PC.armlinux.org.uk>
2023-05-12 19:49 ` [PATCH RFC net-next 9/9] net: pcs: xpcs: avoid reading STAT1 more than once kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).