linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: cavium: thunder: Add log for verification fail in bgx_poll_for_link()
@ 2025-05-19 15:23 Wentao Liang
  2025-05-20  4:37 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2025-05-19 15:23 UTC (permalink / raw)
  To: sgoutham, andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: linux-arm-kernel, netdev, linux-kernel, Wentao Liang

The bgx_poll_for_link() calls bgx_poll_reg() but does not handle the
return value. The link setting is not verified if the polling operation
times out. It helps to debug if the link polling fails.

Add a time out error log for bgx_poll_reg().

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 608cc6af5af1..eadc58de35ac 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1007,8 +1007,9 @@ static void bgx_poll_for_link(struct work_struct *work)
 	/* Receive link is latching low. Force it high and verify it */
 	bgx_reg_modify(lmac->bgx, lmac->lmacid,
 		       BGX_SPUX_STATUS1, SPU_STATUS1_RCV_LNK);
-	bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
-		     SPU_STATUS1_RCV_LNK, false);
+	if (bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
+			 SPU_STATUS1_RCV_LNK, false))
+		dev_err(lmac->bgx->pdev->dev, "BXG verification fail with time out.\n");
 
 	spu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1);
 	smu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SMUX_RX_CTL);
-- 
2.42.0.windows.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: cavium: thunder: Add log for verification fail in bgx_poll_for_link()
  2025-05-19 15:23 [PATCH] net: cavium: thunder: Add log for verification fail in bgx_poll_for_link() Wentao Liang
@ 2025-05-20  4:37 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-05-20  4:37 UTC (permalink / raw)
  To: Wentao Liang, sgoutham, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: oe-kbuild-all, linux-arm-kernel, netdev, linux-kernel,
	Wentao Liang

Hi Wentao,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]
[also build test ERROR on net/main linus/master v6.15-rc7 next-20250516]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Wentao-Liang/net-cavium-thunder-Add-log-for-verification-fail-in-bgx_poll_for_link/20250519-232542
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250519152348.2839-1-vulab%40iscas.ac.cn
patch subject: [PATCH] net: cavium: thunder: Add log for verification fail in bgx_poll_for_link()
config: sparc-randconfig-002-20250520 (https://download.01.org/0day-ci/archive/20250520/202505201239.5YN7PGlt-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250520/202505201239.5YN7PGlt-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/202505201239.5YN7PGlt-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/acpi.h:14,
                    from drivers/net/ethernet/cavium/thunder/thunder_bgx.c:6:
   drivers/net/ethernet/cavium/thunder/thunder_bgx.c: In function 'bgx_poll_for_link':
>> drivers/net/ethernet/cavium/thunder/thunder_bgx.c:1012:40: error: incompatible type for argument 1 of '_dev_err'
    1012 |                 dev_err(lmac->bgx->pdev->dev, "BXG verification fail with time out.\n");
         |                         ~~~~~~~~~~~~~~~^~~~~
         |                                        |
         |                                        struct device
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/net/ethernet/cavium/thunder/thunder_bgx.c:1012:17: note: in expansion of macro 'dev_err'
    1012 |                 dev_err(lmac->bgx->pdev->dev, "BXG verification fail with time out.\n");
         |                 ^~~~~~~
   include/linux/dev_printk.h:50:36: note: expected 'const struct device *' but argument is of type 'struct device'
      50 | void _dev_err(const struct device *dev, const char *fmt, ...);
         |               ~~~~~~~~~~~~~~~~~~~~~^~~


vim +/_dev_err +1012 drivers/net/ethernet/cavium/thunder/thunder_bgx.c

   995	
   996	static void bgx_poll_for_link(struct work_struct *work)
   997	{
   998		struct lmac *lmac;
   999		u64 spu_link, smu_link;
  1000	
  1001		lmac = container_of(work, struct lmac, dwork.work);
  1002		if (lmac->is_sgmii) {
  1003			bgx_poll_for_sgmii_link(lmac);
  1004			return;
  1005		}
  1006	
  1007		/* Receive link is latching low. Force it high and verify it */
  1008		bgx_reg_modify(lmac->bgx, lmac->lmacid,
  1009			       BGX_SPUX_STATUS1, SPU_STATUS1_RCV_LNK);
  1010		if (bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
  1011				 SPU_STATUS1_RCV_LNK, false))
> 1012			dev_err(lmac->bgx->pdev->dev, "BXG verification fail with time out.\n");
  1013	
  1014		spu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1);
  1015		smu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SMUX_RX_CTL);
  1016	
  1017		if ((spu_link & SPU_STATUS1_RCV_LNK) &&
  1018		    !(smu_link & SMU_RX_CTL_STATUS)) {
  1019			lmac->link_up = true;
  1020			if (lmac->lmac_type == BGX_MODE_XLAUI)
  1021				lmac->last_speed = SPEED_40000;
  1022			else
  1023				lmac->last_speed = SPEED_10000;
  1024			lmac->last_duplex = DUPLEX_FULL;
  1025		} else {
  1026			lmac->link_up = false;
  1027			lmac->last_speed = SPEED_UNKNOWN;
  1028			lmac->last_duplex = DUPLEX_UNKNOWN;
  1029		}
  1030	
  1031		if (lmac->last_link != lmac->link_up) {
  1032			if (lmac->link_up) {
  1033				if (bgx_xaui_check_link(lmac)) {
  1034					/* Errors, clear link_up state */
  1035					lmac->link_up = false;
  1036					lmac->last_speed = SPEED_UNKNOWN;
  1037					lmac->last_duplex = DUPLEX_UNKNOWN;
  1038				}
  1039			}
  1040			lmac->last_link = lmac->link_up;
  1041		}
  1042	
  1043		queue_delayed_work(lmac->check_link, &lmac->dwork, HZ * 2);
  1044	}
  1045	

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-20  4:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 15:23 [PATCH] net: cavium: thunder: Add log for verification fail in bgx_poll_for_link() Wentao Liang
2025-05-20  4:37 ` 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).