From: Jijie Shao <shaojijie@huawei.com>
To: Jacob Keller <jacob.e.keller@intel.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<andrew+netdev@lunn.ch>, <horms@kernel.org>
Cc: <shaojijie@huawei.com>, <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: Fri, 24 Oct 2025 14:44:11 +0800 [thread overview]
Message-ID: <b89389e7-7939-4c10-8522-6c8b6ce71b77@huawei.com> (raw)
In-Reply-To: <ebc90ce4-382b-4a0f-891a-5305599f9ae2@intel.com>
on 2025/10/24 9:10, Jacob Keller wrote:
>
> 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..
No, fixed_phy is a fake PHY that is always in link state and will call adjust_link().
If you are interested, you can take a look at the code for initializing the fixed PHY
in the hibmcge driver: hbg_fixed_phy_init()
Thanks,
Jijie Shao
>
>> 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)
>> {
next prev parent reply other threads:[~2025-10-24 6:44 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
2025-10-24 6:44 ` Jijie Shao [this message]
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=b89389e7-7939-4c10-8522-6c8b6ce71b77@huawei.com \
--to=shaojijie@huawei.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=jacob.e.keller@intel.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=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
all inboxes | Powered by JetHome®