lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ebc90ce4-382b-4a0f-891a-5305599f9ae2@intel.com>
Date: Thu, 23 Oct 2025 18:10:01 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Jijie Shao <shaojijie@...wei.com>, <davem@...emloft.net>,
	<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
	<andrew+netdev@...n.ch>, <horms@...nel.org>
CC: <shenjian15@...wei.com>, <liuyonglong@...wei.com>,
	<chenhao418@...wei.com>, <lantao5@...wei.com>,
	<huangdonghua3@...artners.com>, <yangshuaisong@...artners.com>,
	<jonathan.cameron@...wei.com>, <salil.mehta@...wei.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net 2/3] net: hibmcge: remove unnecessary check for
 np_link_fail in scenarios without phy.



On 10/21/2025 7:00 AM, Jijie Shao wrote:
> hibmcge driver uses fixed_phy to configure scenarios without PHY,
> where the driver is always in a linked state. However,
> there might be no link in hardware, so the np_link error
> is detected in hbg_hw_adjust_link(), which can cause abnormal logs.
> 

Perhaps I am missing something here. You mention the driver is always in
a linked state, but that there could be no link in hardware?

I'm not sure I properly understand whats going wrong here..

> Therefore, in scenarios without a PHY, the driver no longer
> checks the np_link status.
> 
> Fixes: 1d7cd7a9c69c ("net: hibmcge: support scenario without PHY")
> Signed-off-by: Jijie Shao <shaojijie@...wei.com>
> ---
>  drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h | 1 +
>  drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c     | 3 +++
>  drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c   | 1 -
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h b/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
> index ea09a09c451b..2097e4c2b3d7 100644
> --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
> +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
> @@ -17,6 +17,7 @@
>  #define HBG_PCU_CACHE_LINE_SIZE		32
>  #define HBG_TX_TIMEOUT_BUF_LEN		1024
>  #define HBG_RX_DESCR			0x01
> +#define HBG_NO_PHY			0xFF
>  
>  #define HBG_PACKET_HEAD_SIZE	((HBG_RX_SKIP1 + HBG_RX_SKIP2 + \
>  				  HBG_RX_DESCR) * HBG_PCU_CACHE_LINE_SIZE)
> diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
> index d0aa0661ecd4..d6e8ce8e351a 100644
> --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
> +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
> @@ -244,6 +244,9 @@ void hbg_hw_adjust_link(struct hbg_priv *priv, u32 speed, u32 duplex)
>  
>  	hbg_hw_mac_enable(priv, HBG_STATUS_ENABLE);
>  
> +	if (priv->mac.phy_addr == HBG_NO_PHY)
> +		return;
> +
>  	/* wait MAC link up */
>  	ret = readl_poll_timeout(priv->io_base + HBG_REG_AN_NEG_STATE_ADDR,
>  				 link_status,
> diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c
> index 37791de47f6f..b6f0a2780ea8 100644
> --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c
> +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c
> @@ -20,7 +20,6 @@
>  #define HBG_MDIO_OP_INTERVAL_US		(5 * 1000)
>  
>  #define HBG_NP_LINK_FAIL_RETRY_TIMES	5
> -#define HBG_NO_PHY			0xFF
>  
>  static void hbg_mdio_set_command(struct hbg_mac *mac, u32 cmd)
>  {



Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ