]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: hibmcge: remove unnecessary check for np_link_fail in scenarios without phy.
authorJijie Shao <shaojijie@huawei.com>
Sat, 25 Oct 2025 01:46:41 +0000 (09:46 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 29 Oct 2025 02:11:04 +0000 (19:11 -0700)
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: 1d7cd7a9c69c ("net: hibmcge: support scenario without PHY")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20251025014642.265259-3-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c

index ea09a09c451b789d919b5b9c0c814404b3abbf29..2097e4c2b3d741fb8df5c400f9981998afce9fa9 100644 (file)
@@ -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)
index d0aa0661ecd4d83a5c001a78c119241fb3e8c0ec..d6e8ce8e351a26794d28df8d684c2ee1a3772893 100644 (file)
@@ -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,
index 37791de47f6ffc1a874745b2073ca0b2414d824f..b6f0a2780ea881e479229623a91dee5a3f8f803d 100644 (file)
@@ -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)
 {