Skip to content

Commit 1c5e4e9

Browse files
Jijie ShaoNipaLocal
authored andcommitted
net: hibmcge: remove unnecessary check for np_link_fail in scenarios without phy.
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. Therefore, in scenarios without a PHY, the driver no longer checks the np_link status. Fixes: 1d7cd7a ("net: hibmcge: support scenario without PHY") Signed-off-by: Jijie Shao <shaojijie@huawei.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 1ea2243 commit 1c5e4e9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define HBG_PCU_CACHE_LINE_SIZE 32
1818
#define HBG_TX_TIMEOUT_BUF_LEN 1024
1919
#define HBG_RX_DESCR 0x01
20+
#define HBG_NO_PHY 0xFF
2021

2122
#define HBG_PACKET_HEAD_SIZE ((HBG_RX_SKIP1 + HBG_RX_SKIP2 + \
2223
HBG_RX_DESCR) * HBG_PCU_CACHE_LINE_SIZE)

drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ void hbg_hw_adjust_link(struct hbg_priv *priv, u32 speed, u32 duplex)
244244

245245
hbg_hw_mac_enable(priv, HBG_STATUS_ENABLE);
246246

247+
if (priv->mac.phy_addr == HBG_NO_PHY)
248+
return;
249+
247250
/* wait MAC link up */
248251
ret = readl_poll_timeout(priv->io_base + HBG_REG_AN_NEG_STATE_ADDR,
249252
link_status,

drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#define HBG_MDIO_OP_INTERVAL_US (5 * 1000)
2121

2222
#define HBG_NP_LINK_FAIL_RETRY_TIMES 5
23-
#define HBG_NO_PHY 0xFF
2423

2524
static void hbg_mdio_set_command(struct hbg_mac *mac, u32 cmd)
2625
{

0 commit comments

Comments
 (0)