From: Jacob Keller <jacob.e.keller@intel.com>
To: Jijie Shao <shaojijie@huawei.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<andrew+netdev@lunn.ch>, <horms@kernel.org>
Cc: <shenjian15@huawei.com>, <liuyonglong@huawei.com>,
<chenhao418@huawei.com>, <lantao5@huawei.com>,
<huangdonghua3@h-partners.com>, <yangshuaisong@h-partners.com>,
<jonathan.cameron@huawei.com>, <salil.mehta@huawei.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net 2/3] net: hibmcge: remove unnecessary check for np_link_fail in scenarios without phy.
Date: Thu, 23 Oct 2025 18:10:01 -0700 [thread overview]
Message-ID: <ebc90ce4-382b-4a0f-891a-5305599f9ae2@intel.com> (raw)
In-Reply-To: <20251021140016.3020739-3-shaojijie@huawei.com>
[-- Attachment #1.1: Type: text/plain, Size: 2669 bytes --]
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@huawei.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)
> {
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
next prev parent reply other threads:[~2025-10-24 1:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 14:00 [PATCH net 0/3] There are some bugfix for hibmcge ethernet driver Jijie Shao
2025-10-21 14:00 ` [PATCH net 1/3] net: hibmcge: fix rx buf avl irq is not re-enabled in irq_handle issue Jijie Shao
2025-10-24 1:15 ` Jacob Keller
2025-10-24 6:39 ` Jijie Shao
2025-10-24 20:23 ` Jacob Keller
2025-10-21 14:00 ` [PATCH net 2/3] net: hibmcge: remove unnecessary check for np_link_fail in scenarios without phy Jijie Shao
2025-10-24 1:10 ` Jacob Keller [this message]
2025-10-24 6:44 ` Jijie Shao
2025-10-21 14:00 ` [PATCH net 3/3] net: hibmcge: fix the inappropriate netif_device_detach() Jijie Shao
2025-10-24 1:05 ` Jacob Keller
2025-10-24 7:21 ` Jijie Shao
2025-10-24 20:24 ` Jacob Keller
2025-10-24 1:08 ` [PATCH net 0/3] There are some bugfix for hibmcge ethernet driver Jacob Keller
2025-10-24 7:24 ` Jijie Shao
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=ebc90ce4-382b-4a0f-891a-5305599f9ae2@intel.com \
--to=jacob.e.keller@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=chenhao418@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=huangdonghua3@h-partners.com \
--cc=jonathan.cameron@huawei.com \
--cc=kuba@kernel.org \
--cc=lantao5@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=salil.mehta@huawei.com \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=yangshuaisong@h-partners.com \
/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 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).