[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b89389e7-7939-4c10-8522-6c8b6ce71b77@huawei.com>
Date: Fri, 24 Oct 2025 14:44:11 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: Jacob Keller <jacob.e.keller@...el.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<andrew+netdev@...n.ch>, <horms@...nel.org>
CC: <shaojijie@...wei.com>, <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 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@...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)
>> {
Powered by blists - more mailing lists